wx.lib.iewin usage in notebook

Hi,

let's say I want to display a lot of HTML pages in a tabbed component.
I create an IEHtmlWindow and place one on each tab. I am finding that
memory usage is very high, about 400Mb are used to display 50 docs in
individual tabs where the same 50 docs loaded into individual tabs on
IE on the desktop takes about 50Mb. Is there someway to 'share' a
single instance of the widget? I guess I could create / destroy
widgets with tab changes but would be unfortunate....

Thanks.

If you need to stick with IEHtmlWindow you could have just a single
instance and in your tabs handler switch what it is displaying - this
would be quicker than create/destroy. If the content is web based
rather than on the local hard drive you could get all the pages but the
current one into memory buffers as a background task to make switching
much faster.

Gadget/Steve

···

On 28/11/2011 3:52 AM, poogie wrote:

Hi,

let's say I want to display a lot of HTML pages in a tabbed component.
I create an IEHtmlWindow and place one on each tab. I am finding that
memory usage is very high, about 400Mb are used to display 50 docs in
individual tabs where the same 50 docs loaded into individual tabs on
IE on the desktop takes about 50Mb. Is there someway to 'share' a
single instance of the widget? I guess I could create / destroy
widgets with tab changes but would be unfortunate....

Thanks.

Hi,

let's say I want to display a lot of HTML pages in a tabbed component.
I create an IEHtmlWindow and place one on each tab. I am finding that
memory usage is very high, about 400Mb are used to display 50 docs in
individual tabs where the same 50 docs loaded into individual tabs on
IE on the desktop takes about 50Mb. Is there someway to 'share' a
single instance of the widget?

Probably not. My guess is that the overhead is due to using the ActiveX interface for hosting the IE widget, and having to duplicate all of that "hosting" for each tab.

I guess I could create / destroy
widgets with tab changes but would be unfortunate....

Does the user really need that many tabs open at once?

···

On 11/27/11 7:52 PM, poogie wrote:

--
Robin Dunn
Software Craftsman

I too am writting a little coder utility that opens up all my previous
sessions cmd.exe, explorer.exe, and urls in a selective manner. I
usually have about 50 tabs open on any one day. Why? Because I have
poor short term memory. I'm not alone. Means I'm less productive then
a smarty but that doesn't mean I give up. So I rely on having
documents on hand to compensate.

For example; I'll have one webpage open for each python library, wx
widget, my several email services, dev/coder sites, tutorial blogs,
youtube and showmedo howtos. Another example of the number of tabs
opened (for a noob coder/forgetful person) would be trying to get
threaded/subprocessed wxPython to work with yami in a chat/openGL
program, where i'll be using the open sourse graphic editors blender
and inkscape. Being a non-expert at any of these means ready
documentation is important to me.

···

On Tue, Nov 29, 2011 at 2:45 PM, Robin Dunn <robin@alldunn.com> wrote:

On 11/27/11 7:52 PM, poogie wrote:

Hi,

let's say I want to display a lot of HTML pages in a tabbed component.
I create an IEHtmlWindow and place one on each tab. I am finding that
memory usage is very high, about 400Mb are used to display 50 docs in
individual tabs where the same 50 docs loaded into individual tabs on
IE on the desktop takes about 50Mb. Is there someway to 'share' a
single instance of the widget?

Probably not. My guess is that the overhead is due to using the ActiveX
interface for hosting the IE widget, and having to duplicate all of that
"hosting" for each tab.

I guess I could create / destroy
widgets with tab changes but would be unfortunate....

Does the user really need that many tabs open at once?

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Can I recommend Opera web browser - it allows the option of reopen the
last browsing session on start-up.

Gadget/Steve

···

On 01/12/2011 4:01 PM, Dev Player wrote:

On Tue, Nov 29, 2011 at 2:45 PM, Robin Dunn <robin@alldunn.com> wrote:

On 11/27/11 7:52 PM, poogie wrote:

Hi,

