0% found this document useful (0 votes)
2 views

About Python Files

To check if Python is installed on Windows, Mac, or Linux, use the command 'python --version' in the command line or terminal. Python code can be written in .py files and executed using 'python filename.py', or run directly in the command line. If the 'python' command does not work, try using 'py' instead.

Uploaded by

vrchaitanya05
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

About Python Files

To check if Python is installed on Windows, Mac, or Linux, use the command 'python --version' in the command line or terminal. Python code can be written in .py files and executed using 'python filename.py', or run directly in the command line. If the 'python' command does not work, try using 'py' instead.

Uploaded by

vrchaitanya05
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

To check whether python is installed in Windows PC,mac or Linux .

C:\Users\Your Name>python --version.

Or

To check if you have python installed on a Linux or Mac, then on linux open the command
line or on Mac open the Terminal and type.

python --version

Need to write the python language in Python (.py) files in a text editor and then put those files
into the python interpreter to be executed.

To run a python file in command Line.

Eg:C:\Users\Your Name>python helloworld.py

Here helloworld is python file.

To write a small code,there is no necessity to write the code in a file,as the Python can be
run as a command line itself.

If python command is not working,instead we can give py.

Eg:C:\Users\Your Name>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello, World!")
Hello, World!

To quit the command line of interface.

exit()

You might also like