尝试使用带有 subprocess.call
的 python 运行命令,但出现语法错误
#Takes cipher and password, executes openssl command in console
def decrypt(cipher, password):
try:
print 'Attempting decryption ---> Cipher: ' +cipher+ ' Password: ' + password
call(['openssl', 'enc', '-d', cipher, '/media/"username"/Data Drive/Documents/Project mangement/forensics/images/19_1.enc','-out', 'decrypted.dat' '-k', password])
except Error as e:
print e
Traceback (most recent call last):
File "/media/"username"/Data Drive/Downloads/bruteforce(2).py", line 9, in <module>
import call
File "/home/"username"/.local/lib/python2.7/site-packages/call/__init__.py", line 37
class _PythonCall(metaclass=ABCMeta):
^
SyntaxError: invalid syntax
最佳答案
使用: 来自子流程导入调用
代替: 导入调用
关于python - subprocces.call 语法错误python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43055708/