Python Tutorials and HowTos

Python programming related tutorial, howtos, tips, and hacks under Unix like operating systems with special focus on sys admin tasks ( rss feed ).

I‘m a new Ubuntu 12.04/14.04 server user. How do I install and use memcached on an Ubuntu Linux 14.04 LTS server? How can I my apps written in PHP or Python can use memcached on an Ubuntu LTS server?


I am a new Python user. I would like to delay execution for five seconds in a Python script. How do I add a time delay in Python on Unix/Linux? Is there a sleep command in python like the Unix/Linux sleep utility to suspend execution of a bash script?


How do I find out the current date and time in Python? What is the module or function I need to use to get current time or date in Python programming language?


How do I install and use gcutil – a command-line tool that is used to manage Google Compute Engine resources under Debian or Ubuntu or CentOS/Fedora Linux desktop operating systems?


I would like to use argparse module for Python 2.6 under Debian Linux. However, the code is not working. How do I install and use argparse Python module under Debian Linux 6.x for Python version 2.5 or 2.6?


I know how to display line numbers using vim text editor. How do display line numbers in the left side for any text file under Unix or Linux operating systems?

{ 1 comment }

I am a new Python programming user. I am working on user-friendly command-line interfaces, and I want to pass input via the shell args as follows:

./ filename
./ in.file output.file
./ -i in.file -o output.file

How do I pass and parse command-line options and arguments using Python under Unix like operating systems?