主页
Python
Python shlex 模块
demo_ref_module_shlex_basic
运行 ❯
×
更改方向
保存代码
更改主题
import shlex command = 'python script.py --name "Linus Refsnes" --age 30' tokens = shlex.split(command) print(tokens)
['python', 'script.py', '--name', 'Linus Refsnes', '--age', '30']