Happy New Year to all my dear readers. We are in the year 2021 now. This year new resolution is learning technologies without any barriers. As a part of the skill improvement within my organization, our management has decided to get everyone on-board in learning all kinds of technologies that my organization is going to use this year. It is part of our strategies for data digitization and self-servicing. During the long Christmas and New Year holidays, the first step took place when every one of us is given some time off to learn Python, Tableau, Power BI, AWS Glue and Azure.
Get python installed
Today, I will start with Python installation and display “Hello World” on my screen. If you have not installed Python in your machine before, you can head to the python.org website to get Python 3.8.x, or Python 3.9 installed. My machine is using the Windows operating system. You just select the operating systems and head to download the Python and installed in your machine. The download and installation do not take me more than 2 minutes to complete.
get installed with anaconda
Next, I download and install the Anaconda, and the whole process took me less than 2 minutes to complete. You can visit anaconda’s website to get the installer to get it installed. There are two steps, to begin with when we want to set up our machine for Python programming. After installation, you are automatically in the default conda environment with all packages installed. A conda is a package and environment manager.
what is python and anaconda?
You may be wondering why we need Python and Anaconda. What is this Anaconda for? Wiki tells us that Anaconda is a distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), aiming to simplify package management and deployment.
Anaconda helps manage the packages and environments and reduces future issues dealing with various libraries that you will be using it. Anaconda is a distribution of packages built for data science. It comes with conda, a package, and an environment manager. We usually used conda to create environments for isolating our projects that use different versions of Python and/or different version of packages. For example, you want to set up Python 2 and Python 3 environments. You can read for more information about Anaconda from the reference links below.
Before I begin my first Python programming exercise to display the “Hello World”, I choose to use the Anaconda Navigator’s Jupyter Notebook. The Jupyter Notebook is an application that allows me to create documents (notebooks) to code/write Python codes to display input and output from the Python codes. The Jupyter Notebook is widely used for other programming languages too. While I Googled which IDE (integrated development environment) is most used for Python programming, Spyder is another tool to do coding, and I can find it from the Anaconda.
Click on the “Launch” button, my browser launches the localhost (http://localhost:8888/tree), and shows the Jupyter Notebook’s dashboard and my machine’s working directory. In my case, it is C:\Users\<myname>. I need to create a new notebook by clicking the “New” button on the right side of the window. A new window launches, I can see the Jupyter Notebook.
I rename my notebook to “HelloWorld” as below. Then, I started Python programming by writing the first line of codes.
print("Hello World, Happy New Year 2021")
first python code
print() display in the double quotes when I run the selected cell. The number in the bracket after In : stands for the number of commands run. If you keep running the same cell over again, the number will change for that cell. If you switch to another cell and run that cell again, the number will change for that cell.
Alright, I stop here for the first blog entry of my Python programming learning journey. Here, I have covered the following topics:
- Jupyter Notebook
It is not my first time I write about Python programming in my blog. Previously, I installed the Python by using the pip, the package manager. Pip is a tool that allows me to install and manage additional libraries and dependencies. Pip installs Python packages whereas conda installs packages which may contain software written in any languages. You can refer to my entry to share how I updated pip and Python on my Windows machine. Installation using pip completes in Windows command prompt.
In my previous Python posts, I wrote about how I used IntelliJ as the IDE and signed up a course at Udemy to begin my Python learning journey. Here is the link to the Day 1: Let Get Started with Python. If you wish to check out my previous write-ups, please visit this link. Hope you enjoy my sharing, please stay tuned for the next updates. Thank you.