If I call this function, it never works, just like it never gets called and without errors, even tho (parameter == 'h') is True, and the help function works, and the function is called properly. I tried everything I could think of.
Function:
def nav(parameter):
if parameter == 'h':
help(parameter)
Help Function:
def help(parameter):
clearConsole()
print("Help Menu")
# other code
How I called it:
nav(userInput)
CodePudding user response:
I think this is what you are trying to accomplish :
def nav(parameter):
if parameter == 'h':
help(parameter)
def help(parameter):
clearConsole()
print("Help Menu")
# other code
import os
def clearConsole():
command = 'clear'
if os.name in ('nt', 'dos'): # If Machine is running on Windows, use cls
command = 'cls'
os.system(command)
user_input = input("Enter a character : ")
nav(user_input)
things I added :
- user input
- clearConsole() method