Skip to content

Commit 4be6a2f

Browse files
pycalc implementation 6
1 parent b83faa7 commit 4be6a2f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

final_task/pycalc/pycalc.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ def createparser():
2222

2323
return parser
2424

25-
26-
# main
27-
if __name__ == "__main__":
25+
def main():
26+
"""calculation chain"""
2827
parser = createparser()
2928
main_input, spare_input = parser.parse_known_args(sys.argv[1:])
3029
# get user's expression
@@ -64,3 +63,7 @@ def createparser():
6463
else:
6564
print(result)
6665
sys.exit(0)
66+
67+
# main
68+
if __name__ == "__main__":
69+
main()

final_task/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
author_email = '[email protected]',
88
description = 'pure Python command line calculator',
99
packages = ['pycalc'],
10-
entry_points = {'console_scripts': ['pycalc = pycalc.pycalc']},
10+
entry_points = {'console_scripts': ['pycalc = pycalc.pycalc:main']},
1111
classifiers=["Programming Language :: Python :: 3.6", "Operating System :: Linux Mint"])

0 commit comments

Comments
 (0)