question about plugin

  • hi


    i make plugin and i wan't to use thread


    i do from threading import *


    for example


    class Affiche(threading.Thread):
    def __init__(self, nom = ''):
    threading.Thread.__init__(self)
    self.nom = nom
    self.Terminated = False
    def run(self):
    i = 0
    while not self.Terminated:
    print self.nom, i
    i += 1
    time.sleep(2.0)
    print "le thread "+self.nom +" s'est termine proprement"
    def stop(self):
    self.Terminated = True


    a = Affiche('Thread A')
    a.start()


    when i do that error threading is not defined


    Help me please


    thanks

  • I have something similar in a UDP-Listener plugin running:


    Good luck!

    MfG Ali

    DM8000 | DM8000 | DM500HD | DM500HD | DM7020S


    Bash
    #!/bin/sh
    while [ 1 ]
    do
    	echo "i love my dreams!!!"
    	sleep 1
    done
  • lot of thanks i see that


    i wan't start the thread but with a different value


    with


    for ligne in self
    ligne=thread(ligne)
    ligne.start()


    and i wan't the script run all ligne in the same time


    you know how can i do


    thanks

    Einmal editiert, zuletzt von fennec ()