Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links


How to turn a .py script into an .exe file?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-01-2010
Beter 2 Burn Out's Avatar
Member
 
Join Date: Aug 2006
Posts: 221
How to turn a .py script into an .exe file?

Sponsored Links
Hi Guys,
I am trying to convert a .py script into an .exe file but not succeeding. Does anyone know how to convert a .py script into an .exe file.? Also please tell me some basic programs since I am new to the python scripts. Please help me soon by providing some useful information..!!

__________________
AMD Sempron 2800+ @ 2Ghz
Asus A7V8X-LA
120Gb Seagate barracuda 7200Rpm Ultra-ATA 100
Elixir 512mb DDR Pc3200 (Soon 1Gb)
Club 3D Radeon 9600 256Mb
Lite-On Cd & Dvd writer combo
IDE-Dvd drive
400w Psu
Windows Xp Pro Sp2
Advent Wireless Mouse & Keyboard.
Reply With Quote
  #2  
Old 25-01-2010
Member
 
Join Date: Nov 2008
Posts: 996
Re: How to turn a .py script into an .exe file?

You can use the py2exe application for converting the python scripts into standalone windows programs. The main advantage of this application is that py2exe is a Python extension which converts python scripts into executable windows programs, able to run without requiring a python installation. So even if you are not having the python installation, then also you can make the python scripts into executable files. py2exe is distributed under an open-source license. Hope that you can use the py2exe application and then your problem is solved.!!
Reply With Quote
  #3  
Old 25-01-2010
Warner's Avatar
Member
 
Join Date: Mar 2008
Posts: 349
Re: How to turn a .py script into an .exe file?

For converting a .py script into an .exe file you will have to install py2exe. After installing it make sure that your python program is running from command prompt. For checking that from the command prompt type the following command in the command prompt :
Code:
C:\Documents and Settings\atik>python sample.py
Otherwise you will have to create setup script and you can do that typing the following code into your editor :
Code:
from distutils.core import setup
import py2exe
setup(console=[‘sample.py’])
Then run the python program as mentioned in above coding.
Reply With Quote
  #4  
Old 25-01-2010
Allan.d's Avatar
Member
 
Join Date: Mar 2008
Posts: 672
Re: How to turn a .py script into an .exe file?

According to me, the vast majority of things you can do with Python will work with py2exe. It's important that you make sure everything is working before you use py2exe. Here is the basic example of "Hello World" :
Code:
print "Hello World!"
For making it sure that it is working properly, you can check by the following command :
Code:
C:\Tutorial>python hello.py
Hello World!

C:\Tutorial>
Reply With Quote
  #5  
Old 25-01-2010
MELTRONICS's Avatar
Member
 
Join Date: Aug 2006
Posts: 235
Re: How to turn a .py script into an .exe file?

Python is a simple and powerful language for scripting and even application development. The following code prints a header and numbers 1 to 10 to console output :
Code:
print "Python script to exe test program"

count = 0

while count < 10:
    print "count = " + str(count) +"\n"
    count = count + 1
Save this code in to trial.py file. Make sure that the code works fine by running it using python. To do this, on command prompt type "python trial.py".
__________________
3.2 (northwood)
2gig ram
ATI AIW X800xt 256mb
Gigabyte GA-8knxp 875p Chipset
Optiwrite 8X DVD Burner
Win XP PRO Sp2 (Works Perfectly)
2 SATA Raptor 74gig Raid 0
2 7200 IDE 320gig HD
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to turn a .py script into an .exe file?"
Thread Thread Starter Forum Replies Last Post
New data to the first line in *.csv file via VB Script Conus Software Development 2 12-06-2012 11:04 AM
batch script to find a file stevenwhite Software Development 1 10-04-2012 12:55 PM
Dumping logon name and logon script values to a text file - blank logon script field Phil McNeill Windows Server Help 3 17-08-2010 09:06 PM
Bat file for logon script adam2010 Windows Software 1 10-05-2010 11:42 AM
Script insert date in the name of my file Viensterrr Software Development 4 31-10-2008 07:18 PM


All times are GMT +5.5. The time now is 02:39 PM.