How do we make python scripts executable?



How do we make python scripts executable?..

Answer / 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

More Python Interview Questions

How to remove whitespaces from a string in python?

0 Answers  


What is the difference between repr and str in python?

0 Answers  


Can we override a constructor?

0 Answers  


Name a few methods for matching and searching the occurrences of a pattern in a given text string?

0 Answers  


How can you pick a random item from a list or tuple in python?

0 Answers  






Explain important characteristics of python objects?

0 Answers  


Explain Inheritance in Python?

0 Answers  


How does python handle memory management?

0 Answers  


Why python is popular nowadays?

0 Answers  


How do you sort a list in reverse order in python?

0 Answers  


Tell me what are the built-in type does python provides?

0 Answers  


What are all the operating system that python can run on?

0 Answers  


Categories