def tempfilepager(text, cmd):
 import tempfile
 filename = tempfile.mktemp()
 file = open(filename, 'w')
 file.write(_encode(text))
 file.close()
 try:
  os.system((((cmd + ' "') + filename) + '"'))
 finally:
  os.unlink(filename)

def tempfilepager ( text , cmd ) : import tempfile filename = tempfile . mktemp ( ) file = open ( filename , 'w' ) file . write ( _encode ( text ) ) file . close ( ) try : os . system ( ( ( ( cmd + ' "' ) + filename ) + '"' ) ) finally : os . unlink ( filename )
page through text by invoking a program on a temporary file .