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

Python ­ How to create a multidimensional list?

721


What is the mro in python?

713


In python, how do I read a file line-by-line into a list?

622


Is python strongly typed?

632


Is there polymorphism in python?

628


What is list comprehension how to define it and when to use?

631


What is the use of break statement?

638


Explain about default database with python?

609


What should I learn in python?

591


What is __ getitem __?

587


Why lambda forms in python does not have statements?

722


Is Django written in Python?

685


What are tuples and relation?

586


Which is fastest implementation of python?

657


Does python support inheritance?

640