Python's import: why doesn't it work?
Lulu of the Lotus-Eaters
mertz at gnosis.cx
Sun Sep 29 12:47:20 EDT 2002
|Once again my attempt to profit from Python's vaunted productivity
|increase has come to a screeching halt because some innocent thing
|that one would reasonably expect to work in one line, intuitively, and
|without even having to think about, turns into a nightmare already
|lasting more than an hour, requiring numerous experiments, searching
|through the documentation - both manually and using my editor's
Perhaps you would be happier using a different programming langauge (one
that works without consulting documentation, apparently). I hear there
are a number of other languages out there.
|>>> import templates.intro
Perhaps you should look into the standard documentation on import paths
(PYTHONPATH). I'm not really sure why you would imagine for a moment
that any of those things you suggest would have any good effect....
Python is a programming language, not magical incantations that fulfills
|Abject Defeat, Ask on Internet, Be Ridiculed by Peers for Not Managing
I would say that your post deserves ridicule. Not because you ask about
"basic operation", but for its obnoxious and self-important tone. You
catch more flies with honey than vinegar, y'know.
|... and it would work. For real. The symbols were there. Not a peep
|out of the interpreter.
Yep. Almost surely that's because you tried it at some point with the
CWD in the same place as intro.py.
Keeping medicines from the bloodstreams of the sick; food from the bellies of
the hungry; books from the hands of the uneducated; technology from the
underdeveloped; and putting advocates of freedom in prisons. Intellectual
property is to the 21st century what the slave trade was to the 16th.
More information about the Python-list