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
"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
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
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
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.
>
"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
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
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