On Sat, Apr 28, 2012 at 12:16 PM, R. David Murray <rdmurray at bitdance.com>wrote: > That said, could this insertion of '' only happen when the interactive > prompt is actually posted, and otherwise use cwd? > That's already the case. Actually, sys.path[0] is *always* the absolute path of the script directory -- regardless of whether you invoked the script by a relative path or an absolute one, and regardless of whether you're importing 'site' -- at least on Linux and Cygwin and WIndows, for all Python versions I've used regularly, and 3.2 besides. It isn't the value of cwd unless you happen to run a script from the same directory as the script itself. But even then, it's absolute, and not an empty string: the empty string is only present for interactive sessions. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20120428/303d513b/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4