On Feb 24, 3:21 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080224 20:01], Adekoba ([EMAIL PROTECTED]) wrote: > > >I don't think moving food.py's code to __init__.py would work out to > >well, because then how would I run the script? > > import food > > Which in turn has something like this in food/__init__.py: > > from food.cheese import gouda > from food.ham import parma > > __all__ = ['gouda', 'parma'] > > and in turn in your script you can now use food.gouda and food.parma. > > Unless I totally misunderstood what you are trying to achieve. > > -- > Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai > イェルーン ラウフロック ヴァン デル ウェルヴェンhttp://www.in-nomine.org/|http://www.rangaku.org/ > We have met the enemy and they are ours...
I was just curious if I could get a script name to be the same name as the package directory, but apparently it is not possible. Instead I think I am going to do something like: setup.py food/ __init__.py ham.py cheese.py scripts/ food and just set my PYTHONPATH to the parent directory. I have never done a full scale project before in python, but I think this is probably on track with what most people would do.
-- http://mail.python.org/mailman/listinfo/python-list