[Tutor] Async Events (or How to manage interrupts in Python?)

"Héctor Villafuerte D." hec.villafuerte at telgua.com.gt
Mon Dec 29 13:48:37 EST 2003


Hi all,
First, let me tell you what all this is about. I have a very nice script 
that does the following:
1. It checks if there is a file in an Open VMS server.
2. If it finds the file, it connects via TELNET (using telnetlib, of 
course!) and ZIP's it.
3. Once the file is compressed, it GET's it via FTP (using ftplib)
4. When the file is in my local machine, the script does some processing 
on it.
5. If the script was given more than one file to look at the VMS server 
it goes back to Step 1.

Quite simple, right?
The thing is that I don't want this to perform sequentially... it's such 
a waste of time!
Because while the script is in Steps 3 and 4, it could perfectly be 
executing Steps 1 and 2.
When I used to program microcontrollers (PICs) we had good old 
interrupts to handle things
like this. Any ideas how to do this in Python?

Thank you so much, in advance.
Hector




More information about the Tutor mailing list