{"id":573,"date":"2011-04-02T17:11:34","date_gmt":"2011-04-02T16:11:34","guid":{"rendered":"https:\/\/www.hutsky.cz\/blog\/?p=573"},"modified":"2013-12-30T13:11:57","modified_gmt":"2013-12-30T12:11:57","slug":"python-os-sytem-and-windows-program-files-directory","status":"publish","type":"post","link":"https:\/\/www.hutsky.cz\/blog\/2011\/04\/python-os-sytem-and-windows-program-files-directory\/","title":{"rendered":"Python os.sytem() and Windows Program Files directory"},"content":{"rendered":"<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-thumbnail wp-image-582\" title=\"python_logo\" alt=\"\" src=\"https:\/\/www.hutsky.cz\/blog\/wp-content\/uploads\/python_logo-150x150.png\" width=\"150\" height=\"150\" srcset=\"https:\/\/www.hutsky.cz\/blog\/wp-content\/uploads\/python_logo-150x150.png 150w, https:\/\/www.hutsky.cz\/blog\/wp-content\/uploads\/python_logo.png 280w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>I ran across a problem when trying to run a program located in &#8220;Program Files&#8221; directory from within a Python application using os.system(). It was obvious that the problem was caused by the space character in the name of the directory. I didn&#8217;t know how to solve the issue as I&#8217;m not proficient in Python and also not very comfortable in the Windows environment. Luckily, once again, there were others before me, who had found the way:<\/p>\n<pre> os.system( '\"\"C:\\\\\\\\Program Files\\\\\\\\WinProgram\\\\\\\\PROGRAM.EXE\" -params \"')<\/pre>\n<p>Adding an extra pair of qotation marks did the trick.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran across a problem when trying to run a program located in &#8220;Program Files&#8221; directory from within a Python application using os.system(). It was obvious that the problem was caused by the space character in the name of the &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.hutsky.cz\/blog\/2011\/04\/python-os-sytem-and-windows-program-files-directory\/\"> <span class=\"screen-reader-text\">Python os.sytem() and Windows Program Files directory<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,32],"tags":[26,27],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-operatingsystems","category-programming","tag-python","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/comments?post=573"}],"version-history":[{"count":9,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/573\/revisions"}],"predecessor-version":[{"id":953,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/posts\/573\/revisions\/953"}],"wp:attachment":[{"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/media?parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/categories?post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hutsky.cz\/blog\/wp-json\/wp\/v2\/tags?post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}