views:

24

answers:

1

Hi

I need a code portion to refresh the current page. I get the controller object from webbrowser module and start my webpage. And at a certain point I want to refresh my page inside the python code.

According to the documentation at http://docs.python.org/library/webbrowser.html, when I call the open() function of the controller object with the same url and with new = 0 it should not open a new tab. But it opens a new tab. (Tested in both Chrome and Firefox)

Do you have any suggestions? Thanks in advance.

A: 

I think there is no portable way to do such refresh. The codes for "new" are just hints and they aren't guaranteed. If you can, you could add a refresh into your webpage, but I don't know if you have access to the webpage you're accessing, but you can create a "webpage wrapper" which opens the page you want as an iframe or something like that and then refreshes it in a defined interval.

Tarantula
What I wanted to do is like twitter updates. Whenever there is a new tweet, the webpage is refreshed with the new tweet. (Or it may be triggered with a periodical checks.) But In both cases, server application is able to change the current webpage after a certain event. What I want to achieve in my problem is pretty much the same as in the Twitter case.Thanks for your response btw.
Mustafa Zengin