Time for a script again, this one will geolocate an IP address based on input from the user. For this script, we will be using a bunch of Python … [Read more...] about Get the Geo Location of an IP Address
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.
Reversing lists and strings
This short post will show how to do a reverse loops in Python. The first example will show how to do that in a list a and the other example how to … [Read more...] about Reversing lists and strings
Script : Get the username from a prompt…
This script will ask the user for its username, by using the raw_input function. Then a list of allowed users is created named user1 and user2. The … [Read more...] about Script : Get the username from a prompt…
Parse JSON objects in Python
Overview In this post we will explain how you can parse JSON objects in Python. Knowing how to parse JSON objects is useful when you want to access … [Read more...] about Parse JSON objects in Python
Python : OS.listdir and endswith( )
This short script uses the os.listdir function (that belongs to the OS module) to search through a given path (".") for all files that endswith … [Read more...] about Python : OS.listdir and endswith( )
Socket examples in Python
The socket module in Python provides access to the BSD socket interface. This post will show examples on how to use the socket functions. For more … [Read more...] about Socket examples in Python
Using the web browser in Python
The webbrowser module in Python provides an interface to display Web-based documents. Webbrowser Under most circumstances, simply calling the open() … [Read more...] about Using the web browser in Python
OS.walk in Python
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 … [Read more...] about OS.walk in Python
Python Game : Rolling The Dice
Dice games are one of the easiest yet most entertaining games. In this article, we will implement the rolling dice game in Python using two … [Read more...] about Python Game : Rolling The Dice
Monitor Apache / Nginx Log File
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 … [Read more...] about Monitor Apache / Nginx Log File