ich bin der neue guten tag
hab hier ein kurioses problem.
eben habe ich ein scipt das ich die ganze zeit immer in die shell kopiert habe mit einem if __name__=="__main__": ausgestettet um es direkt starten zu können.
jetzt gibt das programm strings aus die in viel früheren versionen benutzt wurden. habe dann nach und nach einiges weggelöscht und:
es reicht ein import von Queue oder threading um diese strings auszugeben!
Code: Alles auswählen
C:\python>python xxx.py
Source No1 waiting for data to send!
Source No2 waiting for data to send!
Traceback (most recent call last):
File "xxx.py", line 6, in <module>
ack = Queue.Queue(1)
File "c:\python25\lib\Queue.py", line 31, in __init__
self.mutex = threading.Lock()
AttributeError: 'module' object has no attribute 'Lock'
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
C:\python>type xxx.py
import Queue
if __name__=="__main__":
ack = Queue.Queue(1)
oder hier eine andere version:
Code: Alles auswählen
C:\python>python xxx.py
Source No1 waiting for data to send!
hello world
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
C:\python>type xxx.py
import threading
if __name__=="__main__":
print "hello world"
fällt dazu jemand was ein?