gpt4 book ai didi

python - 运行 python 脚本时出错 - 语法无效

转载 作者:行者123 更新时间:2023-12-01 04:45:07 32 4
gpt4 key购买 nike

运行 python 脚本时我不断收到此错误

sudo python net-creds.py
File "net-creds.py", line 75
ipr = Popen([‘/usr/local/bin/ip’, 'route'], stdout=PIPE, stderr=DN)
^
SyntaxError: invalid syntax

最佳答案

您正在使用“`”而不是'。所以试试这个

ipr = Popen(['/usr/local/bin/ip', 'route'], stdout=PIPE, stderr=DN)

关于python - 运行 python 脚本时出错 - 语法无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29635189/

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