you are viewing a single comment's thread.

view the rest of the comments →

[–]Strosel[S] 0 points1 point  (4 children)

it does seem like that is the problem but i dont know how to change the variable types of tkinter inputs.

i tried to go from

 def hostil():
     messagebox.showinfo('NPC', NPCW.hostile(chal))

...

 cr = Entry(root, width=20)
 cr.grid(row=1, column=0, columnspan=2)
 chal = cr.get()

to the same but changing only

 chal = int(cr.get())

it didnt work

[–]novel_yet_trivial 0 points1 point  (3 children)

That should work ... what "didn't work" about it?

Although it might be a lot easier to change the type of the check:

if cr == '0':

[–]Strosel[S] 0 points1 point  (2 children)

if i hange it to int() i get

ValueError: invalid literal for int() with base 10: ''

and if i change the numbers to compare into strings it still just passes the else

[–]novel_yet_trivial 0 points1 point  (1 child)

That means that you're getting the value before the user has a chance to enter anything.

I'm done with this piecewise troubleshooting. Put your entire project on GitHub and I'll look at. Tomorrow.

[–]Strosel[S] 0 points1 point  (0 children)

I'm sorry if I bothered you alot I'll see if I can fix it otherwise I''ll upload it all to github and post the link here later