[Tutor] checking input parameters

Bala subramanian bala.biophysics at gmail.com
Fri Aug 31 10:37:04 CEST 2012


Friends,
I use the following way to check for the input parameters. I would
like to know if there is a any better way to show or describe the
script usage. So when the user just runs it without any input params.,
the program shd not execute but just shows the documentation.

from sys import argv
if not argv[1:]:
      print 'Program usage: python script file-list1 file-list2'
      print 'file list should contain the names of the atom list'
      --------
      --------
Thanks,
Bala

-- 
C. Balasubramanian


More information about the Tutor mailing list