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 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?

{ 2 comments }

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?

{ 7 comments }

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?

{ 0 comments }

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?

{ 0 comments }

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:

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

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

{ 7 comments }

How do I delete a file called /tmp/foo.txt using Python programming language under MS-Windows or Unix like operating systems?

{ 3 comments }