4
How to copy the full path containing the file name to the Clipboard using the "shortcut" CTRL-C?
For example: Inside windows explorer select a file (teste.py
) using the CTRL-C and then the CTRL-V in a text editor. I try the final result: c:\temp\teste.py
I’m initially thinking of using the widget Function Windows Explorer subprocess.Popen
import subprocess
subprocess.Popen(r'explorer /select,"c:\temp\"')
Once captured the file path I can copy it on Clipboard using a similar subroutine below:
from Tkinter import Tk
mypath = "c:/temp/teste.py"
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append(mypath)
r.destroy()