Question about compiling.

Rob Wolfe rw at smsnet.pl
Wed Jan 10 15:51:13 EST 2007


Gabriel Genellina <gagsl-py at yahoo.com.ar> writes:

> At Tuesday 9/1/2007 14:56, Steven W. Orr wrote:
>
>>I *just* read the tutorial so please be gentle. I created a file called
>>fib.py which works very nicely thank you. When I run it it does what it's
>>supposed to do but I do not get a resulting .pyc file. The tutorial says I
>>shouldn't do anything special to create it. I have machines that have both
>>2.4.1 and 2.3.5. Does anyone have an idea what to do?
>
> Welcome to Python!
> When you run a script directly, no .pyc file is generated. Only when a
> module is imported (See section 6.1.2 on the tutorial). And don't
> worry about it...

That's not the whole truth. :)
If you want to compile your script, you can do that, of course:

$ ls fib*
fib.py
$ python2.4 -mpy_compile fib.py
$ ls fib*
fib.py  fib.pyc

-- 
HTH,
Rob



More information about the Python-list mailing list