Skip to content

Commit 66a07c7

Browse files
committed
Pycalc release v1.0.4.
1 parent b20340d commit 66a07c7

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

final_task/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
import argparse
2-
from pycalc import PyCalc
3-
4-
5-
def main():
6-
parser = argparse.ArgumentParser()
7-
parser.add_argument("EXPRESSION", help="expression string to evaluate")
8-
args = parser.parse_args()
9-
calc = PyCalc()
10-
result = calc.calculate(args.EXPRESSION)
11-
print(result)
12-
13-
14-
if __name__ == '__main__':
15-
main()

final_task/pycalc.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
import types
44
import pickle
5-
5+
import argparse
66
from collections import namedtuple
77

88

@@ -306,3 +306,16 @@ def lexer(characters, token_exprs, tuple_template):
306306
else:
307307
pos = match.end(0)
308308
return tokens
309+
310+
311+
def main():
312+
parser = argparse.ArgumentParser()
313+
parser.add_argument("EXPRESSION", help="expression string to evaluate")
314+
args = parser.parse_args()
315+
calc = PyCalc()
316+
result = calc.calculate(args.EXPRESSION)
317+
print(result)
318+
319+
320+
if __name__ == '__main__':
321+
main()

0 commit comments

Comments
 (0)