On 06/18/2012 09:19 AM, Neal Becker wrote:
> Am I correct that a module could never come from a file path with a '.' in 
> the 
> name?
>

No.

Simple example: Create a directory called src.directory
In that directory, create two files

::neal.py::
import becker
print becker.__file__
print becker.hello()


::becker.py::
def hello():
    print "Inside hello"
    return "returning"


Then run neal.py, from that directory;


davea@think:~/temppython/src.directory$ python neal.py
/mnt/data/davea/temppython/src.directory/becker.pyc
Inside hello
returning
davea@think:~/temppython/src.directory$

Observe the results of printing __file__

Other approaches include putting a directory path containing a period
into sys.path



-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to