Python Forum

Full Version: Generate questions from excel to test my chatbot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone!
I am new in Python, but I am learning a lot from a Coursera Course. I have an excel document with lots of questions/phrases, i.e. "What color do you like the most?" , "my computer is not working", how can I ad moe ram? I would like Python to grab one question at the time and insert it in my ChatBot Website, wait for the response and insert another question. At the end of my question, my chatbot asks... Did I answer your question? YES or NO? . I want Python to reply YES or NO at random, and continue inserting questions from the excel document, line by line, the Website where my Bot is located
Is this possible? and can someone show me how I can start it please?
Thank you
You can use openpyxl to read Excel files.

Out of interest, why are you storing the data in a spreadsheet rather than just as plain text? Of course Python can read from plain text files without any third-party libraries. I'm just curious really.
Thank you for the response
I can also use a TXT file, I don't think that is the problem,
but how do I make python ask the question to robin.. wait and ask YES or NO, or another question?
Thanks!
What have you tried? We aren't here to do the work for you.
okas, I will try before asking
Thanks!
So this is the script i did, it works in python, it shows each line in the Terminal. I want the information in the text file to run in a website. I used to do this in autohotkeys, but I am learning Python, any suggestions?

test1 = open("C:\\Users\\USERs\\Google Drive\\Certification - Coursera\\Python\\test.txt")
for word in test1:
        pyautogui.typewrite(word)
        pyautogui.press("enter")