gpt4 book ai didi

python - subprocces.call 语法错误python

转载 作者:太空宇宙 更新时间:2023-11-04 05:10:49 25 4
gpt4 key购买 nike

尝试使用带有 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com