As we have already installed required python version and set up in our machine
Now we are here to learn first some basic concepts about python program
you can write your small code on idle terminal and press enter to execute
Example:
print("I am from terminal ")you can use python idle terminal as calculator Example:
>5+6-7and press enter to execute you will get final result in next line
>4- After opening of idle terminal just press Ctrl+n to open a notepad like python text editor.
- And write required code inside editor.
- Now save that file as your required name with extension.py
Example:
filename.py
There are 2 way to run python file
- Normal
- Open Python file in python IDLE.
- Now just press f5 or go to run menu option and select run to execute the python file.
- Now result will displayed on your python Shell.
- Using Terminal
- Open command prompt or terminal in your shell.
- Go to directory copy path and in command prompt and change command prompt derectory using following command.
>cd "directory path"- after changing directory just type
dir>python filename.py- Now your required result will be displayed on command prompt
- if "python command is not recognized" occured
Solution:
for more Tutorial about how to add path to enviornment variable follow this Tutorial
- Add your python installed path to enviornment variable. - And Also Add python/scripts path to enviornment variable.