Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Ten more essential Python tips

Feb 04, 2010, 04:33 (0 Talkback[s])

[ Thanks to Linux User & Developer magazine for this link. ]

"Today, Python is one of the most popular programming languages in the open source space. Look around and you will find it running everywhere, from various configuration tools to XML parsing. Python is a vast language and there are many gems to discover. Following on from the popularity of our Ten essential Python tips for beginners article, we’ve compiled a further collection of ten gems to make your Python experience that much more worthwhile…

"Passing arguments to a Python script

"Python lets you access whatever you have passed to a script while calling it. The ‘command line’ content is stored in the sys.argv list. import sys

print sys.argv

"Loading modules or commands at startup

"You can load predefined modules or commands at the startup of any Python script by using the environment variable $PYTHONSTARTUP. You can set environment variable $PYTHONSTARTUP to a file which contains the instructions load necessary modules or commands ."

Complete Story

Related Stories: