ソースは次のとおりです。
#one.py:
from Queue import Queue
req = Queue()
#two.py:
import one
import time
if __name__ == '__main__':
while True:
print "this is two.py and reqID is ",id(one.req)
print "Queue size is %s"%one.req.qsize()
time.sleep(5)
#three.py:
import one
import time
if __name__ == '__main__':
while True:
print "this is three.py and reqID is ",id(one.req)
print "Queue size is %s"%one.req.qsize()
one.req.put(2)
time.sleep(5)
one.py
共通のキューがあります。の共通キューを使用two.py
しthree.py
て制御したい。one.py