let's say I want to display a lot of HTML pages in a tabbed component.
I create an IEHtmlWindow and place one on each tab. I am finding that
memory usage is very high, about 400Mb are used to display 50 docs in
individual tabs where the same 50 docs loaded into individual tabs on
IE on the desktop takes about 50Mb. Is there someway to 'share' a
single instance of the widget?

Probably not. My guess is that the overhead is due to using the ActiveX
interface for hosting the IE widget, and having to duplicate all of that
"hosting" for each tab.

I guess I could create / destroy
widgets with tab changes but would be unfortunate....

Does the user really need that many tabs open at once?

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I too am writting a little coder utility that opens up all my previous
sessions cmd.exe, explorer.exe, and urls in a selective manner. I
usually have about 50 tabs open on any one day. Why? Because I have
poor short term memory. I'm not alone. Means I'm less productive then
a smarty but that doesn't mean I give up. So I rely on having
documents on hand to compensate.

For example; I'll have one webpage open for each python library, wx
widget, my several email services, dev/coder sites, tutorial blogs,
youtube and showmedo howtos. Another example of the number of tabs
opened (for a noob coder/forgetful person) would be trying to get
threaded/subprocessed wxPython to work with yami in a chat/openGL
program, where i'll be using the open sourse graphic editors blender
and inkscape. Being a non-expert at any of these means ready
documentation is important to me.

Firefox can open the last session too. It also has Tab Mix Plus, probably the best tab plug-in I’ve ever used.

···

Mike Driscoll

Blog: http://blog.pythonlibrary.org

MS Internet Explorer can open the last session also.
However it doesn't give the same depth of selectivety I'm looking for.

Some of that project is not wx related. I'd like a gui to launch and
shutdown various tools, the browser is only one tool.

I haven't figured out how to shut down a cmd.exe, or explorer.exe
gracefully from another process.

This might give you a hint:

    def RemoveStdIoWin(self):
        """ Utility function to close/delete the stdio window when
ending redirection """
        OPW = wx.FindWindowByLabel('wxPython: stdout/stderr')
        if not None == OPW:
            OPW.Destroy()

Also take a look at psutil at Google Code Archive - Long-term storage for Google Code Project Hosting.

Gadget/Steve

···

On 01/12/2011 9:54 PM, Dev Player wrote:

MS Internet Explorer can open the last session also.
However it doesn't give the same depth of selectivety I'm looking for.

Some of that project is not wx related. I'd like a gui to launch and
shutdown various tools, the browser is only one tool.

I haven't figured out how to shut down a cmd.exe, or explorer.exe
gracefully from another process.

Gadget/Steve wrote:

This might give you a hint:

    def RemoveStdIoWin(self):
        """ Utility function to close/delete the stdio window when
ending redirection """
        OPW = wx.FindWindowByLabel('wxPython: stdout/stderr')
        if not None == OPW:
            OPW.Destroy()

This relates to our recent discussion on "not in". How can you POSSIBLY
argue that your penultimate line makes any sense at all? Surely the
following reads more easily, as well as being easier to type:
    if OPW:
        OPW.Destroy()

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

The arrangement of the penultimate line is largely a matter of habit
for me as I have spent “several” years writing embedded PLM & C
code for safety critical applications, mostly following MISRA
guidelines, in that field there are a number of rules about if
statements:

  1.     Only test one thing at a time, nested ifs are better than
    

multiple item tests, this is for clarity, compiler evaluation
order independence and ease of testing, I have had an issue in
the past, in plm86, where a lot of if statements were checking
for a valid pointer and then in a single line checking the value
accessed by the pointer, unfortunately between one issue of the
compiler and the next the evaluation order changed from right to
left to left to right, only had to identify about 6000 lines
where this was happening and correct them and since they were
using just the pointer name couldn’t even use a search to find
them, if they had checked the pointer in an outer if statement
then there wouldn’t have been an issue.

  1. No implicit casts, sometimes they lead to unexpected results.
  2.     When comparing for equality a variable with a constant or
    

