Hey all,
I’m running on a bit of a tight schedule, and I need help with a wxpython app.
Here’s a dialog for running some code:
`import sys
import os
import wx
def OnRun(self, event):
class RunDialog(wx.Dialog):
def __init__(self, parent, eCode):
wx.Dialog.__init__(self, parent, title=("Run..."))
self.eCode = eCode
self.MakeRunCode()
f = open(os.path.abspath(os.path.dirname(sys.argv[0])) + "/tempcode.pyw", 'w')
f.write(self.eSaveCode)
f.close()
pyshl = py.shell.Shell(self, -1, introText="Running your Element program in its Pythonic equivalent...\n")
pyshl.runfile(os.path.abspath(os.path.dirname(sys.argv[0])) + "/tempcode.pyw")
def ShowECompileProblem(self, eName):
dlg = wx.MessageDialog(None, eName, 'Error while running...', wx.OK | wx.ICON_INFORMATION)
dlg.ShowModal()
def MakeRunCode(self):
self.eSaveCode = self.eCode
dlg = RunDialog(None, "print \"it worked!\"")
dlg.ShowModal()
dlg.Destroy()`
The first part is what I need a bit of help with.
The pyshl object is supposed to be
a python interpreter that comes up on the dialog. The only problem
is… I don’t get any errors showing that I’ve done anything wrong. It
would be great if someone showed me what I’m doing wrong. I hope that
the code snippet I posted works. But anyway, I just need to know what
I’m doing wrong. I would be VERY grateful if anyone could help me with this ASAP.
Thanks!!!