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/2017-March/147622.html below:

[Python-Dev] Set program name through exec -a

[Python-Dev] Set program name through exec -a [Python-Dev] Set program name through exec -aOleg Broytman phd at phdru.name
Sat Mar 18 11:42:46 EDT 2017
Hi!

On Sat, Mar 18, 2017 at 02:15:12PM +0100, Freddy Rietdijk <freddyrietdijk at fridh.nl> wrote:
> I would like to know if you're open to supporting `exec -a` or an

   Not everyone here knows what `exec -a` is so let me say that it's a
bashism that sets program's name. `exec prog` is interpreted as a system
call `exec('prog', 'prog')` and  `exec -a name prog` is interpreted as
`exec('prog', 'name')`.

   Currently sys.argv[0] is the name of the script and it should stay
that way. But it would be interesting to preserve argv[0] from C and
expose it via sys in addition to sys.executable. Something like
sys.original_prog_name. Then the OP can do anything application-specific
-- set sys.argv[0], call setproctitle, whatever.

> Kind regards,
> 
> Frederik

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.
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