Python is a programming language that has been around since 1989 but has recently become even more popular because of an increase in the use of bots, the popularity of data science and the benefits of using application programming interfaces (APIs) for technology not previously associated with automation, such as Cisco routers.
Regardless of your programming experience, Python is a great skill to add to your portfolio if simplifying workflow processes is an important initiative within your organization.
Mobile apps, networking automation tools, DevOps automation, data analysis and web apps are just a few examples of applications that can be built using Python. However, once you learn the basics, the possibilities are endless — as Python’s website promises: “You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.”
Python Use Is Growing
According to Stack Overflow, there’s been considerable growth in the number of questions users ask about Python on the developer Q&A website. By comparison, most languages have remained constant or even seen a downturn in questions asked. While these trends do not necessarily prove Python is the best programming language choice, it at least points to a large contingency of people who are learning and/or using the language, which boosts the odds of finding assistance, should any issues arise as you work with it.
SOURCE: Stack Overflow
Within CDW alone, the Python community has grown exponentially over the past few years. Our engineers have built Python applications to collect Cisco phone information, migrate phones, provide collaboration data analysis, automate deployments to the cloud and simulate phone call load tests, in addition to other use cases.
The Benefits of Python
Python has become the go-to language of choice for people who are not interested in becoming a programmer but would like to increase productivity or improve a workflow process without a large learning curve. Even though Python is a great language for beginners, it is also powerful enough for programming experts.
Some other key benefits of Python include:
- Emphasizes readability and simplicity
- Portability across various operating systems, including Linux, Mac and Windows
- A growing community of users who are willing to assist others
- Many free online training tutorials, such as learnpython.org and DataCamp
- An extensive amount of example source code on websites such as GitHub and Stack Overflow
- Versatility — there are more than 120,000 Python libraries to aid development
Python Resources by Platform
There are many excellent online resources to get you started with programming in Python. For simplicity’s sake, the Python Wiki site is a good guide for beginners. It contains many useful links to sites such as Codecademy.
While Python files can be edited using any text editor, it is highly recommended to utilize an integrated development environment. An IDE provides syntax checking, code completion, debuggers, access to source code control and many other features. Whether you use Mac, Windows or some other platform, there is probably a Python version and IDE application available to suit your needs.
Here are links to the download pages by platform and a link to a list of popular IDEs:
- Python download for Windows
- Python download for Mac OS
- Python download for other platforms
- List of IDEs
Installing Python is straightforward, but some platforms such as Linux or Mac come preinstalled with Python; therefore, it is best to read up on the process. Here are links to installation information for the various platforms:
When it comes to IDEs, most Python programmers in our organization (including myself) prefer PyCharm: It comes in a few different versions including a free Community edition, and an EDU version that provides guidelines for beginners.
PyCharm and other IDEs will flag syntax and coding errors to assist with programming the “Pythonic” way. Most IDEs have free versions or trial periods, therefore give a few of them a try to find out which one works best for you.
How to Start Using Python
If you’re interested in picking up Python as a skill, the best way to learn is to implement something that is useful to you. Think of a use case that could benefit from a Python application. Perhaps you wish to automate the reporting of information on a stock. This can be achieved easily in Python.
For example, here is a simple script contained in a file named ‘stock-info.py’ and developed in PyCharm using the built-in Python libraries urllib.request and json that retrieves stock information from an API courtesy of IEX:
The output of executing this script is shown below. First, it prints all data returned from the IEX API for the chosen symbol in JSON format, and then it prints just the recent closing price:
I won’t go into it here, but this script could next be set up as a job that executes daily to email the pertinent data, or a bot can be built to send the data to a collaboration platform automatically — whichever communication method you prefer more than likely has some Python code examples on the web.
Python: The Integration Engine
APIs are a very powerful resource to utilize for automation, business process improvements, integrations and more. Data analytics is an important aspect of any business process. Python is a great language to learn for these and many other purposes. With an extensive sampling of source code, thousands of add-on libraries and a large, growing community, Python has everything you need to build any integration you can imagine. Now is a great time to learn and take advantage of this simple yet powerful programming language.