I need to open a file, found at C:/Users/HP Gold/Documents/My Program/Folder/Items.csv, in the default Windows application, which is for me, Libreoffice. I use the following command which I found on the web:
os.system("start " + directory+"/Items.csv")
However, I am getting an error when the line is run:
"Windows cannot find the file "C:/Users/HP". Make sure you've typed the name correctly, then try again."
What must I do because this is obviously (I think) a problem with the segment "HP Gold" having a space.
"around the directory:os.system('start "' + directory + '/Items.csv"')os.startfile(directory + '/Items.csv')stackoverflow.com/questions/18173965/…os.startfile. But FYI the issue with quoting is that CMD'sstartcommand consumes the first quoted string as the window title, so it should be used asstart "title" "command line to run". The title can be an empty string.