Skip to content

Instantly share code, notes, and snippets.

@reterVision
Created February 4, 2013 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reterVision/4705844 to your computer and use it in GitHub Desktop.
Save reterVision/4705844 to your computer and use it in GitHub Desktop.
A Python Script doing auto symbolic link for you.
#!/usr/bin/env python
import subprocess
import argparse
parser = argparse.ArgumentParser(description='Do the symbolic for you.')
parser.add_argument('--source', dest='folder',
help='Your code directory')
parser.add_argument('--virtual', dest='vfolder',
help='Your code directory')
folder, vfolder = (None, None)
args = parser.parse_args()
globals().update(vars(args))
print "Your source code is in", folder
print "And your virtualenv lib directory is in", vfolder
ok = raw_input("Do you want to continue(Y/N)?")
if ok != 'Y':
exit(0)
print "Start make symbolic links...."
LIBS = ["Your Libraries Here"]
for lib in LIBS:
command = "ln -sfn {0}{1} {2}".format(folder,
lib,
vfolder)
print command
subprocess.call(command, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment