[Chicago] =?gb2312?q?=BB=D8=B8=B4=A3=BA=20Re:=20=20python=20and=20c=20impo?= =?gb2312?q?rt=20error?=

=?gb2312?q?=B7=C5=DC=F8=20=CC=B8?= jolley84 at yahoo.com.cn
Wed Nov 15 11:46:29 CET 2006


thanks robert,u are helpful.
  my script is in low version of wxpython,and it should upgrade,the first script that i hand to u is in wxpython2.6.3,and mostly in the script,wxPython is used there.and with the version enhanced,the use of wxpython has shifted to wx.so i should use "import wx" not "from wxPython.wx import * "and also the mainloop, i should pay my attention to the version issue,which can results in nightmare.
  and also my script i handed to u is not right, as i just revise sth in order to upgrade the version. 
  in addition, just a pity thing is that the c extension issue is not explained, anyway thanks.
  later i just reinstall the python-connected software in another pc, and it goes just the same,however, the _core_ is unclearly solved.thanks to god,now i start to build wxPython from src, but the build fails,as it needs vc2003,mine is vc6.and hope that it can be resolved as soon as possible.i find writing python in c extension is more difficult than a single python script,just the bad configurations,
  regards,
  jolley

Robert Ramsdell <rcriii at ramsdells.net> дµÀ£º
  Does your python script work before you try importing it into the C
extension? When I try it it does not work. However, my last version
did not work either, the following does (I forgot to define mainloop):

import wx
class MyApp(wx.Frame):
def __init__(self,title = "MyApp"):
self.app = wx.PySimpleApp()
self.title = title
self.windowCaption = title
wx.Frame.__init__(self,None,wx.ID_ANY, self.windowCaption,
size=(200,100),
style=wx.DEFAULT_FRAME_STYLE|
wx.NO_FULL_REPAINT_ON_RESIZE)
self.Show(True)

# These functions run the app
def mainloop(self):
self.app.MainLoop()

if __name__ == "__main__":
newapp = MyApp()
newapp.mainloop()

However, I'm not at all sure how this will play with the c extension,
I'm afraid that's over my head.

Robert

On Tue, 2006-11-14 at 20:36 +0800, Jolley wrote:
> here is a script which shows the creation of a frame.
> with its name app.py
> import wx
> class MyApp(wx.App):
> def OnInit(self,title = "MyApp"):
> self.app = wx.PySimpleApp()
> self.title = title
> self.windowCaption = title
> 
> wx.Frame.__init__(self,None,self.ID_ANY,self.windowCaption,
> size = (200,100),
> style =
> wx.DEFAULT_WINDOW_STYLE|
> wx.NO_FULL_REPAINT_NO_RESIZE)
> app = MyApp(0)
> app.MainLoop()
> hmm,the python script is povided by Robert ,thanks again for the
> valuable revision on my former script,it's ugly and not smart.
> and then when i intend to use it in c extension.so,i start by

> 

_______________________________________________
Chicago mailing list
Chicago at python.org
http://mail.python.org/mailman/listinfo/chicago


 		
---------------------------------
ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä-3.5GÈÝÁ¿£¬20M¸½¼þ£¡ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/chicago/attachments/20061115/f6e68f36/attachment.htm 


More information about the Chicago mailing list