Calling Python from Python and .pyc problem

Steve Holden steve at holdenweb.com
Fri Nov 7 16:07:14 EST 2008


Terry Reedy wrote:
> David Shi wrote:
>> Hello, there.
>>
>> I am using Python 2.5.  I used py_compile and made a .pyc file.  
> 
> No need usually.
> 
>> However, it runs but never stops.  What is the best way to
>>
>> compile a .py file.
> 
> When you run a .py file, it automatically compiles and write a .pyc file
> if there is no .pyc file or if the .py is newer than the .pyc.
> 
True only if you replace "run" with "import". It also creates a new .pyc
file if an existing valid .pyc was created by some other version of Python.

However, I suspect the OP's problem is nothing to do with .pyc files,
but rather to do with writing algorithms that terminate.

The question was about as useful as "I have a car that won't start, will
you please tell me how to fix it". Unfortunately it appears the Python
is so valuable we are not to be allowed to see it.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list