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

Explain how python is interpreted.

1 Answers  


Explain how to redirect the output of a python script from standout(ie., A monitor) on to a file?

0 Answers  


Which is best framework for python?

0 Answers  


What does static pressure mean?

0 Answers  


Explain what is a flask? What are its benefits?

0 Answers  






Explain static class variables in python?

0 Answers  


Differentiate between Pyramid, Django, and Flask

2 Answers  


Does python support interfaces like java does?

0 Answers  


What are attributes and methods in a python class?

0 Answers  


Explain help() and dir() functions in python?

0 Answers  


Do you know what are the optional statements that can be used inside a <try-except> block in python?

0 Answers  


What is the dictionary?

0 Answers  


Categories