473,778 Members | 1,852 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 4066
"akbar" <ak*******@gmai l.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
3958
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 but could get Ent. Never having done this before, I'm not sure what I need to do in order to be able to distribute it. I'd like not to require other users to have Access installed (let alone 2003). For starters, I'm just looking to be able...
1
1670
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 don't want to have to distribute the .dll, I was hoping to continue this as a stand alone .exe
0
2633
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 all the merge modules added to the project and it's working fine. The question is about distributing my .RPT files. 1) Initial Setup Project inclusion of .rpt files: My folder of new .RPT files keeps growing. Is there a way to point
51
3273
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 don't have an agenda, at least not right now. I do plan on writing a few programs. These will be tools I need for firmware testing. They will be relatively simple things like tools for breaking down data by its structure for easy viewing,...
4
1260
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 configuration is incorrect.
15
1976
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 provide my users a mini report writer where the report specs are stored as local data files. Can I do this in an MDE - e.g. have local data files for the report writer spec but no queries, forms or report changes? Thanks.
2
1330
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 place to put my code implementation in VC++ DotNet? P.S. The code is for a control where I am only going to distribute the DotNet DLL. Bruce
6
2533
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 Basic Express Edition but could not find one. I have even searched the help files and could not find anything useful for me. I want to simply package my application so that I may install it on another computer.
49
2764
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 changes for tables in datasheet view' * Unchecked 'Check for truncated number fields' (I would prefer the user NOT see #### in fields or columns that they shrink too far) * Unchecked 'Track Name AutoCorrect Info' * Set all Tables to 'SubDatasheet =...
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9465
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10296
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10068
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7474
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5370
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.