How do we make python scripts executable?

Answer Posted / chaitanya

Python scripts can be executed in two ways:

Suppose I want to execute script1.py

We can open the script1.py in IDE editor & run the script in the frontmost window of the python IDE by hitting the run all button.

Second way is using command prompt by making sure PATH is set appropriately directly type script name else type

>>>python script1.py

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get a list of class attributes in python?

497


What is map and filter in python?

447


Are lambda functions faster python?

469


What is memory management in python?

442


Explain the shortest way to open a text file and display its contents?

472






What does the term ‘monkey patching’ refers to in python?

456


What do you understand by the term deep copy?

443


What are the tools that help to find bugs or perform static analysis?

472


how do you reverse a list in python?

487


Why python language is called python?

425


How will you share global variables across modules?

478


What do you think is the output of the following code fragment?

498


Is print a function in python?

461


How manages to python handle memory management?

464


What is super () in python?

451