Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TypeError: askstring() missing 1 required positional argument: 'prompt'

from tkinter import *

import tkinter.simpledialog

import tkinter.messagebox

root = Tk()
w = Label(root, text="my program")
w.pack()

tkinter.messagebox.showinfo("hi", "hi and welcome")
name = tkinter.simpledialog.askstring("name", "what is your name?")
yd = tkinter.simpledialog.askstring("feels", "how to you feel? (good not good)")
if yd in "good":
    output1 = "nice to hear", name
    tkinter.messagebox.showinfo("done", output1)
elif yd in "not good":
    output2 = "sorry to hear", name
    tkinter.messagebox.showinfo("done", output2)
    output4 = "does something can help you? (yes or no)"
    hy = tkinter.simpledialog.askstring("help?", output4)
    if hy in "yes":
        wis = tkinter.simpledialog.askstring("what it is?")
        output5 = "amm you can look it on google something like: how to", wis, "or something like that"
        tkinter.messagebox.showinfo("amm", output5)
    elif hy in "no":
        output6 = "its ok i recommend to play some games talk to your friends or something like that its help me!"
        tkinter.messagebox.showinfo("sorry", output6)
else:
    output3 = "I did not understand that"
    tkinter.messagebox.showinfo("rest the app", output3)
root.mainloop()

wis = tkinter.simpledialog.askstring(("what it is?"))
TypeError: askstring() missing 1 required positional argument: ‘prompt’

why it is?

in the first lines i use the same code but in line 23 it is not working

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

how to fix it?

>Solution :

Because you are giving one argument to tkinter.simpledialog.askstring, instead of two.

 wis = tkinter.simpledialog.askstring("what it is?")

Change your wis to this:

wis = tkinter.simpledialog.askstring("what it is?", "what it is?")

  
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading