[Tutor] Tutor Digest, Vol 61, Issue 3
dorseye at gmail.com
Sun Mar 1 23:27:48 CET 2009
Not sure if this is what you mean, but:
Say you have the files efunc.py and trytry.py in the same folder.
*The content of efunc.py is:*
*The content of trytry.py is:*
*Output would be:*
name at ububox:~$ python trytry.py
name at ububox:~$
trtry.py "easily and automatically" uses the code from efunc.py It calls the
function funky(). Granted this is a prety silly example, but is that what
you mean by using code written by someone else? You do this with modules all
the time, like import os, import glob, etc. Any .py file imported into
another .py file is a module, granted most of them are a bit more useful
> I'm sorry, I've realized I didn't explain my needs at all.
> I was a little influenced by drupal's definition of modules, which is
> completely different from python's.
> With module here I meant plug-in or extension: a piece of code written
> by someone else that can be easily (and automaticallly) integrated
> into my program.
> My program must provide the posibility to be extended without editing
> its code, just like mozilla's add-ons.
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor