Skip to content

Instantly share code, notes, and snippets.

@godwhoa
Last active November 17, 2015 00:21
Show Gist options
  • Save godwhoa/3125bf840b640445e181 to your computer and use it in GitHub Desktop.
Save godwhoa/3125bf840b640445e181 to your computer and use it in GitHub Desktop.
copy and paste files when using separate shells
#!/usr/bin/python
import sys,os
clip = os.environ['HOME']+'/.fileclip'
path = sys.argv[1]
f=open(clip,'w')
f.write(os.getcwd()+'/'+path)
f.close()
#!/usr/bin/python
from subprocess import call
import os
f=open(os.environ['HOME']+'/.fileclip','r')
path = f.read()
f.close()
call(["cp", "-a",path,"."])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment