Re: [Tutor] this module

2009-08-09 Thread bob gailer
Alan Gauld wrote: "Mark Young" wrote Thanks everybody, I didn't know modules ran code when you imported them, I just thought they defined the functions, etc. in them. They do that too. But in Python a function definition is created by running the code! So you write def foo(): return

Re: [Tutor] this module

2009-08-09 Thread Alan Gauld
"Mark Young" wrote Thanks everybody, I didn't know modules ran code when you imported them, I just thought they defined the functions, etc. in them. They do that too. But in Python a function definition is created by running the code! So you write def foo(): return 42 To define foo y

Re: [Tutor] this module

2009-08-08 Thread Mark Young
Thanks everybody, I didn't know modules ran code when you imported them, I just thought they defined the functions, etc. in them. Thanks for the info. I'm going to go look at the module's code now that I know where it's at. Mark Young ___ Tutor maillist

Re: [Tutor] this module

2009-08-08 Thread Dave Angel
Mark Young wrote: Hi, I was reading a tutorial, and it mentioned the "import this" easter egg. I was curious, and looked up the contents of the module, and dscovered that it had attributes c, d, i, and s. I was wondering if anyone had any clue what these attributes were supposed to mean. I think

Re: [Tutor] this module

2009-08-08 Thread Chris Fuller
Something else to note: you can find any module's location by looking it up in the dictionary sys.modules. For instance: Python 2.4.4 (#2, Oct 22 2008, 19:52:44) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >

Re: [Tutor] this module

2009-08-08 Thread Alan Gauld
"Mark Young" wrote I was curious, and looked up the contents of the module, and dscovered that it had attributes c, d, i, and s. I was wondering if anyone had any clue what these attributes were supposed to mean. Mostly they are just variables used to construct the message. The values are

Re: [Tutor] this module

2009-08-08 Thread Chris Fuller
On Friday 07 August 2009 21:31, Mark Young wrote: > Hi, I was reading a tutorial, and it mentioned the "import this" easter > egg. I was curious, and looked up the contents of the module, and dscovered > that it had attributes c, d, i, and s. I was wondering if anyone had any > clue what these attr

[Tutor] this module

2009-08-07 Thread Mark Young
Hi, I was reading a tutorial, and it mentioned the "import this" easter egg. I was curious, and looked up the contents of the module, and dscovered that it had attributes c, d, i, and s. I was wondering if anyone had any clue what these attributes were supposed to mean. I think (this.s) is the zen