Sinisterly
[Python] Symlink shell - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Python (https://sinister.ly/Forum-Python)
+--- Thread: [Python] Symlink shell (/Thread-Python-Symlink-shell)



[Python] Symlink shell - KaiT_AleX - 03-19-2012

Here is some simply script. I was little drunk, so sorry if there is any errors Smile
For Linux :
Code:
#Symlink Shell by c0ax aka KaiT_AleX #Greetz b0ne^, baltazar #Visit ljuska.org & darkartists.info #Usage python symlink.py /home/username/fileuwant newfilename #symlink.py /home/ljuska/config.php ljuskacon.txt import os, sys if sys.platform == 'linux' or sys.platform == 'linux2': clsshit = 'clear' else: clsshit = 'cls' os.system(clsshit) else: curr = sys.argv[1] file = sys.argv[2] secnddir = os.getcwd() + file if os.path.islink(secnddir): print "Link Exist" print "Please change name of file" print "Visit ljuska.org" pass else: print "Making link" print "File " + file + " created." print "Visit ljuska.org" os.symlink(curr, secnddir) #EOF #Script by c0ax aka KaiT_AleX

For Windows :

Code:
#Symlink Shell by c0ax aka KaiT_AleX #Greetz b0ne^, baltazar #Visit ljuska.org & darkartists.info #Usage symlink.py /home/username/fileuwant newfilename #symlink.py /home/ljuska/config.php ljuskacon.txt import os, sys if sys.platform == 'linux' or sys.platform == 'linux2': clsshit = 'clear' else: clsshit = 'cls' os.system(clsshit) else: curr = sys.argv[1] file = sys.argv[2] secnddir = os.getcwd() + file if os.path.islink(secnddir): print "Link Exist" print "Please change name of file" print "Visit ljuska.org" pass else: print "Making link..." print "File " + file + " created." print "Visit ljuska.org" os.system('mklink' + secnddir + curr) #EOF #Script by c0ax aka KaiT_AleX



RE: [Python] Symlink shell - Shining White - 03-19-2012


IF ELSE ?
only on Python Biggrin?
i should try it Biggrin