473,503 Members | 7,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

should I distribute .pyc files?

Hi,

I am creating not-so-important opensource application written in python
for Linux. I have two files python source in src directory, named
blabla1.py and blabla2.py. There are byte compiled files too, named
blabla1.pyc and blabla2.pyc. Should I distribute these files (pyc
files) to users? If I don't distribute them, and user installed my
application into /usr (not writable by normal user) then run it as
normal user, off course, the python cannot make byte-compiled version.
Will my program runs slower in user computer then in my computer
because I have byte compiled version?

Thank you.

Dec 19 '06 #1
1 4055
"akbar" <ak*******@gmail.comwrote:
I am creating not-so-important opensource application written in python
for Linux. I have two files python source in src directory, named
blabla1.py and blabla2.py. There are byte compiled files too, named
blabla1.pyc and blabla2.pyc. Should I distribute these files (pyc
files) to users? If I don't distribute them, and user installed my
application into /usr (not writable by normal user) then run it as
normal user, off course, the python cannot make byte-compiled version.
Will my program runs slower in user computer then in my computer
because I have byte compiled version?
Short answer: use distutils or build a python egg. These will automate most
of the distribution process.

Longer answer:

distutils (standard in Python) will build you a variety of installation
packages such as zip, tar, rpm, or windows .exe (even from linux). The
installation step will do all necessary compiling from .py to .pyc (and
also builds extension modules although that can be problematic for a
windows distribution where the correct compiler almost certainly isn't
available).

setuptools (http://cheeseshop.python.org/pypi/setuptools) is a collection
of enhancements to distutils which let you build .egg files. Once you start
using egg files you can include dependencies between package versions and
if your product requires a bunch of other packages the installation step
will download and install the appropriate versions.

See http://peak.telecommunity.com/DevCenter/EasyInstall for instructions on
installing packages built in this way, but in short, the user has to run
ez_setup.py from the EasyInstall page, and then a command like:

easy_install http://example.com/path/to/MyPackage-1.2.3.tgz

would download and install your package and all the other products it
depends on. If at a later stage they want to upgrade to a more recent
version then all they need to do is to run:

easy_install --upgrade MyPackage

Installed eggs usually exist in a single file (importable zip) which makes
uninstalling especially easy: just one file to delete.
Dec 19 '06 #2

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

Similar topics

4
3946
by: Ed Landau | last post by:
Hi: I've just developped a really simple MS Access App. The VBA runs within the database. It uses some DLLs which I register with a script. It's on MS Access2003 (Office11). I've got 2003Pro...
1
1654
by: Yogi_Bear_79 | last post by:
I recently some embedded GZIP files into my project. I added the sharpziplib.dllas a referance. But when I distribute the .exe it looks for the .dll. Did I do something wrong, or miss step? I...
0
2615
by: Danny J. Lesandrini | last post by:
Didn't get any takers on this post this morning at dotnet.General, so I'm reposting here. First, this is _not_ a question about how to get Crystal Reports to run on a client machine. I've got...
51
3196
by: mojosam | last post by:
I've been watching the flame war about licenses with some interest. There are many motivations for those who participate in this sector, so disagreements over licenses reflect those agendas. I...
4
1249
by: mike7411 | last post by:
Is there an easy way to tell which files I need to distribute with my Microsoft Visual Studio 2005 MFC application? I keep getting a vague message on my target computer saying the application...
15
1953
by: Bob Alston | last post by:
Is it considered best practice to distribute FE databases as MDEs rather than MDBs? Without flaming me for asking the question, could someone please enumerate the key advantages? Also I like to...
2
1319
by: Bruce | last post by:
I have seen sample code that is implemented in the .h header file ("java style") and I have seen samples where the code was implemented in the ..CPP file. Which is correct? What is the best...
6
2506
by: Salman | last post by:
I would like to know how I can distribute the application that I create with Visual C++ express edition. I checked the menu options to find a deploy option similar to the one found on the Visual...
49
2697
by: ARC | last post by:
Hello all, I have one chance to get this right, as I'm nearing a release of a program. I've looked at the database settings, and so far, have set the following: * Unchecked 'Enable design...
0
7194
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
7267
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
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.