可能我忽略了一些非常基本的东西。我有一个功能
def execution(command):
os.system(command)
还有另一个功能
def start_this_thread():
server_thread = threading.Thread(target=execution, args=(exec_str))
server_thread.start()
我收到一个错误:
self.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 483, in run
self.__target(*self.__args, **self.__kwargs)
TypeError: execution() takes exactly 1 argument (233 given)
显然字符串长度(命令)的长度为 233??