home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Demo / sgi / gl / glinfo.py < prev    next >
Encoding:
Python Source  |  1995-12-17  |  412 b   |  21 lines  |  [TEXT/R*ch]

  1. #! /usr/local/bin/python
  2.  
  3. # Print the values of all values that can be inquired with getgdesc().
  4. # See man getgdesc() for a description.
  5.  
  6. import gl
  7. import GL
  8.  
  9. def main():
  10.     names = []
  11.     maxlen = 0
  12.     for name in dir(GL):
  13.         if name[:3] == 'GD_':
  14.             names.append(name)
  15.             maxlen = max(maxlen, len(name))
  16.     for name in names:
  17.         print name + (maxlen - len(name))*' ' + '=',
  18.         print gl.getgdesc(getattr(GL, name))
  19.  
  20. main()
  21.