Update demo scripts to use installed python library
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
|
||||
fo = open( 'machine.txt', 'w' )
|
||||
fo = open( 'machine.txt', 'w' )
|
||||
cnt = 6
|
||||
fmap = {}
|
||||
for l in open( 'machine.data' ):
|
||||
@@ -9,12 +8,12 @@ for l in open( 'machine.data' ):
|
||||
fo.write(arr[8])
|
||||
for i in range( 0,6 ):
|
||||
fo.write( ' %d:%s' %(i,arr[i+2]) )
|
||||
|
||||
|
||||
if arr[0] not in fmap:
|
||||
fmap[arr[0]] = cnt
|
||||
cnt += 1
|
||||
|
||||
fo.write( ' %d:1' % fmap[arr[0]] )
|
||||
|
||||
fo.write( ' %d:1' % fmap[arr[0]] )
|
||||
fo.write('\n')
|
||||
|
||||
fo.close()
|
||||
@@ -22,7 +21,7 @@ fo.close()
|
||||
# create feature map for machine data
|
||||
fo = open('featmap.txt', 'w')
|
||||
# list from machine.names
|
||||
names = ['vendor','MYCT', 'MMIN', 'MMAX', 'CACH', 'CHMIN', 'CHMAX', 'PRP', 'ERP' ];
|
||||
names = ['vendor','MYCT', 'MMIN', 'MMAX', 'CACH', 'CHMIN', 'CHMAX', 'PRP', 'ERP' ];
|
||||
|
||||
for i in range(0,6):
|
||||
fo.write( '%d\t%s\tint\n' % (i, names[i+1]))
|
||||
|
||||
Reference in New Issue
Block a user