我一直试图让这个简单的url调用Linux命令作为python脚本运行。但是,对于system()模块中太多的参数,我总是会得到一个错误。是否仍然可以很容易地使用此技术进行修复?
import sys
import os
g = str(input('enter search '))
os.system('xdg-open https://',g)发布于 2022-07-08 16:46:07
将命令格式化为单个字符串,而不是2个参数
import sys
import os
search = str(input('enter search'))
os.system(f'xdg-open https://{search}')https://stackoverflow.com/questions/72914490
复制相似问题