home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / catdo_35.zip / tables.py < prev    next >
Text File  |  1999-12-17  |  441b  |  21 lines

  1. # Copyright Stefan Schwarzer, 1999
  2.  
  3. files = ( 'latin1_cp437', 'latin1_cp850' )
  4.  
  5. for file in files:
  6.  
  7.     # read table
  8.     print file
  9.     f = open( file, 'r' )
  10.     table = f.readlines()
  11.     f.close()
  12.  
  13.     # write converted file
  14.     f = open( file, 'w' )
  15.     for i in range( 128 ):
  16.         table[ i ] = table[ i ][ 0 ]
  17.         table[ i ] = hex( ord( table[ i ] ) )
  18.         f.write( `table[ i ]`[1:-1] + ',' )
  19.     f.close()
  20.  
  21.