On 2008-05-06, Jeffrey Froman <[EMAIL PROTECTED]> wrote: > Nice to see another Slackware user around here!
Likewise. ;) > That's correct. A function doesn't generally *do* anything until it is > called. Here, it is only defined. The only thing this function does when > called is to print the value of bruce twice. I suspected as much. It was a bit confusing, but I get it now. > Functions are objects too, and this is a printed representation of that > function object. It still hasn't been "called" at this point. Good to know. Thnx. > other python "special" attributes, it starts and ends with TWO underscores. ...as Alex also pointed out. I didn't notice that. Thnx. > You are correct to create this script yourself from scratch. Do python scripts require the: #!/usr/bin/env python ....line at the beginning of every script or just the .py file extension? I see examples both ways, with and without. > Your module files, i.e., chap03.py, should be in one of the directories on > that path. Gotchya. > "from" modifies a *module* name, not a path component. So "from module > import one_function, another_function". This allows you to use one_function > without referencing it through the imported module name. In other words, > these two are equivalent: > >>>> import chap03 >>>> chap03.print_twice() > > and: > >>>> from chap03 import print_twice >>>> print_twice() > > In the above examples, "chap03" is the *module* file, chap03.py. mmmmm..... that's still a bit much to wrap my feeble brain around, but I get your drift. I'm still working on the basic function concept as python uses it. But, I found two more websites that explain it better and I think I pretty much get it, now. Thank you, and the others, for your help. It's very much appreciated. nb Slackware: simplicity through transparency -- http://mail.python.org/mailman/listinfo/python-list