Hey Guys
I know I am missing some important points on how to use the python language. Is it possible to pass variables between methods (is that what theyare called?)
in my attempt below I have an initial definition that gets users input in 2 text fields and uses that later down the script to create a bunch of directories once the button "GO!!!" is clicked.
I get this error: jobfolder = a
NameError: global name 'a' is not defined
but i defined it up in the beginning of the script.
Any ideas?
Apologies for all the questions forum posts - I'll stop soon!
AT -
-
#!/usr/bin/python
-
-
# newjob.py
-
-
import wx
-
import os
-
-
APP_SIZE_X = 400
-
APP_SIZE_Y = 210
-
-
class NewJob(wx.Dialog):
-
def __init__(self, parent, id, title):
-
wx.Dialog.__init__(self, parent, id, title, size=(APP_SIZE_X, APP_SIZE_Y))
-
-
a = wx.StaticText(self, -1, 'Enter a job name:', (25, 20), style=wx.ALIGN_LEFT)
-
wx.TextCtrl(self, 3, '', (25,50), (200, -1))
-
b = wx.StaticText(self, -1, 'Enter number of shots:', (25, 85), style=wx.ALIGN_LEFT)
-
wx.TextCtrl(self, 4, '', (25,110), (85, -1))
-
-
wx.Button(self, 2, 'Quit', (50, 150))
-
wx.Button(self, 1, 'GO!!!', (150, 150), (210, -1))
-
-
self.Bind(wx.EVT_BUTTON, self.OnClose, id=2)
-
self.Bind(wx.EVT_BUTTON, self.OnCreateJob, id=1)
-
-
self.Centre()
-
self.ShowModal()
-
self.Destroy()
-
-
def OnClose(self, event):
-
self.Close(True)
-
-
def OnCreateJob(self, event):
-
-
jobfolder = a
-
shotamount = b
-
-
jobroot = os.getcwd()
-
-
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/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/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/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( jobfolder)
-
-
#CREATE OFFLINE & ONLINE DIRECTORIES
-
os.mkdir( jobfolder + "/offline")
-
-
#CHANGE INTO OFFLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobfolder + "/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()
-
-
#CHANGE INTO ONLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobroot)
-
os.mkdir( jobfolder + "/online")
-
os.chdir( jobfolder + "/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()
-
-
-
app = wx.App(0)
-
NewJob(None, -1, 'newjob')
-
app.MainLoop()
-
-
13 2116 bartonc 6,596
Recognized Expert Expert
It's all about the "scope" of a variable.
Inside your __init__() function, the variable a only has life in that scope (the method - or function, if you prefer- scope). The object that is directing the show is the Dialog. The reason that self (this Dialog) is present in every method definition is so that the given method has access to the object scope (self.whatever) . So, if you want a variable to live outside a function, make it an attribute of the object: - self.useDescriptiveNamesForAttributes = .....
These are in effect "global", but only in the object scope (encapsulation) .
Hope that's not too confusing...
Hi,
attach the variable to your class,
line 15: self.myVariable
then in the method
def OnCreateJob():
self.myVariable ...
br,
Björn
bartonc 6,596
Recognized Expert Expert
I notice that you are doing several things in a debatable manner.
1) Assigning IDs as absolutes is a definite no-no. It's bound to cause problems down the road: - wxID_SEGMENTDIALOGRECORDBUTTON = wx.NewId()
That's actually a generated name, yours could be shorter.
2) Button events should be bound to the button and not the parent: - # <snipped from Dialog subclass>
-
self.RecordButton = wx.Button(id=wxID_SEGMENTDIALOGRECORDBUTTON, label='Record Station', name='RecordButton', parent=self.panel1, pos=wx.Point(816, 20), size=wx.Size(173, 36), style=0)
-
self.RecordButton.Bind(wx.EVT_BUTTON, self.OnRecordButton, id=wxID_SEGMENTDIALOGRECORDBUTTON)
bartonc 6,596
Recognized Expert Expert
I notice that you are doing several things in a debatable manner.
1) Assigning IDs as absolutes is a definite no-no. It's bound to cause problems down the road: - wxID_SEGMENTDIALOGRECORDBUTTON = wx.NewId()
That's actually a generated name, yours could be shorter.
2) Button events should be bound to the button and not the parent: - # <snipped from Dialog subclass>
-
self.RecordButton = wx.Button(id=wxID_SEGMENTDIALOGRECORDBUTTON, label='Record Station', name='RecordButton', parent=self.panel1, pos=wx.Point(816, 20), size=wx.Size(173, 36), style=0)
-
self.RecordButton.Bind(wx.EVT_BUTTON, self.OnRecordButton, id=wxID_SEGMENTDIALOGRECORDBUTTON)
Making a Button (or even StaticText) an attribute of the Dialog may seem like just an extra variable in you class's name space, but it actually comes in handy very quickly. You may soon find that you want to disable, change the color of, (or a host of other things) any one of these little GUI devils (it happens to me, anyway).
Hey Guys
Thanks for your help. I kind of understand but a lot of it is flying right over my head. :)
BjornB I tried what I think you said to do - but I think I didn't really understand.
I changed the variables "a" & "b" to self.a & self.b in the "class NewJob" in the "def __int__".
Mind taking a look? -
#!/usr/bin/python
-
-
# newjob.py
-
-
import wx
-
import os
-
-
APP_SIZE_X = 400
-
APP_SIZE_Y = 210
-
-
class NewJob(wx.Dialog):
-
def __init__(self, parent, id, title):
-
wx.Dialog.__init__(self, parent, id, title, size=(APP_SIZE_X, APP_SIZE_Y))
-
-
wx.StaticText(self, -1, 'Enter a job name:', (25, 20), style=wx.ALIGN_LEFT)
-
self.a = str(wx.TextCtrl(self, 3, '', (25,50), (200, -1)))
-
wx.StaticText(self, -1, 'Enter number of shots:', (25, 85), style=wx.ALIGN_LEFT)
-
self.b = str(wx.TextCtrl(self, 4, '', (25,110), (85, -1)))
-
-
wx.Button(self, 2, 'Quit', (50, 150))
-
wx.Button(self, 1, 'GO!!!', (150, 150), (210, -1))
-
-
self.Bind(wx.EVT_BUTTON, self.OnClose, id=2)
-
self.Bind(wx.EVT_BUTTON, self.OnCreateJob, id=1)
-
-
self.Centre()
-
self.ShowModal()
-
self.Destroy()
-
-
def OnClose(self, event):
-
self.Close(True)
-
-
def OnCreateJob(self, event):
-
-
jobfolder = self.a
-
shotamount = self.b
-
-
jobroot = os.getcwd()
-
-
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/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/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/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( jobfolder)
-
-
#CREATE OFFLINE & ONLINE DIRECTORIES
-
os.mkdir( jobfolder + "/offline")
-
-
#CHANGE INTO OFFLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobfolder + "/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()
-
-
#CHANGE INTO ONLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobroot)
-
os.mkdir( jobfolder + "/online")
-
os.chdir( jobfolder + "/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()
-
-
-
app = wx.App(0)
-
NewJob(None, -1, 'newjob')
-
app.MainLoop()
-
-
I notice that you are doing several things in a debatable manner.
1) Assigning IDs as absolutes is a definite no-no. It's bound to cause problems down the road: - wxID_SEGMENTDIALOGRECORDBUTTON = wx.NewId()
That's actually a generated name, yours could be shorter.
2) Button events should be bound to the button and not the parent: - # <snipped from Dialog subclass>
-
self.RecordButton = wx.Button(id=wxID_SEGMENTDIALOGRECORDBUTTON, label='Record Station', name='RecordButton', parent=self.panel1, pos=wx.Point(816, 20), size=wx.Size(173, 36), style=0)
-
self.RecordButton.Bind(wx.EVT_BUTTON, self.OnRecordButton, id=wxID_SEGMENTDIALOGRECORDBUTTON)
Hey BartonC,
does that mean that rather than doing this:
wx.Button(self, 2, 'Quit', (50, 150))
i should do:
self.QuitButton = wx.Button(self, 2, 'Quit', (50, 150))
Thanks for all your help!
bartonc 6,596
Recognized Expert Expert
Hey BartonC,
does that mean that rather than doing this:
wx.Button(self, 2, 'Quit', (50, 150))
i should do:
self.QuitButton = wx.Button(self, 2, 'Quit', (50, 150))
Thanks for all your help!
First: Yes, you got what Bjorn was conveying.
Second: I treat (well, I would if I wrote the GUI layout part - Boa Constructor does that for me) GUI elements the same as other variables that are needed in the Class Scope (such as self.a and self.b in your post). And I can't stress enough how important it is to use better naming for your variables. Here is a thread discussing naming conventions in Python. You'll like yourself much more when you go back into a piece of code later and find things like "veryDescriptiv eNameStr" rather than "a".
Hope that make sense.
hey guys
thanks for all your help so far - sorry I havent got back to your replies - distracted with work
I think I understand what u mean by giving everything descriptive names and assigning them as self. and flexible IDs
Does this look better?
It still doesn't work - I cant seem to convert a string to an integer - this error:
line 128, in OnCreateJob
os.mkdir( self.jobfolder)
TypeError: coercing to Unicode: need string or buffer, TextCtrl found
Any ideas how to get that to convert to a string?
i thought this would work:
int( self.NumberOfSh ots)
but get this:
TypeError: int() argument must be a string or a number
Cheers!!
Adam -
-
#!/usr/bin/python
-
-
# newjob.py
-
-
import wx
-
import os
-
-
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)
-
-
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.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.NumberOfShots.Bind(wx.EVT_TEXT, self.OnCreateJob, id=wxID_SHOTAMOUNT)
-
-
self.jobfolder = str( self.JobName)
-
self.shotamount = self.NumberOfShots
-
-
self.QuitButton = wx.Button(panel, wxID_QUITBUTTON, "Quit", (10,140))
-
self.QuitButton.Bind(wx.EVT_BUTTON, self.OnClose, id=wxID_QUITBUTTON)
-
-
self.GoButton = wx.Button(panel, wxID_GOBUTTON, "GO!!!", (200,140))
-
self.GoButton.Bind(wx.EVT_BUTTON, self.OnCreateJob, id=wxID_GOBUTTON)
-
-
-
def OnClose(self, event):
-
self.Close(True)
-
-
-
def OnCreateJob(self, event):
-
-
jobroot = os.getcwd()
-
-
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( self.jobfolder)
-
-
#CREATE OFFLINE & CHANGE INTO OFFLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES & GLOBALS
-
os.mkdir( self.jobfolder + "/offline")
-
os.chdir( self.jobfolder + "/offline")
-
GLOBALSDIR()
-
-
#CREATE SHOT DIRECTORY AND AND SUB-DIRECTORIES
-
-
for i in range(1, self.shotamount + 1):
-
shotname = '%03d' % (i)
-
os.mkdir( shotname)
-
os.chdir( shotname)
-
SUBFOLDERS()
-
-
#CREATE ONLINE & CHANGE INTO ONLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobroot)
-
os.mkdir( self.jobfolder + "/online")
-
os.chdir( self.jobfolder + "/online")
-
GLOBALSDIR()
-
-
#CREATE SHOT DIRECTORY AND AND SUB-DIRECTORIES
-
-
for i in range(1, self.shotamount + 1):
-
shotname = '%03d' % (i)
-
os.mkdir( shotname)
-
os.chdir( shotname)
-
SUBFOLDERS()
-
-
-
print
-
print "job " + self.jobfolder + " created"
-
-
-
-
-
class MyApp(wx.App):
-
def OnInit(self):
-
frame = MyFrame(None, -1, New Job')
-
frame.Show(True)
-
frame.Centre()
-
return True
-
-
app = MyApp(0)
-
app.MainLoop()
Sweet!!!
I think I worked it out.
Can anyone confirm this works & is ok (code wise?) -
-
#!/usr/bin/python
-
-
# newjob.py
-
-
import wx
-
import os
-
-
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)
-
-
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.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,140))
-
self.QuitButton.Bind(wx.EVT_BUTTON, self.OnClose, id=wxID_QUITBUTTON)
-
-
self.GoButton = wx.Button(panel, wxID_GOBUTTON, "GO!!!", (200,140))
-
self.GoButton.Bind(wx.EVT_BUTTON, self.OnCreateJob, id=wxID_GOBUTTON)
-
-
-
def OnClose(self, event):
-
self.Close(True)
-
-
-
def OnCreateJob(self, event):
-
-
jobfolder = str( self.JobName.GetValue())
-
shotamount = int( self.NumberOfShots.GetValue())
-
-
print shotamount
-
-
jobroot = os.getcwd()
-
-
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( jobfolder)
-
-
#CREATE OFFLINE & CHANGE INTO OFFLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES & GLOBALS
-
os.mkdir( jobfolder + "/offline")
-
os.chdir( jobfolder + "/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()
-
-
#CREATE ONLINE & CHANGE INTO ONLINE DIRECTORY TO CREATE ALL THE SHOT DIRECTORIES
-
os.chdir( jobroot)
-
os.mkdir( jobfolder + "/online")
-
os.chdir( jobfolder + "/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()
-
-
-
print
-
print "job " + jobfolder + " created"
-
-
-
-
-
class MyApp(wx.App):
-
def OnInit(self):
-
frame = MyFrame(None, -1, 'New Job')
-
frame.Show(True)
-
frame.Centre()
-
return True
-
-
app = MyApp(0)
-
app.MainLoop()
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andy Read |
last post by:
Dear all,
I thought I understood passing parameters ByVal and ByRef but I
clearly don't! If I define a simple class
of:
Public Class Person
Public Name as String
Public Age as Integer
End Class
|
by: justanotherguy63 |
last post by:
Hi,
I am designing an application where to preserve the hierachy and for
code substitability, I need to pass an array of derived class object in
place of an array of base class object. Since I am using vector
class(STL), the compiler does not allow me to do this.
I do realize there is a pitfall in this approach(size of arrays not...
|
by: Kyzer |
last post by:
Hi all,
I have created a class which contains many TShapes, TLabels and
TPanels. What I want to be able to do is when creating this class, is
passing in a pointer to OnMouseDown and OnMouseUp events. Thereby, the
user of the class can create their own event handlers for those events.
The idea is that by passing in the event handlers,...
|
by: Amadeus W. M. |
last post by:
I have a member static const int x defined in class Foo, and I'm passing
it by reference, and by value elsewhere (see the code below). Passing it
by value works, but by reference it doesn't: it thinks x is undefined.
Could someone explain what's going on here? Why can't I pass a static
const member by reference?
This is how I compile it:
...
|
by: Harolds |
last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005
the pmID is evaluated to "" instead of what the value is set to:
....
xmlItems.Document = pmXML
// Add the pmID parameter to the XSLT stylesheet
XsltArgumentList xsltArgList = new XsltArgumentList();
xsltArgList.AddParam("pmID", "", pmID);...
| |
by: Arsen Vladimirskiy |
last post by:
Hello,
If I have a few simple classes to represent Entities such as Customers and
Orders.
What is the proper way to pass information to the Data Access Layer?
1) Pass the actual ENTITY to the Data Access Layer method
-or-
2) Pass some kind of a unique id to the Data Access Layer method
|
by: Ron Rohrssen |
last post by:
I want to show a dialog and when the form (dialog) is
closed, return to the calling form. The calling form
should then be able to pass the child form to another
object with the form as a parameter.
For example,
FormOptions formOptions = new FormOptions();
if (formOptions.ShowDialog(this) == DialogResult.OK)
{
|
by: Ken Allen |
last post by:
I have a .net client/server application using remoting, and I cannot get the
custom exception class to pass from the server to the client. The custom
exception is derived from ApplicationException and is defined in an assembly
common to the client and server components. The custom class merely defines
three (3) constructors -- the null...
|
by: scottt |
last post by:
hi,
I am having a little problem passing in reference of my calling class (in my
..exe)into a DLL. Both programs are C# and what I am trying to do is pass a
reference to my one class into a DLL function. When I try and compile the DLL
I get "The type or namespace name "MyForm" could not be found.
I think I have to reference the class but...
|
by: TS |
last post by:
I was under the assumption that if you pass an object as a param to a method
and inside that method this object is changed, the object will stay changed
when returned from the method because the object is a reference type?
my code is not proving that. I have a web project i created from a web
service that is my object:
public class...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
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 we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |