Logo Search packages:      
Sourcecode: zh-autoconvert version File versions  Download package

percent.py

#!/usr/bin/python
#Author Ha Shao <hashao@china.com>
#2000.8.30

import fileinput
import string

for line in fileinput.input():
    if(fileinput.filename() == "400b5.txt"):
      total = 171894734
    elif (fileinput.filename() == "400gb.txt"):
        total = 45376453

    s = string.split(line)
    print "%s,\t%f" % (s[1], (float(s[2]))/ total * 100)

Generated by  Doxygen 1.6.0   Back to index