FAQ
I'm using python2.2.1 on Solaris8.
When I launch a python script, it imports modules from the directory
where the script is, not from current directory. For example,

$ pwd
/home/inyeol/test/d
$ ls .
bar.py
$ cat bar.py
print "I'm bar"
$ ls ..
foo.py
$ cat ../foo.py
#!/usr/bin/env python
import bar
$ ../foo.py
Traceback (most recent call last):
File "../foo.py", line 3, in ?
import bar
ImportError: No module named bar
$ mv ./bar.py ..
$ ../foo.py
I'm bar
$

Is it a bug or a feature?

Inyeol...

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedMay 29, '02 at 10:16p
activeMay 29, '02 at 11:33p
posts2
users2
websitepython.org

2 users in discussion

Jeff Shannon: 1 post Inyeol Lee: 1 post

People

Translate

site design / logo © 2022 Grokbase