标签: python path os.system
我想为os.system命令解析以下路径
from pathlib import Path import os path = Path().cwd() # Prints something like /Users/myname/path with spaces/file.txt os.system(f"./out -i {path}") # Error
到目前为止,我已经尝试过replace(' ', '\ ')和replace(' ', '\\ '),但似乎都没有作用
replace(' ', '\ ')
replace(' ', '\\ ')