trying to call main function with execfile with two arguments

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric_Dexter@msn.com

    trying to call main function with execfile with two arguments

    I was trying to find out what my value for filename is but it will not
    print. The file I am calling csoundgrid2.mai n seems to work fine when
    I call it directly from spe with two values and I have used this file
    dialog to load other files the error I am getting is. thanks for any
    help in advance

    File "C:\Python24\Li b\site-packages\boa-constructor\tes t of
    snake\csoundgri d2.py", line 35, in loadFile
    infile = open(sys.argv[1], 'r') #The first argument passed in is the
    file name
    IndexError: list index out of range

    def sco_editor(self ):
    "Pick a sco file and load it into a sco editor"
    dlg = wx.FileDialog(s elf,"load sco file", ".", "", "*.sco",
    wx.OPEN)
    try:
    if dlg.ShowModal() == wx.ID_OK:
    filename = dlg.GetPath()
    # Your code
    print filename
    csoundgrid2.mai n(filename, """;<sco_header >""")
    #("csoundgrid2. py", filename ,""";<sco_heade r>""",
    shell=True)
    #os.startfile(' csoundgrid2.py' , filename,
    """;<sco_header >""")
    finally:
    dlg.Destroy()

    tracker interface for csound. working sco editor, drum machine exc, support for vst and csound instruments. Csound routines is also available by…



  • Eric_Dexter@msn.com

    #2
    Re: trying to call main function with execfile with two arguments

    To extend and revise my notes this is the dialog box that comes with
    boa constructor with very little change.


    Eric_Dexter@msn .com wrote:
    I was trying to find out what my value for filename is but it will not
    print. The file I am calling csoundgrid2.mai n seems to work fine when
    I call it directly from spe with two values and I have used this file
    dialog to load other files the error I am getting is. thanks for any
    help in advance
    >
    File "C:\Python24\Li b\site-packages\boa-constructor\tes t of
    snake\csoundgri d2.py", line 35, in loadFile
    infile = open(sys.argv[1], 'r') #The first argument passed in is the
    file name
    IndexError: list index out of range
    >
    def sco_editor(self ):
    "Pick a sco file and load it into a sco editor"
    dlg = wx.FileDialog(s elf,"load sco file", ".", "", "*.sco",
    wx.OPEN)
    try:
    if dlg.ShowModal() == wx.ID_OK:
    filename = dlg.GetPath()
    # Your code
    print filename
    csoundgrid2.mai n(filename, """;<sco_header >""")
    #("csoundgrid2. py", filename ,""";<sco_heade r>""",
    shell=True)
    #os.startfile(' csoundgrid2.py' , filename,
    """;<sco_header >""")
    finally:
    dlg.Destroy()
    >
    tracker interface for csound. working sco editor, drum machine exc, support for vst and csound instruments. Csound routines is also available by…

    http://www.dexrow.com

    Comment

    Working...