|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help with wx.py.shell !!!
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 Run(self, event): class RunDialog(wx.Dialog): def __init__(self, parent, eCode): wx.Dialoginit__(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', K | wx.ICN_INFRMATIN) 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!!! |
|
#2
|
|||
|
|||
|
Need Help with wx.py.shell !!!
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 Run(self, event): class RunDialog(wx.Dialog): def __init__(self, parent, eCode): wx.Dialoginit__(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', K | wx.ICN_INFRMATIN) 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!!! |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Python > Need Help with wx.py.shell !!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|