Home » Programming

How To Remove Items From A List in Python (With Examples)

python remove items from list

Python is widely used for both scripting and automation on Linux, as well as building web and standalone applications. Python is designed to be easy to learn, easy to write, and easy to read. It’s a great multi-purpose programming language. Python has several different types of arrays for storing data. Lists are arrays which allow you to store items. Items in lists can be altered, and are stored in a specific order. Syntax and Examples There are several methods you can use to remove an … Read more

Home » Programming

How to Make Multiline Comments in Python

How to make multi line comments in Python

In this tutorial, we explain the two methods used to make multiline comments in Python, with examples. There are some drawbacks to one of the methods, so pay attention. Code without comments is like a story written in a language you only half understand. You might be able to figure out the main points, but you’ll miss some nuances and it would be way easier with a translation alongside it. Most coders hate code with no comments or limited comments, so finding ways to clearly … Read more

Home » Programming

Python: How to Check Whether a File or Directory Exists

Python How to check whether a file or directory exists

In this article, we explain how to check whether a file or directory exists in Python and include some useful examples to help you get started. Python is a high-level programming language with dynamic semantics. Developed in the early 90s, and named after the Monty Python comedy troupe, it uses simple, easy-to-learn syntax and remains very popular amongst the programming community. It is particularly attractive for Rapid Application Development (RAD) and for its ability to connect existing components together. Python can be used for: server-side … Read more

Home » Programming

How to Convert a String to int in Python (and Int to String)

how to convert string int python 1

This article explains how to convert a string into an integer in Python. When you are looking to program with Python, it’s essential that you are aware of the different data types that you may be dealing with. The way your data is stored will depend on which kind of data it is and each kind of data operates in a different manner. Different data types in Python Data types that you’re likely to encounter fall under the categories of numeric, string, and boolean. Simply … Read more

Home » Programming

How to Use Split in Python to Split a String

python logo

Python is the world’s second most popular programming language and is the preferred choice of many programmers. It is particularly useful for backend web development, artificial intelligence, data analysis, and scientific computing, but can also be used for creating games and desktop apps. One of the most common questions when it comes to Python is how to split a string. A string in Python is a sequence of Unicode characters, and string variables can be very helpful for Python programmers. They can contain alphanumeric or … Read more

Home » Programming

Postgresql: show tables, show databases, show columns, describe table

PostgreSQL is one of the best database engines for an average web project and many who moves to psql from MySQL (for example) often ask the following questions: What is the analog of “show tables” in Postgres? How can I get the list of databases in Postgres like “show databases” in MySQL? In this quick tutorial, we’ll answer these questions, along with some other common commands which are useful. PostgreSQL doesn’t work with original MySQL commands, but it gives similar functionality with its own commands: … Read more

Home » Programming

How to monitor traffic at Cisco router using Linux (Netflow)

Cisco (featured logo)

By default Cisco IOS doesn’t provide any traffic monitoring tools like iftop or iptraff available in Linux. While there are lots of proprietary solutions for this purpose including Cisco Netflow Collection, you are free to choose nfdump and nfsen open source software to monitor traffic of one or many Cisco routers and get detailed monitoring data through your Linux command line or as graphs at absolutely no cost. Below is beginner’s guide that helps to quickly deploy netflow collector and visualizer under Linux and impress … Read more

Home » Programming

Create Linux user with password

Sometimes it’s necessary to create Linux user accounts in batch mode (fully automatic) but often newbies ask how to set password for a new user without entering it manually. Thanks to heaven command useradd can get password as an input parameter, but it should be encrypted. In other words, to create Linux user account with password the following command will be useful: useradd -m -p encryptedPass username I know at least two ways to get password encrypted. The first one is to use perl crypt(); … Read more

Home » Programming

Access to sqlite3 database through perl (script example)

By publishing this post I try to help people who want to get access to popular and simple database engine sqlite through perl script. I use sqlite to store e-mails statistics at small mail server in order to retrieve information about users’ mail activity like average response time, sent and received messages and etc. There is perl script that is used to get this data per every user or get summary statistics. This script is to be run by web server (I use Apache) and … Read more