**NEWBIE - QUESTION**

S

Staven Bruce

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.

I have checked the FAQ's and the Python Help pages, but I believe I am
somewhat dense. If I try to call 'compileall file.py', the syntax is
invalid. If I try to call 'compile file.py' I also receive a syntax error. I
know I am missing something rather basic here, but if anyone could
point/shove me in the right direction I would appreciate it.

Staven
 
D

Dennis Lee Bieber

Staven Bruce fed this fish to the penguins on Tuesday 28 October 2003
09:44 am:
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.

pyc files are normally only created when a running program performs an
import of the module. The main program file, therefore, doesn't
generate a pyc file. (You can always do an import from an interactive
python window to do that generation).

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top