literal always put the variable second, this is because if 0 = x
will usually give a compiler error whereas if x = 0 will at best
give a warning, (just about everybody has typed = rather than ==
sometime).
Since C has a large number of implementation dependent features,
and less clear statements of precedence than Python, the MISRA
guidelines emphasise a programming style that doesn’t assume that
the compiler will always do what you expect. Old habits die hard
and some are not worth trying to kill off, I would rather have a
little extra typing at the early stage than masses of rework or
bug fixing.

Gadget/Steve

···

On 02/12/2011 12:44 AM, Tim Roberts wrote:

Gadget/Steve wrote:


    This might give you a hint:
def RemoveStdIoWin(self):
""" Utility function to close/delete the stdio window when
ending redirection """
OPW = wx.FindWindowByLabel('wxPython: stdout/stderr')
if not None == OPW:
OPW.Destroy()
    This relates to our recent discussion on "not in". How can you POSSIBLY
argue that your penultimate line makes any sense at all? Surely the
following reads more easily, as well as being easier to type:
if OPW:
OPW.Destroy()

Apologies for contributing to this thread going off topic, but... My
preference would be "if OPW != None". I have mental parsing issues
with conditions such as yours where the variable is not a boolean. "if
OPW"... if OPW what? On the other hand, I immediately knew that Gadget/
Steve was coming from a C background when I saw his condition and that
it was certainly not a Python artifact. People have different
preferences and habits, who would have thought?

···

On Dec 2, 12:44 am, Tim Roberts <t...@probo.com> wrote:

Gadget/Steve wrote:
This relates to our recent discussion on "not in". How can you POSSIBLY
argue that your penultimate line makes any sense at all? Surely the
following reads more easily, as well as being easier to type:
if OPW:
OPW.Destroy()

better yet is:

if OPW is not None:

(or is None: if that's what you want)

asside from performance, which I can't image hardly ever matters, I'm not entirely sure why, but it's the "accepted" idiom, and I like it.

-Chris

···

On 12/2/2011 10:33 AM, John Kemp wrote:

My
preference would be "if OPW != None"

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I think it has something to do with None being a singleton, and that testing identity rather than equality is a bit more logical approach, and IIRC is marginally more efficient.

···

On 12/2/11 2:38 PM, Chris Barker wrote:

On 12/2/2011 10:33 AM, John Kemp wrote:

My
preference would be "if OPW != None"

better yet is:

if OPW is not None:

(or is None: if that's what you want)

asside from performance, which I can't image hardly ever matters, I'm
not entirely sure why, but it's the "accepted" idiom, and I like it.

--
Robin Dunn
Software Craftsman

Excellent! Thanks!

···

On Thu, Dec 1, 2011 at 7:03 PM, Gadget/Steve <GadgetSteve@live.co.uk> wrote:

This might give you a hint:

def RemoveStdIoWin(self):
""" Utility function to close/delete the stdio window when
ending redirection """
OPW = wx.FindWindowByLabel('wxPython: stdout/stderr')
if not None == OPW:
OPW.Destroy()

Also take a look at psutil at Google Code Archive - Long-term storage for Google Code Project Hosting.
Gadget/Steve

No problem - it has even sparked some OT but interesting discussion in
the thread.

:slight_smile:

Gadget/Steve

···

On 03/12/2011 3:24 AM, Dev Player wrote:

On Thu, Dec 1, 2011 at 7:03 PM, Gadget/Steve <GadgetSteve@live.co.uk> wrote:

This might give you a hint:

   def RemoveStdIoWin(self):
       """ Utility function to close/delete the stdio window when
ending redirection """
       OPW = wx.FindWindowByLabel('wxPython: stdout/stderr')
       if not None == OPW:
           OPW.Destroy()

Also take a look at psutil at Google Code Archive - Long-term storage for Google Code Project Hosting.
Gadget/Steve

Excellent! Thanks!