4 ms·
Ya... if you're trying to get the path of the script, you can use `__file__` special variable (instead of loading it from bash $0 and grabbing sys.argv[0]). Fo
by icegreentea2 5y ago
Ya... if you're trying to get the path of the script, you can use `__file__` special variable (instead of loading it from bash $0 and grabbing sys.argv[0]).
For adding current directory to front of path, the sys.path.insert() call is a pretty sound way of doing it.
- yongjik 5y agoYeah, I think you're right - didn't know about __file__. (To clarify, using "$0" with bash is just standard method to invoke the same script with an interpreter - sys.argv[0] will work with or without bash exec part.)