> hello, > i have to plug two functions b() and c() inside another one a(); > i wonder if the code defining b and c must be in the same text file of > a or it is possible to import b and c somehow, hence giving the code a > neater appearance
Definitely! Read through http://docs.python.org/tutorial/modules.html, that should definitely get you started. Basically, with b & c defined in file1.py (choose your own appropriate name), from file2.py you can do: import file1 def a(...): file1.b() file1.c() or (bit shorter, but can be less clear): from file1 import b, c def a(...): b() c() Evert _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor