{"id":4739,"date":"2024-10-24T19:44:51","date_gmt":"2024-10-24T18:44:51","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4739"},"modified":"2024-10-24T19:45:34","modified_gmt":"2024-10-24T18:45:34","slug":"detect-windows-vs-linux","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/application-control\/detect-windows-vs-linux","title":{"rendered":"Detect Windows vs Linux"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Detecting Windows or Linux in code<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\n\nif os.name == 'nt':\n    #Windows\n    pass\nelse:\n    #Linux\n    pass<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Import<\/h4>\n\n\n\n<p>You can use the same if statement for import etc:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nif os.name == 'nt':\n    #Windows\n    import something_windows_based\nelse:\n    #Linux\n    import something_linux_based<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Detecting Windows or Linux in code Import You can use the same if statement for import etc:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[345],"tags":[],"class_list":["post-4739","post","type-post","status-publish","format-standard","hentry","category-application-control"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4739"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4739\/revisions"}],"predecessor-version":[{"id":4741,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4739\/revisions\/4741"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}