Delay in python script ??
#1
Sad 
hello,

i was wondering if i could make a sort of delay in my script.
now i play a sound in the script and then i want a 2 seconds delay and then another sound. so does anyone know how i make a delay?

thanks in advance,
atmoz

(i'm from the netherlands, so sorry for my english)
Reply
#2
hey.

it's easy if you don't mind stopping your whole script.

Quote:import time

time.sleep(2)
that's the easy way. the time.sleep() function has your script pause whatever it's doing for the number of seconds in parentheses (and this can be a float).

if you have a script that needs to go on processing while also keeping track of the two seconds, you'll need to create a new thread, and have that thread run time.sleep, and then call back to play the other sound.

let me know if that's enough of an answer. i'll be glad to clarify if necessary.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
(alexpoet @ aug. 29 2004,22:47 Wrote:hey.

it's easy if you don't mind stopping your whole script.

Quote:import time

time.sleep(2)
that's the easy way. the time.sleep() function has your script pause whatever it's doing for the number of seconds in parentheses (and this can be a float).

if you have a script that needs to go on processing while also keeping track of the two seconds, you'll need to create a new thread, and have that thread run time.sleep, and then call back to play the other sound.

let me know if that's enough of an answer. i'll be glad to clarify if necessary.

thank you for the quick reply.
it works fine for me at this way. excellent !!  :d

i've another question about python scripts:

can i show some text on the lcd (with my smartxx chip) with the use of a python script?

for example:

xbmc.writelcd "hello world"

or isn't this possible with a script?
and i was wondering if there was a faq or database with the command's you could use in a python script?

atmoz
Reply

Logout Mark Read Team Forum Stats Members Help
Delay in python script ??0