I wrote a program that downloads images from urls using urllib.urlretrieve( url , address )
.
After each download of image, I open it using os.startfile(address)
or os.system(address)
.
Then I wait for 5 seconds using time.sleep(5)
and then download next image and open it in a same way.
It opens, but the old one is also still opened. I want the old window to be closed.
One way would be to some how tell python 2.7 to simulate alt+F4 in order to close the old window before opening the new one.