Written python script to copy command line arguments to the clipboard:
#
# Take command line arguments and paste them to the clip board.
#
import sys
import win32clipboard
win32clipboard.OpenClipboard(0)
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(",".join(sys.argv[1:]))
win32clipboard.CloseClipboard()
Then added a shortcut to the script in the 'Send To' menu called 'Copy Path To Clipboard' with the following target:
C:\Python23\pythonw.exe C:\Play\Python\CopyArgToClipboard.pyw
Now I can easily copy the path of any file or directory in explorer to the clipboard. It's useful to me, for example when I want to stick an absolute path to a file into a python script. There used to be a power toy to do this, maybe the windows 95 version works on windows 2000 but anyway, a 10 line Python script does the job.
|