Python Tutorials
Python File Handling
Python Modules
Most PCs and Macs will have python already installed.
To check if you have Python installed on Windows PC, search the first Python bar or use the following in Command Line (cmd.exe):
C:\Users\Your Name>python --version
To check if you have python installed on Linux or Mac, then in linux open the command line or on Mac open Terminal and type:
python --version
If you find that you do not have Python installed on your computer, you can download it for free from the following website: https://www.python.org/
Python is a interpreted programming language, which means that as a developer you write Python files (.py) to the text editor and place those files in a python translator for use.
How to use a python file is similar to the command line:
C:\Users\Your Name>python helloworld.py
Where "helloworld.py" is the name of your python file.
Let's write our first Python file, called helloworld.py, which can be created in any text editor.
print("Hello, World!")
It's that simple. Save your file. Open your command line, navigate to the directory where you saved your file, and run:
C:\Users\Your Name>python helloworld.py
Output should read:
Hello, World!
Congratulations, write and make your first Python program.
Checking a short code code in a python is sometimes quick and easy without encrypting. This is made possible because Python can be run as a command line itself.
Type the following into the Windows, Mac or Linux command line:
C:\Users\Your Name>python
Or, if the "python" command does not work, you can try "py":
C:\Users\Your Name>py
From there you can write any anaconda, including our worldview from the beginning of the lesson:
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!")
Which will write "Hello, Earth!" command line:
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!
Whenever you are done with the python command line, you can simply type the following to leave the python command line interface:
exit()