If I employ this method program combining all the seconds (2+2+2 = 6 seconds) and pausing the program only once for 6 seconds.
But, I need to pause the program 2 seconds after appending a new message to the array.
This means this has to be like taking time to get a reply message from the receiver.
Code: Select all
import time
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'forward-message', 'message' : text})
time.sleep(2)
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'reply-message', 'message' : 'Fine'})
time.sleep(2)
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'forward-message', 'message' : "Let's meet somewhere"})
time.sleep(2)
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'reply-message', 'message' : 'Shop or Office'})
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'reply-image', 'imagePath' : 'Shop.png'})
persons[selectedPerson["index"]]["chatHistory"].append({'type' : 'reply-image', 'imagePath' : 'Office.jpg'})