>
>  * usare un .lock file, ovvero fare in modo che la applicazione crei un
> un file temporaneo quando si avvia e che lo distrugga quando termina. 
> Per esempio, firefox usa (o usava) questo sistema.

Es:
import fcntl
fk=open(lock_path,"w")
try:
    fcntl.flock(fk,fcntl.LOCK_EX + fcntl.LOCK_NB)  ## lock non bloccante
    ### FAI QUELLO CHE DEVI !!
except:
    ### ESCI ###

Dove lock_path è in path assoluto del file che usi come lock.

_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a