Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (50.2k points)
Can anyone tell me how to run Python script in Linux?

1 Answer

0 votes
by (108k points)

After writing the code in Python, you have to save your file in the .py format.

Now, you have to open the terminal by pressing Ctrl+Alt+T.

After that, you can navigate the terminal to the directory where the .py file is located using the following:

cd path_of_the_file

After setting the path, in the terminal, you can write the following to execute the script:


If your script is written in Python3, then you should write:


If you are looking for an online course to learn Python, I recommend this Python Course by Intellipaat.

Related questions

+5 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories