How to work with Python?
Before we start this topic, we need to know how to install python software in your PC first. Here are some ways to get python software in your pc or system so that you can perform program practically and view the output and see how the compiler and interpreter works.
How to install Python (CPython)
It is the default way to get python software. As it is a free and open-source software you can able to download it by simply going to its official website i.e., www.python.org and it is called CPython installation.
This comes with Python interpreter, Python IDLE (Python GUI) and Pip (package installer).
1. Anaconda Python installation
- It is the next one that is used to write python code you need to know how to install python anaconda version.
- Anaconda is a package manager, an environment manager, and Python distribution that contains a collection of many open-source packages.
- This is advantageous as when you are working on a data science project, you will find that you need many different packages (NumPy, scikit-learn, SciPy, pandas to name a few), which an installation of Anaconda comes preinstalled with.
- If you need additional packages after installing Anaconda, you can use Anaconda’s package manager, Conda, or pip to install those packages.
- This is highly advantageous as you don’t have to manage dependencies between multiple packages yourself.
- You can download by clicking here
2. PyCharm IDE
- It is another popular python development environment.
- It is a fact that it comes in in the top 5 python development IDEs recommended by Data Camp other than SPYDER IDE.
- You can download by clicking here
Working with Interactive mode (Python IDE)
- Interactive mode of working means you type the command – one command at a time, and the Python execute it there only and shows the output.
- In this mode you type the command in front of python prompt >>>
- Here are the steps for using interactive mode in python:
- Click on your windows key and search for python IDE.
Working with Script mode (Python IDLE)
- Interactive mode does not save the commands entered by the user in the form of a program.
- In this mode of python, the user can able to write all its commands in the form of program file and the user see’s the output of all the lines in a single command.
- After executing the program, the user can able to see the output in the interactive mode.
- Here are the steps for using script mode in python:
- Open the python interactive mode of python of simply open the python IDE.
- Then go to file and click on new window.
- write the code.
- Save the file.
- Then you can use the F5 key to execute the program.
Interpreter vs Compilation
|Helps to convert high level language (HLL) to machine language by converting.
|Converts the high-level language (HLL) to machine level language but in a different manner.
|Execute it in line-by-line manner.
|It converts the entire HLL in a single go and report if there is any error or not.
|Any error is found in any line then it immediately stops the execution the program and it also report it to the user at the same time.
|If error found then the program stop execution and it will report all the errors to the user at the same time.
|Once the error got removed, unnecessary usage of memory takes place, and it has to be present in the memory always.
|After all the errors get removed, the program will be recompiled, and after that the complier is not need in the memory as the object program is available.
NOTE : –
Learn Python Programming from Basics– Click here
Python Fundamental – Click here
5 Tips to Learn python Faster – Click here