MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / main

Function main

Converter/converter.py:3–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1from converter_values import * # import required files
2
3def main():
4 print(options["help"]) # prints help menu
5 res = input("Response: ")
6
7 while res.lower() != "q": # program loop
8 try:
9 res = res.strip().split(" ")
10
11 if len(res) == 1:
12 display_help(res[0]) # display help menu
13 elif len(res) == 4:
14 perform_conversion(res) # perform unit conversion
15 else:
16 print("Invalid command")
17
18 except Exception as e:
19 print("Error:", e)
20
21 res = input("\nResponse: ")
22
23def display_help(command):
24 """Display help menu."""

Callers 1

converter.pyFile · 0.70

Calls 4

display_helpFunction · 0.85
perform_conversionFunction · 0.85
splitMethod · 0.80
stripMethod · 0.80

Tested by

no test coverage detected