**NEWBIE - QUESTION**

Staven Bruce Staven.Bruce at valleyair.org
Tue Oct 28 13:29:39 EST 2003


Thanks Jay and Matt,

Matt, as to your question 'why', I may be way out of my league here, but I
am trying to tweak a Mailman module to customize the behavior. I've made the
change I need to in a copy of the .py file, so now I want to create the .pyc
file, put the new files into the program and see what happens. This is my
first stab with Python, so I am a bit in the dark.

-Staven 

 -----Original Message-----
From: 	Matt Goodall [mailto:matt at pollenation.net] 
Sent:	Tuesday, October 28, 2003 10:26 AM
Cc:	'python-list at python.org'
Subject:	Re: **NEWBIE - QUESTION**

Jay Dorsey wrote:

> Staven Bruce wrote:
>
>> I am new to Python and am trying to use the Python-2.3.2-1Interperter on
>> Windows. I have a .py file and I am trying to compile it into a .pyc 
>> file.
>> When I began experimenting with Python, I could have sworn that 
>> opening the
>> .py file in IDLE, modifying it, and then saving it would automatically
>> create the corresponding .pyc file. But this is not working.
>
Out of interest, why are you trying to compile the module? This is 
generally not something you need to worry about.

>
> I believe you have to *run* the file to get it to compile, not just 
> save it.

Actually, Python only compiles modules that are imported, e.g.

    python file.py

would not compile it, whereas

    $ python
    >>> import file.py
    >>>

would compile it.

Cheers, Matt

-- 
Matt Goodall, Pollenation Internet Ltd
w: http://www.pollenation.net
e: matt at pollenation.net



-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list