On 31/08/12 22:51, Ray Jones wrote:

Okay. Now I must figure out how to create the module and have my calling
script look in the right place.... ;)

Creating a module is just a matter of creating a standard python file

<--------start of myvar.py ----->
#! /bin/python    # you don't even really need a shebang for modules!
myVar = 66
<-------- end of myvar.py ------>

import myvar
print myvar.myVal


And so long as the location of the module is in your sys.path
(or in the PYHONPATH environment variable) python will find it.



--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to