【发布时间】:2014-11-21 13:15:16
【问题描述】:
subprocess.call("exit 1", shell=True)
AttributeError: 'module' object has no attribute 'call',
这是我在 Linux 中编译时收到的错误, 这是源代码:
import subprocess
import sys
import random
import os
subprocess.call("exit 1", shell=True)
【问题讨论】:
-
也许你命名了你的一个模块(或者可能是当前模块)
subprocess.py。尝试打印subprocess.__file__。
标签: python linux subprocess