def input_fun(self): mytext = self.textEdit.toPlainText() self.textEdit_2.append("Me: " + mytext) self.textEdit.setText("") res = process(mytext) self.textEdit_2.append(assistant_details.name + ": " + res) self.textEdit_2.append("")
def taking_input(self): #from input_module import take_input,App from process_module import process from output_module import give_output from database import speak_is_on i = take_input(self) o = process(self, i) give_output(o)
def send(): msg = EntryBox.get("1.0", 'end-1c').strip() EntryBox.delete("0.0", END) if msg != '': ChatBox.config(state=NORMAL) ChatBox.insert(END, "You: " + msg + '\n\n') ChatBox.config(foreground="#446665", font=("Verdana", 12)) res = process(msg) ChatBox.insert(END, "Bot: " + res + '\n\n') ChatBox.config(state=DISABLED) ChatBox.yview(END) output(res)
# This is Self Learning Personal Assistant, it's name is Sam from input_module import take_input from process_module import process from output_module import output while True: i = take_input() o = process(i) output(o)
from input_module import getInput from output_module import showOutput from process_module import process from welcome import getGreetingMessage import os os.system('cls') showOutput(getGreetingMessage()) while True: inp = getInput() result = process(inp) showOutput(result)
from process_module import process from output_module import output import welcome import os from input_module import take_command os.system("cls") #welcome message welcome.greet() while(True): i=take_command() o=process(i.lower()) output(o)