Python is a staple found frequently on most Linux systems, including a Raspberry Pi. It comes installed by default with Raspberry Pi OS, as many programs and applications commonly rely on it, since they are programmed in the Python language. The version of Python will determine which features it comes with, as the developers are always adding new features and patches to it.
Jupyter Notebook is a web application used to produce computational documents, commonly called “notebooks” which can contain human-readable text, executable code, charts, and more. When used together with Python and libraries like pandas and Matplotlib, Jupyter notebooks are an excellent tool we can use for presentations and data analysis.
If you are familiar with Python, you surely used pip: the Python package installer. With pip, we can install packages “globally” or in virtual environments. Virtual environments are mainly used to install dependencies of specific projects, so to develop them in isolation. We usually install packages, “globally”, instead, when want to access the utilities they provide from anywhere. By using pipx we can get the best of both approaches: we can install each application in its own virtual environment, and, at the same time, access it globally.
Pandas is a free and open source Python library released under the BSD license. Originally developed by Wes McKinney in 2008, and supported by companies like Intel and Nvidia, it is targeted at data analysis and manipulation. It can be easily used to read and write data from a variety of sources such as Excel spreadsheets, Comma-separated Values (CSV) files, and many more.
PyCharm is a graphical IDE (integrated development environment) that can be installed on Ubuntu Desktop. Many Python programmers enjoy using PyCharm because it can be used to analyze code, debug programs, and is integrated with Git and other version control systems, as well as web development applications. PyCharm is developed by JetBrains. It is free and open source, or at least the community edition is.
Your Debian Linux installation may include multiple Python versions and thus also include multiple Python binary executables, and it’s possible to change the python version that the system is using. In this tutorial, you will see how to install multiple versions of python, and change the python version on Debian using the
update-alternatives python command. This will allow you to run various Python programs including legacy scripts. Check the sections below to learn how.
Ansible is a free and open source provisioning system written in Python and sponsored by Red Hat. In previous tutorials we learned the Ansible basics, and we saw how to organize tasks in playbooks and how to secure sensitive data using ansible-vault. There is another, very important concept we need to focus on when dealing with Ansible: roles.
Python is a popular programming language used in a wide range of applications, from data analysis and scientific computing to web development and artificial intelligence. Bash is a powerful scripting language used primarily in Unix and Linux environments for automating tasks and running commands. By combining the two languages, developers can create powerful scripts that can automate complex tasks and workflows. In this article, we’ll explore various techniques for running Python scripts with bash, including passing arguments, activating virtual environments, and running scripts in the background. We’ll also provide examples of real-world scripts that demonstrate these techniques in action.
Apache, MySQL, and Python can be used in tandem to host and serve a website from a Linux system. This assortment of software is known as a LAMP stack (Linux, Apache, MySQL, Python) although sometimes the ‘P’ means PHP, which can either be used in addition to or as a replacement of Python. Apache serves the website, MySQL stores and retrieves information from a database, and Python can generate HTML and related code for the site’s visitors to view.
In the fast-paced world of technology, automating routine tasks can be the key to increased efficiency and productivity. Linux systems are no exception, and there are a variety of automation tools and techniques available to help streamline administration and management tasks. This article provides a comprehensive introduction to Linux automation tools and techniques, discussing the benefits of automation, the different types of tools available, and how to get started with automating your Linux workflow. Whether you’re a seasoned Linux administrator or just getting started, this article will provide you with the information and guidance you need to take your skills to the next level.
When programming in Python, escape characters can be used in order to tell the compiler that it should treat the next character or characters differently. For example, we can tell Python to print a quote
" as an actual quote character, rather than interpreting it to be part of the Python code. Other special characters like
\t can create TAB spaces, and
\n can create new lines. In this tutorial, you will see a list of Python escape sequence characters and examples that you can use on a Linux system.
Nautilus, also known as “Files”, is the default file manager of the GNOME desktop environment. In a previous tutorial we saw how to create and call custom scripts from the Nautilus context-menu: this feature can be really useful but is somehow limited. By installing the nautilus-python package in our favorite Linux distribution, and writing just few lines of Python code, we can overcome such limitations and create proper Nautilus extensions.