I am in the process of developing a troubleshooting application in Python that will allow a user to input a query. This query would contain the brand of the device and the issue or symptom of their problem. I am in the process of writing a script which essentially dissects the query to find an appropriate solution following keywords and brands of the device.
Current Code: #Import Modules import warnings
#Define Globals
brands = ["apple", "android", "windows"]
brand = ''
def Main():
init()
print("--Welcome to Troubleshooting Applet--")
print("In your query please include the brand of your device and the problem / symptom of your current issue. \n")
query = input("Enter your query: ").lower()
brand = set(brands).intersection(query.split())
if brand != '':
print(brand)
else:
print("Brand in existance not defined")
def init():
#warnings.filterwarnings("ignore") #Disable while debugging
if __name__ == '__main__':
Main()
Currently, the script will identify a brand, but I am not certain on how to check for a wide number of keywords in order to follow a solution route. I would expect the solution to follow the pattern of having selected a brand a secondary array specific for the brand which would contain a number of potential errors. Each of these errors could have a solution defined.
I would appreciate any insight,
Thanks,
Sam