By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 2,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

Making a simple script standalone

P: n/a

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 ?
--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

Jan 16 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Rikishi 42 wrote:
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
Jan 16 '07 #2

P: n/a
Rikishi 42 wrote:
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
Jan 16 '07 #3

P: n/a
At Tuesday 16/1/2007 19:49, Rikishi 42 wrote:
>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

Jan 17 '07 #4

P: n/a
On Wednesday 17 January 2007 03:33, Gabriel Genellina wrote:
At Tuesday 16/1/2007 19:49, Rikishi 42 wrote:
>>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
Tried that, just after asking here.
A bit messy (poor docs) and a very bloated result.
Thanks for the answer, anyway.
--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

Jan 17 '07 #5

P: n/a
On Wednesday 17 January 2007 00:22, James Stroud wrote:
>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.
I will look into it, thanks!
Hope it's not as heavy as with py2exe...

--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

Jan 17 '07 #6

P: n/a
On Wednesday 17 January 2007 00:48, Larry Bates wrote:
>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.
Thanks, I will look into it.
Hope it's not as heavy as py2exe...
--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

Jan 17 '07 #7

P: n/a
Rikishi 42 wrote:
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
Jan 17 '07 #8

P: n/a
At Wednesday 17/1/2007 16:05, Rikishi 42 wrote:
>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

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/pyt...st/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

Jan 17 '07 #9

P: n/a
Gabriel Genellina wrote:
At Wednesday 17/1/2007 16:05, Rikishi 42 wrote:
>>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

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/pyt...st/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....f469a1b3dc3802
Jan 18 '07 #10

P: n/a
On Thursday 18 January 2007 10:13, robert wrote:
stay with py23 for "a script" (and more) and make <700kB
independent distros - UPX and 7zip involved:

http://groups.google.com/group/comp....f469a1b3dc3802
Thanks, that might be an option. But I might just convince the person to
let me install Python. :-(

--
Research is what I'm doing, when I don't know what I'm doing.
(von Braun)

Jan 18 '07 #11

P: n/a


On Jan 18, 2:19 pm, Rikishi 42 <fsck_s...@telenet.bewrote:
On Thursday 18 January 2007 10:13, robert wrote:
stay with py23 for "a script" (and more) and make <700kB
independent distros - UPX and 7zip involved:
http://groups.google.com/group/comp....b3dc3802Thanks, that might be an option. But I might just convince the person to
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.

Jan 19 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.