質問

I use a messagebox as a widget to display results from a random number generator. The number of random numbers is chosen through an entry box. Using

def evClear():
    from_draws.delete(0,END)# clears only entry value
    from_draws.focus()
    cvt_to.delete()

I succesfuklly delete the contents of the entry box (from_draws), however the cvt_to which contains the random numbers gives an error: AttributeError: 'StringVar' object has no attribute 'delete' How can one delete both ( simply to make the GUI look a bit better)? If one places a different number in the entry box, the reruslt is ovwerwritten by the new result. I guess the question is how to delete the contents written to a messagebox, please

役に立ちましたか?

解決

replace

cvt_to.delete()

by

cvt_to.set("")  # set to empty string
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top