この python ソース コードの何が問題になっていますか?
import threading
import subprocess as sub
def ben(fil):
pr = sub.Popen(fil,stdout=sub.PIPE,stderr=sub.PIPE)
output, errors = pr.communicate()
print output
theapp = '''blender
blender-softwaregl'''.split()
print theapp
for u in theapp:
print u
tr = threading.Thread(target=ben, args=(u))
tr.daemon = True
tr.start()
エラーは次のとおりです。
['blender', 'blender-softwaregl']
blender
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
TypeError: ben() takes exactly 1 argument (7 given)
blender-softwaregl
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
TypeError: ben() takes exactly 1 argument (18 given)
これは私の問題です。このエラーは何ですか?
TypeError: ben() takes exactly 1 argument (18 given)