Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 June 8th, 2004, 03:58 PM
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: 1 h 6 m
Reputation Power: 10
how 2 py2exe

Dear all

can someone show me how to use py2exe for the following code? complicated.

here is the code
Code:

import random
a=int(raw_input("Enter set(s)of random numbers (6 numbers a set): "))
for x in range (0,a):
    for i in range(1,7):
        print "\n%5d" % (random.randrange(1,50)),
        if i%6==0:
            print



Thanks

Reply With Quote
  #2  
Old June 9th, 2004, 01:12 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: 12
Send a message via MSN to Grim Archon
Have you tried a search of this forum?
http://forums.devshed.com/t137769/s...ighlight=py2exe
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #3  
Old June 9th, 2004, 05:57 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: 1 h 6 m
Reputation Power: 10
Yes looked at the site , tried it runs with out any error but can't find the exe file

Reply With Quote
  #4  
Old June 9th, 2004, 06:03 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,537 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 17 m 47 sec
Reputation Power: 68
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 quick way to do this is to search your Python installation directory and documents folder.

Its not easy to keep up with py2exe right now since i've used 3 versions over the last few years and in each one the rules have changed .

There should be an option to tell py2exe where to put the file though - or there was at some point. You should be able to type 'help' after invoking py2exe for a full list of options.

Hope this helps,

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


Reply With Quote
  #5  
Old June 9th, 2004, 06:16 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: 12
Send a message via MSN to Grim Archon
Assuming you are actually running the latest python version and have installed the latest py2exe program...

Make sure the setup script is in the same directory as the script you want to make an executable. It will then make a dist sub-directory when it is run. The executable should be in that sub-directory.

If you are having problems direct the script to a log file and post the log file here.

python win_exe.py > logfile.txt

Send the logfile and we might be able to help

Reply With Quote
  #6  
Old June 9th, 2004, 06:56 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: 1 h 6 m
Reputation Power: 10
This is what i did
I keep all my .py in a folder under d:\pyth2, running python from c:\python23
This is how i compiled
c:\python23\python.exe d:\pyth2\lot.py
It created a folder called dist and build in d:\pyth2 and copied _sre.pyd,library.zip,python23.dll,w9xpopen.exe

setup.py
Code:

from distutils.core import setup
import py2exe
setup(name="lot",version="1.0",py_modules=["lot"])


Code:
import random
a=int(raw_input("Enter set(s)of random numbers (6 numbers a set): "))
for x in range (0,a):
    for i in range(1,7):
        print "\n%5d" % (random.randrange(1,50)),
        if i%6==0:
            print


I don't know if it's right

Thanks

Reply With Quote
  #7  
Old June 9th, 2004, 07:37 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: 12
Send a message via MSN to Grim Archon
This works:

I've modified your setup script in two ways:
1. I've added the py2exe parameter so that you don't have to type it.
2. I changed your setup to be in line with my script and the guidelines on the py2exe Wiki.

Code:
from distutils.core import setup
import sys
sys.argv.append("py2exe")
import py2exe
setup(console = [{"script": "lot.py", }], version = "1.0", py_modules = ["lot"])


Grim

Reply With Quote
  #8  
Old June 9th, 2004, 08:44 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: 1 h 6 m
Reputation Power: 10
Hi Grims
It works Thank you so much

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > how 2 py2exe

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap