[Tutor] function location and importing modules

Michael Montagne michael at themontagnes.com
Thu Jan 15 10:42:56 EST 2004


I.
I have a simple login script that I am trying to simplify more by
putting some code into functions.  I'm finding that the functions can
only be called if they are placed BEFORE the call in the script.  Is
this really true?  Is there a different way to do it?  It is just that
it is more aesthetically pleasing to have the main function code
first.

II.
What is the proper way to be able to import custom modules.  This is
for my login script mentioned previously and python is not installed
on the server, just the workstations.  The script must live on the
server and I'd like to keep the support modules on yet another server.
Is it just a question of modifying PYTHONPATH on the fly each time the
script is run?  


-- 
Michael Montagne
michael at themontagnes.com
http://www.themontagnes.com



More information about the Tutor mailing list