Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import click
- import os
- ff_name = input()
- fs_name = input()
- file_reaction = os.fsdecode(ff_name)
- file_answers = os.fsdecode(fs_name)
- @click.command()
- @ click.argument ( file_reaction , type = click . File ( 'rb' ))
- @ click.argument ( file_answers , type = click . File ( 'wb' ))
- def redox_load():
- exep = []
- with open(file_reaction) as inf, open(file_answers) as elog:
- for line in inf:
- s = line.strip()
- dct = json.loads(s)
- try:
- Validator.check_half_reaction(dct)
- jsn = Parser.wrap_dict(Parser.parse_string(s))
- elog.writelines('\n'.join(jsn))
- except NonexistentCharge as ne:
- exep.append(s + ' ' + ne.message)
- except BadResultCharge as bc:
- exep.append(s + ' ' + 'BadResultCharge')
- e1 = Equilibrium(dct[0], dct[1], K1)
- elog.writelines('\n'.join(exep))
- if __name__ == "__redox_load__":
- redox_load()
Add Comment
Please, Sign In to add comment