Welp,我需要从python中删除一些巨大的临时目录,我似乎无法使用rm -r。我工作时认为是一个大数据集(在s3上),我没有光盘空间让他们离开。无法rm -r目录使用python subprocess.call
的常用方法我会从蟒蛇调用命令
import subprocess
subprocess.call('rm','-r','/home/nathan/emptytest')
这给了我
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 629, in __init__
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
这是什么一回事呢?
可能重复的[调用PHP脚本从Python(子进程)](http://stackoverflow.com/questions/11780958/call- php-script-from-python-subprocess) – geoffspear 2012-08-09 23:46:28