The original command python line

Damjan Georgievski gdamjan at
Sun Mar 4 07:20:28 CET 2012

>>> How can I get the *really* original command line that started my python
>>> interpreter?
> <snip>
>> On Linux, you can read from:
>>    /proc/<PID here>/cmdline
>> to get the null-delimited "command line".
> After some further searching:
> psutil offers `Process.cmdline` cross-platform;
> see

Indeed, changing for

	args = psutil.Process(os.getpid()).cmdline

in the above example does solve the problem, at least in Linux.

> Sidenote: Consensus generally seems to be that relative imports are a
bad idea.

How come?
I'm using explicit relative imports, I thought they were the new thing?


More information about the Python-list mailing list