Re: [python] multiple files of source code
Also there is the "package" solution where you have a folder "Modules" (you can call the folder whatever you want) with several .py files which can all contain 1 or more classes. Inside the Modules folder you put a file called __init__.py (notice double _ before and after) where you import all modules within the folder.
Notice that you exclude the .py - then to import this in your main_app.py just:
from Functions import *
In our case
Then to use a class within Functions you need to call Modules.Functions.YourClass()
This is a really great way of orginazing your code, although this is probably more used on bigger projects.
Last edited by Sprut1; December 31st, 2008 at 01:00 AM.
Desktop: Windows 7 / Ubuntu 10.04
Netbook: Ubuntu 10.04