Teen Programmers Unite  


Return to forum top

Some Python, and Interpreter questions...

Posted by FatalDragon [send private reply] at May 06, 2002, 09:20:00 PM

Ok, I know that Python uses an interpreter, but is there any way you can make a program with Python outside of the interpreter? Im asking because some of the files in C/:Python22/Lib/ say "Compiled Python File", and also there is a folder with Python that has the name "compiler".

And also, if you cant make .EXE files with interpreter languages, what are they realy made to do then? Im sure they have some purpose, I just dont see it yet...

Posted by FatalDragon [send private reply] at May 06, 2002, 09:24:40 PM

Well, I found the Python file "compileall", it appears you put it into the folder with Python source codes you want compiled, double click it and then it compiles all the files in that folder, or at least thats what it looks like, can anyone back this up???
What are allof those Python source code files in the "Lib" folder?

Posted by unknown_lamer [send private reply] at May 07, 2002, 08:16:47 AM

See my most in the "Need Help with a C Compiler" thread. I don't think you can execute python bytecode files directly on Windows, but you can on GNU/Linux using the binfmt_misc module (Debian is nice enough to set up binfmt_misc associations for java, common-lisp, python, and windows programs [if you have the programs that can load those languages of course]) if you install a package (apt-cache search binfmt, I forgot the name). The alternative is to run the Python script (with the location of the Python interpreter in its hash-bang line)...this will cause Python to bytecompile the file if it isn't, and use the compiled python file if it has already been bytecompiled. This, of course, relies on another unixism (the #! line).

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.