Salve a tutti stò sviluppando anche se su una piattaforma diversa dal computer un gioco ma mi serve sapere almeno la sintassi del timer qualkuno sà come si usa il timer nel python??? grazie in anticipo![]()
Salve a tutti stò sviluppando anche se su una piattaforma diversa dal computer un gioco ma mi serve sapere almeno la sintassi del timer qualkuno sà come si usa il timer nel python??? grazie in anticipo![]()
Non ti ho capito ..
Cosa vuoi fare con il timer ?
Vedi se ti può servire:
from time import *
t = time()
Experience is what you get when you don’t get what you want
Allora in poche parole nel gioco che sto facendo devo far si che per una TOT secondi mi visualizzi un immagine
per attendere un tot di tempo
import time
time.sleep(<secondi>)
Experience is what you get when you don’t get what you want
oppure anche
codice:>>> tempo = raw_input("Inserire tempo di attesa ") >>> from time import * >>> t = time() >>> t += tempo >>> tmp = time() >>> while tmp < t : tmp = time()
Experience is what you get when you don’t get what you want
Forse questo potrebbe fare al caso tuo (utilizza i thread):
Esempio di utilizzo:codice:import threading class Timer: def __init__(self): wait_for = 4 self.timer = threading.Timer(wait_for, self.timeout) def start(self): self.timer.start() def stop(self): self.timer.cancel() def timeout(self): # global_lock.acquire() print "timeout" # global_lock.release()
Saluticodice:>>> t = Timer() >>> t.start() timeout >>> t = Timer() >>> t.start() >>> t.stop() >>>
Rilasciata Python FTP Server library 0.5.1
http://code.google.com/p/pyftpdlib/
We'll be those who'll make the italian folks know how difficult can be defecating in Southern California without having the crap flying all around the house.