python import error, what's wrong?

Ben Finney ben+python at benfinney.id.au
Wed Aug 3 09:45:40 CEST 2011


Ulrich Eckhardt <ulrich.eckhardt at dominolaser.com> writes:

> > the directory structure is as follows:
> > 
> > src
> >   org.test
> >       A.py
> >   org.lab
> >       B.py
>
> Python uses a dot as separator between different parts of nested
> structures, like e.g. the directories during import.

More generally, the name of a module must be a valid Python identifier.
Hence, the module-name part of a directory or of a filename must also be
a valid Python identifier.

The ‘.’ (U+002E FULL STOP) character is not valid in an identifier.

-- 
 \        “Pinky, are you pondering what I'm pondering?” “Wuh, I think |
  `\   so, Brain, but wouldn't anything lose its flavor on the bedpost |
_o__)                               overnight?” —_Pinky and The Brain_ |
Ben Finney



More information about the Python-list mailing list