The webbrowser module in Python provides an interface to display Web-based documents. Webbrowser Under most circumstances, simply calling the open() function from this module will do the right thing. IN Unix, graphical browsers are preferred under X11, but text-mode browsers will be used if graphical browsers are not available or ...
Python has a cool built-in function in the OS module that is called os.walk() . OS.Walk() OS.walk() generate the file names in a directory tree by walking the tree either top-down or bottom-up. For each directory in the tree rooted at directory top (including top itself), it yields a 3-tuple ...
Count the number of hits in a Apache/Nginx This small script will count the number of hits in a Apache/Nginx log file. How it works This script can easily be adapted to any other log file. The script starts with making an empty dictionary for storing the IP addresses andcount ...
Show all entries in a logfile This script will show all entries in the file that is specified in the log file variable. Log Checker Script In this example, I will use the /var/log/syslog file. The for loop will go through each line of the log file and the line_split ...
Overview This small program extends the previous guessing game I wrote about in this : post "Guessing Game". Guessing Game In this game we will add a counter for how many guesses the user can have. The counter is initial set to zero. The while loop will run as long ...