Create your own modules by placing the code in a file with the
extension ".py".
Don't include the .py extension when importing the module.
/home/dave> cat > mymodule.py
def foo(x):
return x * 17
/home/dave> python
Python 2.2.2 (#1, Mar 17 2003, 15:17:58)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mymodule
>>> mymodule.foo(3)
51