Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Python

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

Python Discussion forum for Python, a high-level language with simple syntax, but yet powerful.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-2007, 05:33 PM
annannienann annannienann is offline
Newbie
 
Join Date: Apr 2007
Posts: 11
Credits: 0
Rep Power: 0
annannienann is on a distinguished road
Default Making it Standalone from Source Code (Python)

I have written my source code and it works like a dream. It's tested, do***ented and optimized. However, I lack one piece of fundimental knowelgde. How do I turn my python source code into a stand alone application (for windows) that is simply an icon on the desktop that you click?

Thanks Peter.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-17-2007, 11:44 PM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

That is a sometimes complicated task to do. Pythonscripts always requires Python to be installed, so when you are making an executablefile, then the executable will contain all the necessarily Python to make it run. It makes the executable both slow and big.

When that's said, here's a link:
FrontPage - py2exe.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-18-2007, 02:20 PM
annannienann annannienann is offline
Newbie
 
Join Date: Apr 2007
Posts: 11
Credits: 0
Rep Power: 0
annannienann is on a distinguished road
Default

Quote:
Originally Posted by v0id View Post
That is a sometimes complicated task to do. Pythonscripts always requires Python to be installed, so when you are making an executablefile, then the executable will contain all the necessarily Python to make it run. It makes the executable both slow and big.

When that's said, here's a link:
FrontPage - py2exe.org
Thanks void, you really hit the nail on the head. I am currently pulling together all the techo know how to create my unit 6 course work for computering A2. You also led me to another website that allowed me to create installers easily so two birds with one stone there. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-01-2007, 12:00 PM
Victor Victor is offline
Learning Programmer
 
Join Date: May 2007
Posts: 96
Credits: 0
Rep Power: 6
Victor is on a distinguished road
Default

Py2exe is an excellent choice to convert .py to .exe. However, I would like to recommend Pyinstaller, it will make a single exe with everything needed to work. You won't have to distribute a whole directory, also, Pyinstaller's output is consistently smaller in size than Py2exe. They both have plenty of solid features and are fairly easy to figure out.

Also, if you're looking for an installer, I recommend NSIS with HM NIS Editor. I couldn't stand the language of NSIS but when I got HM NIS, it was much easier, smaller, more compact installers too.

Last edited by Victor; 08-01-2007 at 12:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-01-2007, 09:22 PM
Matt's Avatar   
Matt Matt is offline
Learning Programmer
 
Join Date: Jan 2007
Location: Northwestern US
Posts: 47
Credits: 0
Rep Power: 7
Matt is on a distinguished road
Default

Anyone know of any tools like these for making Linux executables?
__________________
http://www.mattnichols.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 10-01-2007, 09:24 PM
Matt's Avatar   
Matt Matt is offline
Learning Programmer
 
Join Date: Jan 2007
Location: Northwestern US
Posts: 47
Credits: 0
Rep Power: 7
Matt is on a distinguished road
Default

Anyone know of any tools like this for creating Linux executables?
__________________
http://www.mattnichols.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-01-2007, 11:50 PM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

I don't know a way to make a Python-script to a "real" executable file. But you could cheat, a little, and do this.
Put this in the top of your Python do***ent:
Code:
#!/usr/bin/env python
Then you can chmod'e it, to make it executable:
Code:
chmod +x your_file.py
I've heard the new official Python-package comes with a new program, exemaker. I don't know if it's able for Linux, but in Windows it should be able to generate executable-files pretty easy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-02-2007, 07:07 PM
Victor Victor is offline
Learning Programmer
 
Join Date: May 2007
Posts: 96
Credits: 0
Rep Power: 6
Victor is on a distinguished road
Default

I read that most Linux OSs have Python built-in. However, I did find a post on a different forum that suggested something called 'python-eggs'. I don't use Linux (yet) but maybe this can help you out.

A py2exe like tool for Linux - Python
Python Eggs

Also, v0id, do you know if the size of the .exe's has improved over Py2exe or Pyinstaller?
__________________
Pegasus Homepage

Last edited by Victor; 10-02-2007 at 07:10 PM. Reason: ask v0id a ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 10-02-2007, 11:45 PM
v0id's Avatar   
v0id v0id is offline
Super Moderator
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,578
Last Blog:
CherryPy(thon)
Credits: 55
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

No, I don't know. I don't really know anything about neither of them, because I haven't really worked with them. If you're thinking about making the executable smaller, then it's possible with other alternatives.

GCC have a small program called "strip," which removes all unnecessary information from an executable file. Start out by converting the Python script to an executable file, and then do this:
Code:
strip your_executable_file.exe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Calculator AfTriX VB Tutorials 3 02-29-2008 08:53 AM
Making Code Faster falco85 C and C++ 10 04-04-2007 03:28 PM
Python Collection reachpradeep Python 1 03-03-2007 02:50 PM
Valve: Half-Life 2 Source Code falco85 General Programming 3 10-28-2006 05:03 PM


All times are GMT -5. The time now is 02:11 AM.

Contest Stats

Xav ........ 1322.18
MeTh0Dz|Reb0rn ........ 1053.7
morefood2001 ........ 879.43
John ........ 877.37
marwex89 ........ 869.98
WingedPanther ........ 830.24
Brandon W ........ 735.07
chili5 ........ 309.39
Steve.L ........ 239.84
dcs ........ 216.02

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads