Making a simple script standalone

R

Rikishi 42

Hi,
I'm new to this group. I've tried finding my answer in existing messages,
but no such luck.

What I want to do is to compile/bundle/prepare/whatever_term a simple
Python script for deployment on a Windows machine. Installing Python
itself on that machine, is not an option. Ideally I would like to obtain
a single executable file, but a script+runtime is acceptable.

There is nothing graphical, nothing fancy about the script.
The only imports are: os, stat, string and time.


Any suggestions on an - easy and clear - path to follow ?
 
J

James Stroud

Rikishi said:
Hi,
I'm new to this group. I've tried finding my answer in existing messages,
but no such luck.

What I want to do is to compile/bundle/prepare/whatever_term a simple
Python script for deployment on a Windows machine. Installing Python
itself on that machine, is not an option. Ideally I would like to obtain
a single executable file, but a script+runtime is acceptable.

There is nothing graphical, nothing fancy about the script.
The only imports are: os, stat, string and time.


Any suggestions on an - easy and clear - path to follow ?


pyinstaller + innosetup.

James
 
L

Larry Bates

Rikishi said:
Hi,
I'm new to this group. I've tried finding my answer in existing messages,
but no such luck.

What I want to do is to compile/bundle/prepare/whatever_term a simple
Python script for deployment on a Windows machine. Installing Python
itself on that machine, is not an option. Ideally I would like to obtain
a single executable file, but a script+runtime is acceptable.

There is nothing graphical, nothing fancy about the script.
The only imports are: os, stat, string and time.


Any suggestions on an - easy and clear - path to follow ?

I use py2exe and inno installer. Works great.

-Larry
 
G

Gabriel Genellina

What I want to do is to compile/bundle/prepare/whatever_term a simple
Python script for deployment on a Windows machine. Installing Python
itself on that machine, is not an option. Ideally I would like to obtain
a single executable file, but a script+runtime is acceptable.

distutils + py2exe


--
Gabriel Genellina
Softlab SRL






__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
 
R

robert

Rikishi said:
Hi,
I'm new to this group. I've tried finding my answer in existing messages,
but no such luck.

What I want to do is to compile/bundle/prepare/whatever_term a simple
Python script for deployment on a Windows machine. Installing Python
itself on that machine, is not an option. Ideally I would like to obtain
a single executable file, but a script+runtime is acceptable.

There is nothing graphical, nothing fancy about the script.
The only imports are: os, stat, string and time.


Any suggestions on an - easy and clear - path to follow ?

cx_Freeze was not mentioned so far. its perhaps most easy and clear.


Robert
 
G

Gabriel Genellina

Tried that, just after asking here.
A bit messy (poor docs) and a very bloated result.

Consider that, at a bare minimum, you need to include python25.dll
wich is rather large, and transitive module imports can lead to a
large library.zip too.
Different "bundlers" may be more or less convenient, have more or
less documentation, easier or harder to use, but they all make
comparable file sizes; no one is so dumb to include all the scripts
reachable along the PYTHONPATH, and on the other hand, if it included
too few files your script might fail when it can't import a needed module.
See
http://mail.python.org/pipermail/python-list/2005-August/336851.html
for a related issue.
If you're going to try different alternatives, posting your findings
at the end would be a good thing.


--
Gabriel Genellina
Softlab SRL






__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
 
R

robert

Gabriel said:
Consider that, at a bare minimum, you need to include python25.dll wich
is rather large, and transitive module imports can lead to a large
library.zip too.
Different "bundlers" may be more or less convenient, have more or less
documentation, easier or harder to use, but they all make comparable
file sizes; no one is so dumb to include all the scripts reachable along
the PYTHONPATH, and on the other hand, if it included too few files your
script might fail when it can't import a needed module.
See http://mail.python.org/pipermail/python-list/2005-August/336851.html
for a related issue.
If you're going to try different alternatives, posting your findings at
the end would be a good thing.

stay with py23 for "a script" (and more) and make <700kB
independent distros - UPX and 7zip involved:

http://groups.google.com/group/comp.lang.python/msg/edf469a1b3dc3802
 
R

Ravi Teja

let me install Python. :-(

Like you note, it is far simpler to just install Python. Rarely does a
proper cost benefit analysis show any advantage for all the time you
put in for saving a few MB off the installer (since you noted that you
got it working with Py2Exe), especially when you seem to be installing
the app for just one person. How big is your Exe with Py2Exe? Say 3MB?
Is making it 1 MB worth maybe 2 hrs of your time for 1 install?

But just for kicks, check out ShedSkin. Since you mentioned that you
were using very few modules (ShedSkin supports os, stat, string, time),
it might just work. ShedSkin translates your Python code to fast C++
code that can be compiled to a tight app.

http://sourceforge.net/projects/shedskin/

Ravi Teja.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top