new.py and having '.' in PYTHONPATH

Ian Kelly ian.g.kelly at gmail.com
Mon Feb 23 17:29:05 EST 2015


On Mon, Feb 23, 2015 at 3:14 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 02/23/2015 01:00 PM, Tobiah wrote:
>
>> Anyway, it raises the question as to whether having '.' in the
>> PYTHONPATH is at all a sane thing to do.
>
> The current directory is added to sys.path /only/ for the interactive interpreter.

When executing a file, the directory containing the file is added to
sys.path instead, which amounts to the same thing if the file that
you're executing is in your current working directory.



More information about the Python-list mailing list