944,153 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 4929
  • Python RSS
Nov 14th, 2006
0

wxpython and py2exe

Expand Post »
Hi

i am making a simle gui using wxpython and here is the script

Python Syntax (Toggle Plain Text)
  1. import wx
  2.  
  3. class bide(wx.Frame):
  4. def __init__(self):
  5. wx.Frame.__init__(self, None, -1, "just a test", pos=(0, 0), size=wx.DisplaySize())
  6. panel = wx.Panel(self, -1)
  7. statusBar = self.CreateStatusBar()
  8. toolbar = self.CreateToolBar()
  9. #toolbar.AddSimpleTool(wx.NewId(), images.getNewBitmap(),"New", "Long help for 'New'")
  10. toolbar.Realize()
  11. menuBar = wx.MenuBar()
  12. menu1 = wx.Menu()
  13. menu1.Append(1, "&New Project","")
  14. menu1.Append(2, "&Open Project", "")
  15. menu1.Append(3, "Exit", "")
  16. menuBar.Append(menu1, "&File")
  17. menu2 = wx.Menu()
  18. menu2.Append(11, "&Copy", "Copy in status bar")
  19. menu2.Append(22, "C&ut", "")
  20. menu2.Append(33, "Paste", "")
  21. menu2.AppendSeparator()
  22. menu2.Append(wx.NewId(), "&Options...", "Display Options")
  23. menuBar.Append(menu2, "&Edit")
  24. self.SetMenuBar(menuBar)
  25. self.Bind(wx.EVT_MENU,self.onQuit,id=3)
  26.  
  27. def onQuit(self,event):
  28. self.Close()
  29.  
  30. if __name__== '__main__':
  31. app=wx.PySimpleApp()
  32. frame=bide()
  33. frame.Show(True)
  34. app.MainLoop()

i am converting this to an exe using this code

Python Syntax (Toggle Plain Text)
  1. from distutils.core import setup
  2. import py2exe
  3. setup(console=['bide.py'])

Now when i am running it from the generated exe... the console window also pops up. i want the console window to be running in the background. any suggestions?

thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sliver_752 is offline Offline
7 posts
since Nov 2006
Nov 14th, 2006
0

Re: wxpython and py2exe

My advice, use the little utility at:
http://www.daniweb.com/code/snippet499.html

Since this is GUI program you need to change 'console' to 'window' and give your filename .pyw extension.
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005
Nov 15th, 2006
0

Re: wxpython and py2exe

cool... it works!
thanks again.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sliver_752 is offline Offline
7 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Python Byte Code
Next Thread in Python Forum Timeline: Tkinter Application with PyGame Sound





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC