Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 2nd, 2004, 06:21 AM
newjohn newjohn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: neer Newcastle, England
Posts: 12 newjohn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Stand alone programs

I am new to python and i was wondering how to make a program run without having to install python please help!

Reply With Quote
  #2  
Old July 2nd, 2004, 07:05 AM
luckyboy luckyboy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 57 luckyboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 58 sec
Reputation Power: 5
Look at how 2 py2exe
Contributed by grim and mark

Reply With Quote
  #3  
Old July 2nd, 2004, 07:39 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Heres the link to Py2exe's home page, you should be able to find everything you need there although we are assuming that you are in Windows, and have Python installed; Py2exe requires Python!

http://starship.python.net/crew/theller/py2exe/

If you have any problems with this then run a quick search on the forum... Py2exe has been discussed many, many, many, many times .

If you're on a *nix OS then you should look here:

http://starship.python.net/crew/atuining/cx_Freeze/

Have a good day all,

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #4  
Old July 2nd, 2004, 09:50 AM
newjohn newjohn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: neer Newcastle, England
Posts: 12 newjohn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Thanks

thankyou ! I couldent figure it out

Reply With Quote
  #5  
Old July 2nd, 2004, 12:25 PM
sfb sfb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 447 sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 1 h 43 m 45 sec
Reputation Power: 10
They're conning you.

You can't make it run without installing Python - all py2exe does is install Python within the EXE.

Reply With Quote
  #6  
Old July 2nd, 2004, 01:51 PM
newjohn newjohn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: neer Newcastle, England
Posts: 12 newjohn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Are you sure sfb? will this make the program size bigger?

Reply With Quote
  #7  
Old July 2nd, 2004, 03:23 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Quote:
Originally Posted by netytan
we are assuming that you are in Windows, and have Python installed; Py2exe requires Python!


sfb, conning, me? really? I stated very clearly that py2exe requires Python to be installed, which makes sence since py2exe is a Python program itself.

However once you have compiled a Python program using py2exe you can run this without having to install Python! But you are right though in a way, py2exe works by wrapping the Python interpreter inside the exe file - this is not installing...

http://www.dictionary.com/

For all intents and perposes, this is a stand alone exe like any other!

Hope this clears things up,

Mark.

Last edited by netytan : July 2nd, 2004 at 03:25 PM.

Reply With Quote
  #8  
Old July 2nd, 2004, 06:01 PM
Noah_C Noah_C is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 34 Noah_C User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 31 sec
Reputation Power: 5
How much bigger does it make the program ?

Reply With Quote
  #9  
Old July 3rd, 2004, 03:33 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Considerably bigger than the equivalent C/C++ program, but then thats to be expected. I don't really have a means to test this right now but if im remembering correctly then this adds aprox 1MB to the exe's size. As aposed to perl2exe which adds a good 4MB to the size of it's exe's.

But the gains outway cost in most cases! Which is why more and more people are using it. Though this seems irrelevant really (more so on *nix since Python is usually included) because Python should really be installed if you want to run Python programs. And if anyones interested i can give reasons but this is.. just my opinion ,

Have a good day,

Mark.

Last edited by netytan : July 3rd, 2004 at 03:35 AM.

Reply With Quote
  #10  
Old July 5th, 2004, 03:25 AM
sfb sfb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 447 sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 1 h 43 m 45 sec
Reputation Power: 10
Quote:
Originally Posted by netytan
sfb, conning, me? really?


Not really conning; I was being silly:

"I'd like a car without a CD Player, please"
"Sure, we'll, er, put the CD player in the boot then, OK?"
"Great!"
etc.


Reply With Quote
  #11  
Old July 5th, 2004, 07:00 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Haha, ok ok, your a little crazy . But still, not a problem. Have fun .

Reply With Quote
  #12  
Old July 5th, 2004, 09:21 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,254 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 8 h 9 m
Reputation Power: 265
It is worth pointing out that what has been said here for Python is just as true for other languages such as Java. There are Java equivalents to py2exe that will bundle the bytecode files with the entire Java runtime to create an installable program, and in my experience the size of a Python program created with py2exe is likely to be far less than the Java equivalent. Visual Basic used to do the same thing, and while I believe that it now compiles to native code, it still needs to bundle the runtime DLLs with it. Even if you create a Windows program in C++ you may still need to install all the runtime DLLs that it uses (depending on the compilation options and what libraries you use). The days when a program consisted of a single executable are long gone, at least on Windows systems.

Dave - The Developers' Coach

Reply With Quote
  #13  
Old July 5th, 2004, 10:47 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,254 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 8 h 9 m
Reputation Power: 265
Quote:
Originally Posted by Noah_C
How much bigger does it make the program ?


I just tried py2exe on a minimal program of print "hello world" and the total size is 1.21Mb. This sounds a lot, but I have seen C++ compilers that generate executables of a similar size for the same thing. The actual exe was only 20 Kb, and the bulk of the size was taken up with the python23.dll file at 952 Kb.

I then used the freeware InnoSetup program (http://www.innosetup.com) to compress everything into a self-installing exe, which was 683 Kb. If you are worried about bandwidth, this is all that the user would have to download. I believe this compares favourably with most other languages.

To give you an idea of how big real-world programs would be, I have used the combination of py2exe and InnoSetup on a fairly complex Python program using the wxPython GUI library and several other third-party libraries, and the final installer was still under 3Mb. The uncompressed files were around 11 Mb, including 5Mb for the wxPython DLLs.

Dave - The Developers' Coach

Reply With Quote
  #14  
Old July 10th, 2004, 05:07 PM
newjohn newjohn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: neer Newcastle, England
Posts: 12 newjohn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Thancks

Thankyou

it is a shame it increses the program size

again, thankyou

Reply With Quote
  #15  
Old October 16th, 2004, 03:24 PM
amoo3 amoo3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 363 amoo3 User rank is Private First Class (20 - 50 Reputation Level)amoo3 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 2 h 37 m 38 sec
Reputation Power: 5
Unhappy help

Quote:
Originally P