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

Making a simple script standalone


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
11 1738
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
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
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
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
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
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
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
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
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
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


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gregory | last post by:
Hello, I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the...
2
by: john | last post by:
Newbie about this stuff. I want to run some php scripts from a shell script(bash?) the php script i want to run is this: test.php and it's path is this:...
2
by: Sandeep Gupta | last post by:
Hi, I've written a commercial application that uses Python scripts for some of the functionality. Installing the Python portion of the application requires me to first install Python, and then...
1
by: philregion | last post by:
Let's say I've got the following little script called test1.py: print "Content-type: text/html\n\n" print "<html><body>" print "<h1>Hello World</h1>" print "</body></html>" I want to run a...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
6
by: Oscar N. Goyee | last post by:
Well, its sames difficult for me; I love access so much and wish to make it perform extra task. I prepared an HTML form but can not connect it to my access table and so I think it is possible to...
11
by: Hari Sekhon | last post by:
I have written a script and I would like to ensure that the script is never run more than once at any given time. What is the best way of testing and exiting if there is another version of this...
0
by: Chris | last post by:
Hello, For awhile now I've wanted to organize the vb scripts I've created over the years. Just haven't taken the time to make a Script Center type help file or DB. Just recently started messing...
1
by: HACKhalo2 | last post by:
Hi. I'm helping a friend of mine develop an online game, which is currently outdated. The person making skins for the site came up with a cool looking NavBar (found at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.