A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-May/119251.html below:

[Python-Dev] Python program name

[Python-Dev] Python program nameAntoine Pitrou solipsis at pitrou.net
Fri May 4 14:33:47 CEST 2012
On Fri, 4 May 2012 13:29:14 +0100
Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> 
> On 4 May 2012, at 09:44, Vinay Sajip wrote:
> 
> > IIUC, the program name of the Python executable is set to whatever argv[0] is.
> > Is there a reason for this, rather than using one of the various OS-specific
> > APIs [1] for getting the name of the running executable? The reason I ask is
> > that in a virtual environment (venv), the exe's path is the only thing you have
> > to go on, and if you don't have that, you can't find the pyvenv.cfg file and
> > hence the base Python from which the venv was created.
> 
> 
> argv[0] is the *script* name, not the executable name - surely?
> 
> The executable path is normally available in sys.executable.

I think Vinay is talking about C argv, not sys.argv.

Regards

Antoine.


More information about the Python-Dev mailing list

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