{"id":2754,"date":"2023-10-16T17:10:01","date_gmt":"2023-10-16T11:40:01","guid":{"rendered":"https:\/\/python-programs.com\/?p=2754"},"modified":"2023-11-10T11:42:37","modified_gmt":"2023-11-10T06:12:37","slug":"introduction-to-python-executing-python-script","status":"publish","type":"post","link":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/","title":{"rendered":"Introduction to Python \u2013 Executing Python Script"},"content":{"rendered":"

In this Page, We are Providing Introduction to Python \u2013 Executing Python Script. Students can visit for more Detail and Explanation of Python Handwritten Notes<\/a> Pdf.<\/p>\n

Introduction to Python \u2013 Executing Python Script<\/h2>\n

Executing Python script<\/strong><\/p>\n

As discussed in the previous section, the Python script can be executed using the F5 functional key, from Python’s IDE. It can also be executed using a command prompt by typing the following command:<\/p>\n

$ python <filename><\/pre>\n

On different platforms, the execution of Python scripts (apart from running from inside Python’s IDE) can be carried out as follows:<\/p>\n

Linux<\/strong><\/p>\n

On Unix\/Linux system, Python script can be made directly executable, like shell scripts, by including the following expression as the first line of the script (assuming that the interpreter is on the user’s PATH) and giving the file an executable mode.<\/p>\n

#! \/usr\/bin\/env python<\/pre>\n

The ‘# !’ must be the first two characters of the file. Note that the hash or pound character ‘#’ is used to start a comment in Python. The script can be given an executable mode\/permission, using the chmod command:<\/p>\n

$ chmod + x HelloWorld.py<\/pre>\n

Windows<\/strong><\/p>\n

On the Windows system, the Python installer automatically associates .py files with python.exe, so that double-click on a Python file will run it as a script. The extension can also be .pyw, in that case, the console window that normally appears is suppressed. At MS-DOS prompt, the Python script can be executed by going to the directory containing the script and just entering the script name (with extension).<\/p>\n","protected":false},"excerpt":{"rendered":"

In this Page, We are Providing Introduction to Python \u2013 Executing Python Script. Students can visit for more Detail and Explanation of Python Handwritten Notes Pdf. Introduction to Python \u2013 Executing Python Script Executing Python script As discussed in the previous section, the Python script can be executed using the F5 functional key, from Python’s …<\/p>\n

Introduction to Python \u2013 Executing Python Script<\/span> Read More »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nIntroduction to Python \u2013 Executing Python Script - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to Python \u2013 Executing Python Script - Python Programs\" \/>\n<meta property=\"og:description\" content=\"In this Page, We are Providing Introduction to Python \u2013 Executing Python Script. Students can visit for more Detail and Explanation of Python Handwritten Notes Pdf. Introduction to Python \u2013 Executing Python Script Executing Python script As discussed in the previous section, the Python script can be executed using the F5 functional key, from Python’s … Introduction to Python \u2013 Executing Python Script Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-16T11:40:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-10T06:12:37+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage\",\"url\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/\",\"name\":\"Introduction to Python \u2013 Executing Python Script - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"datePublished\":\"2023-10-16T11:40:01+00:00\",\"dateModified\":\"2023-11-10T06:12:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to Python \u2013 Executing Python Script\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\"},\"headline\":\"Introduction to Python \u2013 Executing Python Script\",\"datePublished\":\"2023-10-16T11:40:01+00:00\",\"dateModified\":\"2023-11-10T06:12:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage\"},\"wordCount\":250,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/python-programs.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to Python \u2013 Executing Python Script - Python Programs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to Python \u2013 Executing Python Script - Python Programs","og_description":"In this Page, We are Providing Introduction to Python \u2013 Executing Python Script. Students can visit for more Detail and Explanation of Python Handwritten Notes Pdf. Introduction to Python \u2013 Executing Python Script Executing Python script As discussed in the previous section, the Python script can be executed using the F5 functional key, from Python’s … Introduction to Python \u2013 Executing Python Script Read More »","og_url":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2023-10-16T11:40:01+00:00","article_modified_time":"2023-11-10T06:12:37+00:00","twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Prasanna","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage","url":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/","name":"Introduction to Python \u2013 Executing Python Script - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"datePublished":"2023-10-16T11:40:01+00:00","dateModified":"2023-11-10T06:12:37+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Introduction to Python \u2013 Executing Python Script"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb"},"headline":"Introduction to Python \u2013 Executing Python Script","datePublished":"2023-10-16T11:40:01+00:00","dateModified":"2023-11-10T06:12:37+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#webpage"},"wordCount":250,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/introduction-to-python-executing-python-script\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb","name":"Prasanna","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/python-programs.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/2754"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=2754"}],"version-history":[{"count":1,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/2754\/revisions"}],"predecessor-version":[{"id":2757,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/2754\/revisions\/2757"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=2754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=2754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=2754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}