Registered Member
|
Hi there,
I have a problem with two scripts I'm currently working on; I would like the first one to run periodically, so i tried using the time.sleep() function (in python), but it causes ktorrent to hang. same thing with the second one which is supposed to send information over network, it hangs on socket.listen() while waiting for a client to connect. Does ktorrent wait for the script to end or am I doing something wrong? |
Moderator
|
Use KTScriptingPlugin.createTimer(False), this will create a Qt QTimer. (See the auto resume script for an example). Never ever sleep in a script, because the script runs in the same thread as ktorrent's main thread, this will completely block KT's main thread.
Same thing as above, you are using a blocking function, it will block the GUI. You have to use something non blocking. |
Registered Member
|
Works fine, thanks for the help! |
Registered users: Bing [Bot], Evergrowing, Google [Bot]