Where is path.py?

MRAB python at mrabarnett.plus.com
Thu Nov 27 10:21:28 EST 2014


On 2014-11-27 14:10, David Aldrich wrote:
> Hi
>
> I am running Python 2.7 on Windows 8.1. Today I installed path.py
> using easy_install:
>
> easy_install path.py
>
> The example code that I've seen imports path.py as follows:
>
> from path import path
>
> I am fairly new to Python and have a few questions about this:
>
> 1) Why is 'from path' required here?
>
The syntax:

     from <module> import <name>

will import the name <name> from the module <module>, so:

     from path import path

will import the name 'path' (a class) from the module 'path'.

> 2) I am using Microsoft's PTVS IDE to develop my code. It is not
> displaying code completion for path.py (it works for the standard
> libraries). How would I tell PTVS about path.py?
>
> Perhaps I just need to know where path.py is as I can't find it in my
> filesystem.
>
Try:

import path
print path.__file__



More information about the Python-list mailing list