Re: Silly small python question: task in a non blocking way?
Quote:
Originally Posted by v13
(Post 957608)
It depends on your program:
If you have a cpu-intensive program (let's say a password cracker - that runs all the time) that needs to communicate with the network you may need separate processes (but for the cpu-intensive part).
For most other cases you do this using select/poll or an API that is based on that (like asyncore or twisted).
On the other hand, if you're writing a GUI program you'll have to look at the toolkit's libraries for something that properly interacts with its main loop. Qt for example has a networking module that will fit your needs.
|
My app is not extremely CPU intensive.... I will think about what you've wrote, but looks like the select/poll thing is close to what I need. I would have to do it on sockets, since I want my app to be cross-platform.
Thanks,
L.
|