Staging
v0.5.1
https://github.com/python/cpython
Revision c474deaaf63deb633bf9bc951c8cc1cd5d107eda authored by Guido van Rossum on 25 April 1997, 15:38:31 UTC, committed by Guido van Rossum on 25 April 1997, 15:38:31 UTC
dirname in sys.path.  This means that you can create a symbolic link
foo in /usr/local/bin pointing to /usr/yourname/src/foo/foo.py, and
then invoking foo will insert /usr/yourname/src/foo in sys.path, not
/usr/local/bin.  This makes it easier to have multifile programs
(before, the program would have to do an os.readlink(sys.argv[0])
itself and insert the resulting directory in sys.path -- Grail does
this).

Note that the expansion is only used for sys.path; sys.argv[0] is
still the original, unadorned filename (/usr/local/bin/foo in the
example).
1 parent 4246edd
History
Tip revision: c474deaaf63deb633bf9bc951c8cc1cd5d107eda authored by Guido van Rossum on 25 April 1997, 15:38:31 UTC
Expand one level of symbolic link in sys.argv[0] before inserting its
Tip revision: c474dea
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
Parser
Python
Tools
.hgtags -rw-r--r-- 808 bytes
BUGS -rw-r--r-- 11.6 KB
Makefile.in -rw-r--r-- 14.8 KB
README -rw-r--r-- 29.4 KB
TODO -rw-r--r-- 16.0 KB
acconfig.h -rw-r--r-- 2.7 KB
config.h.in -rw-r--r-- 9.3 KB
configure -rwxr-xr-x 106.9 KB
configure.in -rw-r--r-- 15.1 KB
install-sh -rwxr-xr-x 2.1 KB

README

back to top