Re: [Tutor] python import problem

2006-08-10 Thread Alan Gauld
The other way would be to add each folder to your PYTHONPATH It works for me now: import sys import os.path sys.path.append(os.path.join(sys.path[0] ,translate)) That isn't using PYTHONPATH its updaing sys.path which is slightly different.. This way you need to do that for every program

[Tutor] python import problem

2006-08-09 Thread kakada
Hi all, I have problem with import statement. supposed that I have two files in different folders : modules/myfile.py and translate/factory.py. the folders modules and translate are in the same level, so if I want to import factory.py into myfile.py, how can I do? I have already done in

Re: [Tutor] python import problem

2006-08-09 Thread Alan Gauld
the folders modules and translate are in the same level, so if I want to import factory.py into myfile.py, how can I do? You need to make your folders into packages. Its fairly simple, you basically create an init.py file But its worth reading about packages in the docs Come back here ifv you

Re: [Tutor] python import problem

2006-08-09 Thread wesley chun
if I want to import factory.py into myfile.py, how can I do? You need to make your folders into packages. Its fairly simple, you basically create an init.py file But its worth reading about packages in the docs Come back here ifv you have any questions after that. The other way would be

Re: [Tutor] python import problem

2006-08-09 Thread kakada
បានសរសេរ Alan Gauld: Hi Alan, the folders modules and translate are in the same level, so if I want to import factory.py into myfile.py, how can I do? You need to make your folders into packages. Its fairly simple, you basically create an init.py file But its worth reading about packages in