readlines() is a function in python used to read text file and convert it into list where each line in at file is a element in list with new line(\n) at the end of each element.
>>> filelist = open("file.txt").readlines()
['a\n', 'b\n', 'c\n', 'd\n']
If you want to remove new line(\n) at the end of all elements in list use read() and splitlines() functions as shown in below example.
This post addresses how to configure the Linux firewall to protect a Debian-based web application server. While there are GUI tools for the job, we will focus on the command-line tool iptables. The scenario is that you have just installed Debian (or Ubuntu) on a server connected to the Internet. This will be used as a web server hosting your WordPress blog. I assume that you already have Apache, and WordPress installed.
With the help of isdigit() function we can check if a string start with number or not.
Lets check with following examples:
>>> input = '1viewsby'
Above example is returned true since input string is started with with number.
>>> input = 'viewsby'
Since input is is not started with number above example returned false.