472,128 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,128 software developers and data experts.

Integrate IE in python program

Hi,
I begin in python program and I would like to know how I can do to integrate Internet Explorer into my python program without titlebar statusbar etc... Just with the main windows (windows which show web site)
I have already searched documention but i never find something about my problem
Thank you !
Aug 23 '07 #1
7 3142
ilikepython
844 Expert 512MB
Hi,
I begin in python program and I would like to know how I can do to integrate Internet Explorer into my python program without titlebar statusbar etc... Just with the main windows (windows which show web site)
I have already searched documention but i never find something about my problem
Thank you !
There is a webbroswer module that might do what you are looking for.
Aug 23 '07 #2
bartonc
6,596 Expert 4TB
Hi,
I begin in python program and I would like to know how I can do to integrate Internet Explorer into my python program without titlebar statusbar etc... Just with the main windows (windows which show web site)
I have already searched documention but i never find something about my problem
Thank you !
You'll need a GUI toolkit that is capable of running an ActiveX component if you really want to run IE (not the best browser in the world). wxPython is such a toolkit, for example.
Aug 23 '07 #3
I have found something about IEHtmlWindow
And I have tried to write something but everything crash
My code
Expand|Select|Wrap|Line Numbers
  1. import wx
  2. if wx.Platform == '__WXMSW__':
  3.     import  wx.lib.iewin    as  iewin
  4.  
  5. class IE(wx.Frame):
  6.     def __init__(self,titre):
  7.         wx.Frame.__init__(self,parent=None, id=-1, title= titre , size=(300, 300) )
  8.  
  9.         self.ie = iewin.IEHtmlWindow(self, id=-1, style = wx.NO_FULL_REPAINT_ON_RESIZE )
  10.         self.current = "http://localhost/"
  11.         self.ie.LoadUrl(self.current)
  12.         return True
  13.  
  14. class Monpp(wx.App):
  15.     def OnInit(self):
  16.         fen = IE("zone")
  17.         fen.Show(True)
  18.         self.SetTopWindow(fen)
  19.         return True
  20.  
  21. app = Monpp()
  22. app.MainLoop()
  23.  
Thanks !
Aug 23 '07 #4
bartonc
6,596 Expert 4TB
Good one! iewin is a special subclass of an ActiveX window. This (modified slightly) works on my system. You do have wxPython, then???
Expand|Select|Wrap|Line Numbers
  1. import wx
  2. if wx.Platform == '__WXMSW__':
  3.     import  wx.lib.iewin    as  iewin
  4.  
  5. class IE(wx.Frame):
  6.     def __init__(self,titre):
  7.         wx.Frame.__init__(self,parent=None, id=-1, title= titre , size=(300, 300) )
  8.  
  9.         self.ie = iewin.IEHtmlWindow(self, id=-1, style = wx.NO_FULL_REPAINT_ON_RESIZE )
  10.         self.current = "http://google.com/"  ### localhost ## won't work!!!
  11.         self.ie.LoadUrl(self.current)
  12.         return True
  13.  
  14. class Monpp(wx.App):
  15.     def OnInit(self):
  16.         fen = IE("zone")
  17.         fen.Show(True)
  18.         self.SetTopWindow(fen)
  19. ##        return True   ## Don't return a value here!!!
  20.  
  21. app = Monpp()
  22. app.MainLoop()
Aug 24 '07 #5
I changed my code so I have already the same errors:
Traceback (most recent call last):
File "D:\aaa\barre\test.py", line 20, in <module>
app = Monpp()
File "C:\Program Files\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7819, in __init__
self._BootstrapApp()
File "C:\Program Files\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7416, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "D:\aaa\barre\test.py", line 16, in OnInit
fen = IE("zone")
TypeError: __init__() should return None, not 'bool'
Aug 24 '07 #6
bartonc
6,596 Expert 4TB
I changed my code so I have already the same errors:
You mean you copied my post and all the errors went away, right?
Aug 24 '07 #7
Before the change i had the same error
Aug 24 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Yi-Yu Chou | last post: by
5 posts views Thread by billiejoex | last post: by
5 posts views Thread by Marcelo | last post: by
4 posts views Thread by Alison | last post: by
2 posts views Thread by pdmountaineer | last post: by
3 posts views Thread by pdmountaineer | last post: by
reply views Thread by Christoph Zwerschke | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.