Maybe a dumb question
fabien.henon at caramail.com
Tue Sep 10 17:58:38 EDT 2002
I have written an editor for Povray using Python, Tkinter and Pmw
It is available at :
The software includes one main file and 6 others which are for the
language customization. People can choose between French, English,
All the translations for these languages are stored in files called
menu_francais.py, menu_english.py, menu_deutsch.py ....when the editor
I would like to clean the directory a bit and put all these 'languages
files' into a sub-directory called Lang.
How do I tell python to look into a particular sub-directory when
importing a file.
I tried the os.path.join syntax, but to no avail.
Below is the bit of code that imports the language file from the current
working directory :
homedir = os.path.expanduser('~')
fd = open(homedir+"/.pyvonrc", 'r')
for line in fd.readlines():
if line.startswith("Language :"):
if line.startswith("francais"):from menu_francais import *
elif line.startswith("english"):from menu_english import *
elif line.startswith("deutsch"):from menu_deutsch import *
More information about the Python-list