[Python-ideas] Why is there no way to pass PYTHONPATH on the command line?

Daniel Holth dholth at gmail.com
Sat Sep 15 00:11:29 CEST 2012


On Fri, Sep 14, 2012 at 6:10 PM, Mike Graham <mikegraham at gmail.com> wrote:
> On Fri, Sep 14, 2012 at 5:24 PM, Daniel Holth <dholth at gmail.com> wrote:
>> Why is there no way to pass PYTHONPATH on the command line? Oversight
>> or intentional?
>>
>> Given path_item/something.py
>>
>> python -p path_item -c "import something; something.foo()"
>>
>> I am aware that the __main__.py behavior lessens the need for this
>> significantly.
>
> PYTHONPATH=whatever python -c "import something; something.foo()"
>
> Mike

Yes, I've heard of that one. Does it work on Windows too?



More information about the Python-ideas mailing list