os.system file names with spaces

Question:

Here is my python code (I am on Mac osx)

os.system("open Applications/Google Chrome")

I cannot figure out how to make spaces, or how to make this work.
Can someone tell me how to make terminal understand this?

Asked By: zonellobster

||

Answers:

You need to add quotation marks around the file path, so it can understand that it is one argument:

os.system('open "Applications/Google Chrome"')
Answered By: Xiddoc