from threading import Threaddef test1(a): while 1: print adef test2(a): a["a"] = 2if __name__ == "__main__": a = {"a": 1} t1 = Thread(target=test1, args=(a, )) t1.start() t2 = Thread(target=test2, args=(a, )) t2.start()
Copyright © 2024 Great-great Powered by .NET 9.0 on Kubernetes