473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Compiling a Python File on Mac OS X Tiger

Hello. I am working on Tiger and wanted to find out how to compile a
Python (.py) file into a .pyc file and then into a .pyo file. Can the
compilation be achieved within the interpreter? Also, I am
new to Python and wanted to know the difference between .pyc and .pyo
files. Is this comparison similar to C? Any help would be appreciated.
Thanks.

- Asad
Jul 26 '05 #1
1 1657
Asad Habib wrote:
Hello. I am working on Tiger and wanted to find out how to compile a
Python (.py) file into a .pyc file and then into a .pyo file. Can the
compilation be achieved within the interpreter? Also, I am
new to Python and wanted to know the difference between .pyc and .pyo
files. Is this comparison similar to C? Any help would be appreciated.
Thanks.


http://www.network-theory.co.uk/docs/pytut/tut_48.html has some good
explanations. To generate the .pyo files from the interpreter, add the
-O option.

The difference between .pyc and .pyo files is that .pyo files are
optimized a bit; for example docstrings are removed (which will break
pydoc tests). According to the above link, .pyo files don't run any
faster; they just load faster.
Jul 26 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: A. B., Khalid | last post by:
Hello all. After a search on Google it would seem that the users of Mingw have not had good results in compiling the python sources natively. See at least: ...
29
by: Maurice LING | last post by:
Hi, I remembered reading a MSc thesis about compiling Perl to Java bytecodes (as in java class files). At least, it seems that someone had compiled scheme to java class files quite successfully....
11
by: Alex Martelli | last post by:
Thanks to David Bolen, who did the build, I have been able to make available a win32 packaging for gmpy 1.0 on python 2.4 alpha 2 (should work on any later Python 2.4 as well, but I have no way to...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
217
by: gyromagnetic | last post by:
The following url points to an article written by Damian Conway entitled "Ten Essential Development Practices": http://www.perl.com/pub/a/2005/07/14/bestpractices.html Althought the article has...
0
by: mmarkzon | last post by:
I have been struggling compiling linkchecker from http://linkchecker.sourceforge.net/. The last thing I get is "error: command 'gcc' failed with exit status 1" which is not very helpful. This is...
2
by: Thomas Ploch | last post by:
Hello, I followed the instructions in the Mac/README file. I ran ./configure --enable-framework But when I try to build from source with gcc 4.0.2, following happens:
1
by: Mark Livingstone | last post by:
Hello! I am a Uni student and for a project in Information Systems Security due in just under two weeks, I have tried to make a Python version of the Biham / Anderson Tiger Hash function. I have...
8
by: dirkheld | last post by:
Hi, I upgraded my system from tiger to leopard. With leopard came a new version of python 2.5 Now I trying to run some python code that previously worked on tiger (which included an older...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.