473,322 Members | 1,421 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,322 software developers and data experts.

compiling python program

Al
I'd like to "hide" my code from being viewed (linux). Is there anyway for me
to compile my program into .pyc and only have the .pyc files available, or
do I always have to have the .py file?

thanks in advance!!
Al (newbie!!)

Jul 18 '05 #1
3 5479
Al wrote:
I'd like to "hide" my code from being viewed (linux). Is there anyway
for me
to compile my program into .pyc and only have the .pyc files
available, or
do I always have to have the .py file?


You can just provide the .pyc file to clients. But it will only be
runnable by the same version of Python you used to compile it.

--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ Moral indignation is jealousy with a halo.
\__/ H.G. Wells
Jul 18 '05 #2
In a python-src distribution look for a tool called Freeze.py
you can download it from sourceforge too..
You can also pack it with an utility you can find at :

http://sebsauvage.net/python/
called pypack.py
which encrypts the content of your py file but lets it yet runnable(Woa!!!)
this is disencryptable ... but , to a non-python person its somewhat hard to.

Camilo Olarte

Jul 18 '05 #3
Erik Max Francis <ma*@alcyone.com>
wrote on Tue, 23 Sep 2003 01:33:07 -0700:
Al wrote:
I'd like to "hide" my code from being viewed (linux). Is there anyway
for me
to compile my program into .pyc and only have the .pyc files
available, or
do I always have to have the .py file?

You can just provide the .pyc file to clients. But it will only be
runnable by the same version of Python you used to compile it.


I did that with the pre-open-source version of Umbra, and it worked
fine until Python got a new version; even then, it was just a matter of
recompiling it for 2.2 and replacing the zip, on the premise that anyone
who was going to run it would have the latest Python.

If you have to, you can bundle Python with your program, and even use
py2exe to make a Windoze distribution. MacOS X and Linux normally have
Python installed, so they don't need as much handholding as Windoze
users.

--
<a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"I believe in communication. If I communicate with you every so often, you'll
be bothered by what I say enough that you won't ask me to, which means more
sleep for me." -Something Positive, 2003Sep22
Jul 18 '05 #4

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

Similar topics

5
by: Mike S. | last post by:
Hello, Has anyone had success compiling the informixdb-1.3 module under python 2.2? It seems the absense of makefile.pre.in in python 2.2 causes the break under py2.2. Is there an easy way...
0
by: Johnathan Doe | last post by:
I've been thinking about what the issues would be in compiling Python into native machine code, and since type information is important in Python, it seems possible that Python code can be...
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....
6
by: Fuzzyman | last post by:
I'll post this to the image-sig as well, but the audience is a bit wider here. I've just upgraded to Python 2.4. I've installed the free microsoft optimising compiler and hacked distutils to use...
2
by: giovannifreda | last post by:
I am new to python and I am wondering if there is a way to take a python script and turn it into an object of some kind such that the python system doesn't have to take the script and compile it down...
11
by: ZMY | last post by:
Dear all, I am a real newbie for both python and QNX, but I am still trying to compile Numeric-24.2 under QNX4.25 with python 2.2. I got following error message: $ sudo python setup.py...
3
by: Mathias Waack | last post by:
After switching my development environment to 64 bit I've got a problem with a python extension for a 32 bit application. Compiling the app under Linux results in the following error: g++ -m32...
6
by: grbgooglefan | last post by:
I am compiling CPP program which uses CPython API functions from Python 2.5.1 source code First I compiled with this commanline, that time I got "pyconfig.h" not found. g++ -Os -I../../Include...
9
by: Randy.Galbraith | last post by:
I'm investigating the possible use of Mecurial SCM as a replacement for CVS. Mecurial is written in Python. I have a background in GNU/ Linux, Solaris, sparc and Perl. However AIX, powerpc and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.