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 May 7th, 2004, 10:41 PM
danemcrae danemcrae is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 danemcrae User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
.Py to .exe (sorry i know this has been answered again and again)

Umm, hi? I'm like REALLY new to python (like 2 days) and i cant get my .py into .exe with py2exe. I have all the components needed to make it, i think.
Here's my setup.py:

Code:
from distutils.core import setup
import py2exe
setup(console=["myscript.py"])


thx if u can help,
Dane

Reply With Quote
  #2  
Old May 8th, 2004, 08:07 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,532 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 17 h 38 m 15 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
The only thing that comes to mind right now is that Py2exe can't find the program... so... you should check that your program is really called 'myscript.py', and that its in the same directory as 'setup.py'. If its not just to edit your setup file apropriatly nd give it another go

Hope this helps,

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


Reply With Quote
  #3  
Old May 8th, 2004, 10:29 AM
danemcrae danemcrae is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 danemcrae User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well, i got a code:

Code:
import sys
import re

#function getFileName()
def getFileName():
	global fileName
	fileName = raw_input("Enter file name (rel or abs path, eg., python/file.py): ")
	try:
		fp = open(fileName)
		fp.close()
	except IOError:
		print "File does not exist!"
		getFileName()

#call function
getFileName()


package = re.split(":",fileName)
package = re.split("/",package[len(package) - 1])
package = re.split(".py",package[len(package) - 1])
package = package[0]

def getSetupName():
	global setupName
	setupName = raw_input("Enter name of setup file (or <enter> for default): ")
	if(setupName == ''):
		setupName = "setup.py"
	try:
		fp = open(setupName)
		fp.close()
		flag = raw_input("Setup file exists! Rewrite (0=no; else <enter>)? ")
		if(flag == "1"):
			getSetupName()
	except IOError:
		setupName = setupName

getSetupName()

fp = open(setupName,"w")
temp = """from distutils.core import setup
import py2exe
setup(name = "%s",
     scripts = ["%s"],
)""" % (package,fileName)
fp.write(temp)
fp.close()

sys.argv.append("py2exe")
execfile(setupName)

fp = open(setupName,"w")
temp = ""
fp.write(temp)
fp.close()

print "\n", "Executable created!"
print "Press <enter> to exit..."
if(raw_input()):
	exit

its asks me what file and what setup and it works, (i think) but i cant find the .exe. it has all the files that should be there in dist but the exe is replaced by a blank "setup.py"

Reply With Quote
  #4  
Old May 8th, 2004, 10: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,532 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 17 h 38 m 15 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
Try looking in the Py2exe directory . I think thats the default localtion for the .exe files anyway.

Mark.

Reply With Quote
  #5  
Old May 8th, 2004, 10:53 AM
danemcrae danemcrae is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 danemcrae User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
c:\python23\lib\site-packages\py2exe doesnt have it either...

Reply With Quote
  #6  
Old May 8th, 2004, 10:55 AM
danemcrae danemcrae is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 danemcrae User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
in the dist folder, the .exe doesnt show up, but it just copies my setup.py and puts it in there! grrr

Reply With Quote
  #7  
Old May 9th, 2004, 10:05 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,532 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 17 h 38 m 15 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
Try doing a system wide search for your_python_programs_name.exe and see what comes up. If your on XP you should check out your user folder.

Mark.

Reply With Quote
  #8  
Old May 10th, 2004, 02:49 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
You should find there is a dist sub-directory in the directory where you ran the setup.py script. If py2exe ran without a problem that is where your .exe is.

Grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > .Py to .exe (sorry i know this has been answered again and again)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway