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 … [Read more...] about Log Checker in Python
Code Snippets
Review our python code snippet articles below. We have covered so many examples it may take you awhile to browse them all. Feel free to use our search for a specific python coding example.
Python : Guessing Game part 2
Overview This small program extends the previous guessing game I wrote about in this : post "Python Guessing Game". Guessing Game In this game we will … [Read more...] about Python : Guessing Game part 2
Guessing Game Implementation in Python
Writing simple games in python is a great way to practice conditional statements and loops. In this article, we will implement a guessing game in … [Read more...] about Guessing Game Implementation in Python
How to use Strings Count Method
Count Occurrences of a string This small script will use Pythons count method to count the numberof occurrences of a string. s = "Count, the number … [Read more...] about How to use Strings Count Method
Python Password Generator
Password Generator You can use Pythons string and random modules to generate passwords. The string module contains a number of useful constants and … [Read more...] about Python Password Generator
Using Telnet in Python
Using Telnet in Python To make use of Telnet in Python, we can use the telnetlib module. That module provides a Telnet class that implements the … [Read more...] about Using Telnet in Python
Python Code : Convert KM/H to MPH
Convert KM/H to MPH This script converts speed from KM/H to MPH, which may be handy for calculating speed limits when driving abroad, especially for … [Read more...] about Python Code : Convert KM/H to MPH
Split a domain with urlparse
Split a domain This is a simple script to split the domain name from a URL. It does that by usingPythons urlparse module. import urlparse url = … [Read more...] about Split a domain with urlparse
Python Code : Get all the links from a website
Overview In this script, we are going to use the re module to get all links from any website. One of the most powerful function in the re module is … [Read more...] about Python Code : Get all the links from a website
Python Code: Celsius and Fahrenheit Converter
Overview This script converts temperature between Fahrenheit to Celsius. To create a python converter for celsius and fahrenheit, you first have to … [Read more...] about Python Code: Celsius and Fahrenheit Converter