|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#!/usr/bin/env python3
import sys
import csv
class Args():
def __init__(self):
self.args = sys.argv[1:]
#print(self.args)
index = self.args.index('-c')
self.configfile = self.args[index+1]
#print(self.configfile)
index = self.args.index('-d')
self.userfile = self.args[index+1]
index = self.args.index('-o')
self.gongzifile = self.args[index+1]
print(self.gongzifile)
args1 = Args()
class Config(object):
def __init__(self):
#print(8888)
self.config = self._read_config()
def _read_config(self):
d = {'s':0}
with open(args1.configfile) as f1:
for line in f1.readline():
m = line.split('=')
print(m)
a,b = m[0].strip(),m[1].strip()
if a == 'JiShuL' or a == 'JiShuH':
d[a] = float(b)
else:
d['s'] += float(b)
return d
class IncomeTaxCalculator(object):
def calc_for_all_userdata(self):
salary = int(salary)
shebao = salary * config['s']
if salary < ('JiShuL'):
shebao = config['JiShuL'] * config['s']
if salary >('JiShul'):
shebao = config['JiShuL'] * config['s']
m = salary - shebao -3500
config = Config().config
说是越界 搞了好久 都搞不定
哪一行越界呢?请给出错误。
你是不是 参数没有输够?
|
|