Hey guys
I have just created a gui version of a script with wxpython and it seems to work properly when I run it from a shell.
(All my script does is create a set of folders with a bunch of subfolders)
I then used py2app to try build a standalone/distributable version of it. Once built the app runs and when I hit the "go" button it seems to work.
But it does not create any of the folders.
That is probably a poor explanation of what is going on - hopefully it makes some sense.
Any ideas?
Cheers!
Here is my script that I build with py2app: -
-
#!/usr/bin/python
-
-
# newjob.py
-
# version 1.0 June 24
-
-
import wx
-
import os
-
import sys
-
-
class MyFrame(wx.Frame):
-
def __init__(self, parent, id, title):
-
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(400, 200))
-
-
panel = wx.Panel(self, -1)
-
-
self.bitmap = wx.Bitmap('/Volumes/HD2/adam/job_structure/gui/newjob/finito.jpg')
-
wx.EVT_PAINT(self, self.OnPaint)
-
-
-
wxID_ENTERJOBNAME = wx.NewId()
-
wxID_JOBNAME = wx.NewId()
-
wxID_ENTERSHOTNAME = wx.NewId()
-
wxID_shotAmount = wx.NewId()
-
wxID_QUITBUTTON = wx.NewId()
-
wxID_GOBUTTON = wx.NewId()
-
-
-
self.Approot = os.path.dirname(sys.argv[0])
-
-
-
self.EnterJobname = wx.StaticText(panel, wxID_ENTERJOBNAME, 'Enter a job name:', (10, 20), style=wx.ALIGN_LEFT)
-
self.JobName = wx.TextCtrl(panel, wxID_JOBNAME, '', (25,50), (200, -1))
-
-
self.EntershotAmount = wx.StaticText(panel, wxID_ENTERSHOTNAME, 'Enter number of shots:', (10, 80), style=wx.ALIGN_LEFT)
-
self.NumberOfShots = wx.TextCtrl(panel, wxID_shotAmount, '', (25,110), (85, -1))
-
-
self.QuitButton = wx.Button(panel, wxID_QUITBUTTON, "Quit", (10,145))
-
self.QuitButton.Bind(wx.EVT_BUTTON, self.OnClose, id=wxID_QUITBUTTON)
-
-
self.GoButton = wx.Button(panel, wxID_GOBUTTON, "GO!!!", (200,145))
-
self.GoButton.Bind(wx.EVT_BUTTON, self.OnCreateJob, id=wxID_GOBUTTON)
-
-
-
def OnPaint(self, event):
-
dc = wx.PaintDC(self)
-
dc.DrawBitmap(self.bitmap, 240, 20)
-
-
-
def OnClose(self, event):
-
self.Close(True)
-
-
-
def OnCreateJob(self, event):
-
-
jobFolderName = self.JobName.GetValue()
-
shotAmount = int( self.NumberOfShots.GetValue())
-
-
jobroot = self.Approot
-
-
def GLOBALSDIR():
-
-
os.mkdir( "global")
-
-
os.mkdir( "global/2d")
-
os.mkdir( "global/2d/ae")
-
os.mkdir( "global/2d/ae/render")
-
os.mkdir( "global/2d/ae/script")
-
os.mkdir( "global/2d/ai")
-
os.mkdir( "global/2d/ai/project")
-
os.mkdir( "global/2d/ai/export")
-
os.mkdir( "global/2d/motion")
-
os.mkdir( "global/2d/motion/scripts")
-
os.mkdir( "global/2d/motion/render")
-
os.mkdir( "global/2d/psd")
-
os.mkdir( "global/2d/psd/project")
-
os.mkdir( "global/2d/psd/export")
-
os.mkdir( "global/2d/shk")
-
os.mkdir( "global/2d/shk/script")
-
os.mkdir( "global/2d/shk/render")
-
os.mkdir( "global/2d/output")
-
-
os.mkdir( "global/3d")
-
os.mkdir( "global/3d/boujou")
-
os.mkdir( "global/3d/maya")
-
os.mkdir( "global/3d/max")
-
os.mkdir( "global/3d/syntheyes")
-
os.mkdir( "global/3d/output")
-
-
os.mkdir( "global/color")
-
-
os.mkdir( "global/output")
-
os.mkdir( "global/output/dvd")
-
os.mkdir( "global/output/dvd/projects")
-
os.mkdir( "global/output/dvd/builds")
-
os.mkdir( "global/output/quicktime")
-
-
os.mkdir( "global/edit")
-
os.mkdir( "global/edit/audio")
-
os.mkdir( "global/edit/fcp")
-
os.mkdir( "global/edit/fcp/projects")
-
os.mkdir( "global/edit/graphics")
-
os.mkdir( "global/edit/edl")
-
os.mkdir( "global/edit/xml")
-
-
os.mkdir( "global/plates")
-
os.mkdir( "global/ref")
-
-
-
def SUBFOLDERS():
-
-
os.mkdir( "2d")
-
os.mkdir( "2d/ae")
-
os.mkdir( "2d/ae/render")
-
os.mkdir( "2d/ae/script")
-
os.mkdir( "2d/ai")
-
os.mkdir( "2d/ai/project")
-
os.mkdir( "2d/ai/export")
-
os.mkdir( "2d/motion")
-
os.mkdir( "2d/motion/scripts")
-
os.mkdir( "2d/motion/render")
-
os.mkdir( "2d/psd")
-
os.mkdir( "2d/psd/project")
-
os.mkdir( "2d/psd/export")
-
os.mkdir( "2d/shk")
-
os.mkdir( "2d/shk/render")
-
os.mkdir( "2d/shk/script")
-
os.mkdir( "2d/output")
-
-
os.mkdir( "3d")
-
os.mkdir( "3d/boujou")
-
os.mkdir( "3d/maya")
-
os.mkdir( "3d/max")
-
os.mkdir( "3d/syntheyes")
-
os.mkdir( "3d/output")
-
-
os.mkdir( "plates")
-
-
os.chdir( "../")
-
-
-
#CREATE JOB DIRECTORY
-
os.mkdir( jobFolderName)
-
-
#CREATE OFFLINE & CHANGE INTO OFFLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES & GLOBALS
-
os.mkdir( jobFolderName + "/offline")
-
os.chdir( jobFolderName + "/offline")
-
GLOBALSDIR()
-
-
#CREATE SHOT DIRECTORY AND AND SUB-DIRECTORIES
-
-
for i in range(1, shotAmount + 1):
-
shotname = '%03d' % (i)
-
os.mkdir( shotname)
-
os.chdir( shotname)
-
SUBFOLDERS()
-
-
#GO BACK ONE DIRECTORY INTO THE JOB FOLDER
-
-
os.chdir( "../")
-
-
#CREATE ONLINE & CHANGE INTO ONLINE DIRECTORY TO CREATE GLOBAL DIRECTORY
-
-
os.mkdir( "online")
-
os.chdir( "online")
-
-
GLOBALSDIR()
-
-
#CREATE SHOT DIRECTORY AND AND SUB-DIRECTORIES
-
-
for i in range(1, shotAmount + 1):
-
shotname = '%03d' % (i)
-
os.mkdir( shotname)
-
os.chdir( shotname)
-
SUBFOLDERS()
-
-
dlg = wx.MessageDialog(self, 'Sweet! ', 'The job directory "' + jobFolderName + '" has been created', wx.OK|wx.ICON_INFORMATION)
-
dlg.ShowModal()
-
dlg.Destroy()
-
-
self.Close(True)
-
-
-
class MyApp(wx.App):
-
def OnInit(self):
-
frame = MyFrame(None, -1, 'Finito Films - Create New Job')
-
frame.Show(True)
-
frame.Centre()
-
return True
-
-
app = MyApp(0)
-
app.MainLoop()
-
-
5 3445 bartonc 6,596
Recognized Expert Expert
Of course, The wxPython part looks fine.
Someone with Mac experience would be interested in the setup script contents.
I went to the py2app site; it's even more cryptic than the py2exe info that I've been able to gather. I'll include the link anyway: py2applet .
I don't know if a py2exe script example will be much help (finding out if p2e uses setuptools would answer some of that). There are p2e examples in the Articles section of this group.
Sorry to not be of more help.
:) Thanks for looking!
I haven't had any luck resolving the problem yet.
Can you recommend any other ways to create standalone python apps?
Thanks a lot!
Of course, The wxPython part looks fine.
Someone with Mac experience would be interested in the setup script contents.
I went to the py2app site; it's even more cryptic than the py2exe info that I've been able to gather. I'll include the link anyway: py2applet .
I don't know if a py2exe script example will be much help (finding out if p2e uses setuptools would answer some of that). There are p2e examples in the Articles section of this group.
Sorry to not be of more help.
bartonc 6,596
Recognized Expert Expert
:) Thanks for looking!
I haven't had any luck resolving the problem yet.
Can you recommend any other ways to create standalone python apps?
Thanks a lot!
This is old, but looks interesting. It seems that you may have an example setup script in the distro somewhere.
bartonc 6,596
Recognized Expert Expert This is old, but looks interesting. It seems that you may have an example setup script in the distro somewhere.
Here is a current link.
thanks, that's what I had been working from to get py2app going - but I can't find anything in there to answer why my app doesn't "do its thing"
Thanks for looking around!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Austin |
last post by:
"""
Minimal setup.py example, run with:
% python setup.py py2app
"""
from distutils.core import setup
import py2app
setup(
app = ,
)
|
by: timothy.williams |
last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2
machine.
I have python in a non-standard place, but I'm using --prefix with the
configure script to point to where I have...
|
by: Bob Swerdlow |
last post by:
I'm trying to move my application from bundlebuilder to py2app. I upgraded
to PyObjC 1.2, which include py2app 1.7, but I got the following error. I
saw a note on the py2app site that earlier...
|
by: Richard Taylor |
last post by:
User-Agent: OSXnews 2.07
Xref: number1.nntp.dca.giganews.com comp.lang.python:437315
Hi
I am trying to use py2app (http://undefined.org/python/) to package a
gnome-python application...
|
by: Durumdara |
last post by:
Hi !
I have an application that I compile to exe.
1.)
I want to compile main.ico into exe, or int zip. Can I do it ?
2.)
Can I compile the result to my specified directory, not into the...
| |
by: zdp |
last post by:
Dear all:
I made a window program by wxPython. Split windows, treectrl, listctrl
and textctrl are used. When I program in python, the look & feel of the
window controls are like the windos XP...
|
by: James Stroud |
last post by:
Hello All,
I am trying to create a semi-standalone with the vendor python on OS X
10.4 (python 2.3.5). I tried to include some packages with both
--packages from the command and the 'packages'...
|
by: bartonc |
last post by:
You can find the original author of the script by ggling " Py2Exe version 6.3 setup" The cool thing about this is that it calls py2exe, just in case you're uncomfortable with the command line. I had...
|
by: AdamGr |
last post by:
I am currently trying to convert a program I just wrote to application form, on the Mac. I'm using py2app to accomplish this, and everything works fine up until the last stage; when I try to complete...
|
by: Stef Mientki |
last post by:
Peter Anderson wrote:
In PyScripter, you should run wxPython in the plain remote machine (not
the wxPython remote),
and you should set "reset before run flag" or reset the remote machine
each...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |