Sequence of Execution

Hi again, I have written a module that clears the Interactive window of Active Python 2.2.2 and it works fine by its self but when I use it as an imported module then the clearing takes place after the rest of the main program has run. I'm using Mellinium at home but on NT at work it works fine.

The call to the module is the first statment after main(): in the calling program, the prog then goes on to extract info from web pages and display it to the Interactive window where upon the Interactive window is cleared.

The 'clear the Intractive window' prog does this by finding PythonWin window then using the keybd_event a few times, switches to the Interactive window, highlights all and deletes it as if you used the keys to do itCTRL+I , CTRL+A and CTRL+X.

Is it something to do with threads? Im at a loss as I was for the file atributes ( that now works a treat - thanks)

THANKS in advance for any insight or where to start looking.I'm really getting to like Python after a couple of weeks of frustration. Still needs more examples for everything.

Here are the programs first the HTML prog. This could be any prog tho. I have taken out code that just makes the post long.

Comments

: Hi again,: I have written a module that clears the Interactive window of Active Python 2.2.2 and it works fine by its self but when I use it as an imported module then the clearing takes place after the rest of the main program has run. I'm using Mellinium at home but on NT at work it works fine.: : The call to the module is the first statment after main(): in the calling program, the prog then goes on to extract info from web pages and display it to the Interactive window where upon the Interactive window is cleared.: : The 'clear the Intractive window' prog does this by finding PythonWin window then using the keybd_event a few times, switches to the Interactive window, highlights all and deletes it as if you used the keys to do it: CTRL+I , CTRL+A and CTRL+X.: : Is it something to do with threads? Im at a loss as I was for the file atributes ( that now works a treat - thanks): : : : THANKS in advance for any insight or where to start looking.: I'm really getting to like Python after a couple of weeks of frustration. Still needs more examples for everything.: : Here are the programs first the HTML prog. : This could be any prog tho. I have taken out code that just makes the post long.: [code]: import urllib: import string: import clearInteractive: : def getheadline(htmlRef):: start = fini = -1: theLine = "": sock = urllib.urlopen(htmlRef) : htmlSource = sock.readlines(): sock.close(): for x in htmlSource:: ~~~~ code to strip out unwanted stuff: print "one done": : def main():: : clearInteractive.clearWin(): : print "

: From now on, please use the [leftbr]code[rightbr] and [leftbr]/code[rightbr] stylecodes. Especially in Python, it is critical that indentation be maintained. Thank you.: : As far as your problem goes, I'm not sure what to make of it. I doubt it has anything to do with threading. Perhaps the firing of window drawing events is somehow delayed.: : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]: :