Detta är fel medelandet jag får när jag kör bash .dbwebb/correct.bash
ERROR: test_b_analyzer (__main__.TestFunc)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_dbwebb.py", line 42, in test_b_analyzer
main.main()
File "/Users/aladinhindawi/dbwebb-kurser/python/me/kmom06/analyzer/main.py", line 49, in main
choice = input("--> ")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 965, in __call__
return _mock_self._mock_call(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 1027, in _mock_call
result = next(effect)
StopIteration
----------------------------------------------------------------------
och här är min code, jag har publiserat den för allt funkar som det ska men den klagar på min choice = input("-->")
alla funktioner funkar som de ska. o de e inge fel på min kod
ERROR: test_b_analyzer (__main__.TestFunc)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_dbwebb.py", line 42, in test_b_analyzer
main.main()
File "/Users/aladinhindawi/dbwebb-kurser/python/me/kmom06/analyzer/main.py", line 49, in main
choice = input("--> ")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 965, in __call__
return _mock_self._mock_call(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py", line 1027, in _mock_call
result = next(effect)
StopIteration
----------------------------------------------------------------------
och här är min code, jag har publiserat den för allt funkar som det ska men den klagar på min choice = input("-->")
- Kod: Markera allt
"""
this is the main page.
"""
import menu
import analyzer
def main():
"""
this is the main
"""
file = "phil.txt"
choice = "menu"
while True:
choice = input("--> ")
choice = choice.lower()
if choice == "stop":
print("adios")
break
elif choice == "file":
print("please enter another file")
file = input("--> ")
elif choice == "menu":
menu.welcome()
elif choice == "lines":
analyzer.count_lines(file)
elif choice == "words":
analyzer.count_words(file)
elif choice == "letters":
analyzer.count_char(file)
elif choice == "word frequency":
analyzer.word_frequency(file)
elif choice == "letter frequency":
analyzer.letter_frequency(file)
elif choice == "all":
analyzer.count_lines(file)
analyzer.count_words(file)
analyzer.count_char(file)
analyzer.word_frequency(file)
analyzer.letter_frequency(file)
else:
print("That is not a valid choice. You can only choose from the menu.")
if __name__ == '__main__':
main()
alla funktioner funkar som de ska. o de e inge fel på min kod