Why You Should Choose Python [and installation]
#1 from the Python for Beginners series
Why Python, and an introduction to the 'Python for Beginners' series
I will go over why it is wise to choose Python, why I chose it, what you can do with it, and a small introduction to some low-level basics of Python/programming/and installation.
Why I personally chose Python
Many people ask, how do you choose one over the other? Why not JavaScript, C#, Go, etc. ? I had used JavaScript back a long time ago in my early web dev days. I wouldn't say I liked using it at all (NOTE: my opinions have since changed). I did a run-through with JavaScript a little earlier in 2021. It was much more tolerable, dare I say slightly enjoyable, so I picked up Python after I did a little studying over the different languages and looking at the syntax of all of them.
What is Python good for?
- Python is a more moderate ease into programming for newcomers; it is quicker to grasp and closer to our natural language. You can develop things quicker than other languages as it generally takes less code to do what you are trying to accomplish. (Don't @ me, nerds).
- There are thousands of libraries and tons of frameworks to use in applications.
- It excels at working with data. As our society increases in size and as technology increases, big data becomes more critical, and someone will need to parse that data.
- Great in data science. By running a simple import of Numpy and Pandas, you can do some incredible things, throw the third import of Matplotlib or other data visualization library, and you will have an arsenal of tools at hand to tackle any data thrown at you.
- AI and ML. What I am learning currently. Using tools like Scikit Learn, Tensor Flow, and Keras, you can make predictive models that find patterns that you may or may not see or catch.
- Web development, with Django (my personal favorite) or other frameworks, you can build websites to make applications to carry out your bidding. Python can do a lot, whether it be a simple website with a blog or a feature-laden application that runs a statistical analysis of .csv files that you import.
- Desktop applications with Kivy, TKinter, or PyQT.
- Very readable code. Most of the code that you will be writing should be readable. When you take the complexity (as much as possible) out of the code, you generally have something easier to read, and people you work with who have to go over it will hate you less. Python helps with this, but you will still need to make your code as readable as possible.
- It is one of the most in-demand programming languages, not to mention a high salary language.
So, Python can do just about anything; from scraping the web, automation, you name it.
As you can tell, I am a BIG advocate for using Python, but some things are best left to other languages. Game dev, for example, in my opinion, leave it to other languages to handle, but hey, if you want to, there is no reason you can't. To my knowledge, there are things like PyGame, Kivy, Pyglet, and a few more. I am not versed in game development other than using Unity, but that is with C#.
What does commenting on your code mean, and how do you do it?
Comments are essential while you are writing your code. You don't need to comment on everything; that is ridiculous (take variables or the like. We will go over what that is later). It is good to make sure that you start commenting as you begin to learn to get in a good habit of it. When we get to functions and classes, I will go over them more in-depth.
What is PIP?
PIP is a package manager for Python. We can install libraries and other things that are not installed with Python during your install.
What is IDLE?
IDLE is a Python distributed development environment. Without the possible confusing terminology, you write code in it and, it 'does the things'.
What are libraries?
I bet you are wondering what a library is. Simply put, a library is some code that someone else wrote that you could simply import and use the code's functionality inside yours. Nice right? Thank you, Python nerds; we really appreciate your contributions.
What are frameworks?
Frameworks are packages that allow developers to create programs without having to deal with writing the more tedious code; it just gets you to writing the fun stuff. For instance, in the web framework Django, using databases are a complete breeze, with less setup, less time.
Installing Python and your IDE
Installing Python is pretty straight forward and simple.
Download
Just click here and have at it.
Click on that nifty download button.
You will see 'Download Python 3.9.6 (version may vary when you are reading this)'.
Go ahead and click that button and download that somewhere you can find it easily. On your install, make sure that you click the option 'Add Python 3.9 to PATH', and install Python.
Easy.Peasy.Serpent.Squeezy.
IDE
An IDE is short for Integrated Development Environment, and there are a lot of them from which to choose. For Python, I like to use PyCharm, but there are other IDE's such as Visual Studio Code, Sublime, Atom, Spyder, and many others. During this series, I will only be using PyCharm, but feel free to use any of them you like.
List of IDE's
Here are the links for the IDE's that I was referencing:
jetbrains.com/pycharm make sure you get the community version. If you are just now learning, there is no reason to pay for the IDE yet.
code.visualstudio.com You will need to install the Python extension for it through the extension marketplace, but that is easy to do. Here is a link on how to do that: code.visualstudio.com/docs/python/python-tu... You basically click the bottom icon here: and search for it. Note, pylance is also quite handy as well
If you have problems, post a comment below, and I can help you out with that.
anaconda.com The Anaconda distribution will give you Jupyter notebooks, which work well for things you need to edit and change things, much like data science. To run Jupyter notebooks (or type 'jupyter lab'), you can run Anaconda Powershell Prompt.
Again, if you need help, just make a comment and I will assist you (maybe even expound on it in the post).
Conclusion
That is all for this post. Since you have the installation of Python and your IDE installed, we can start going over the basics of Python and start crafting up scripts in no time! Do you have something specific that you would like to build with Python? Leave a comment and let me know; maybe I will write up a blog post on how to do it!