I have some problems with tkinter and grid. Help writes that i can use in=master option, but when I try, I get a message invalid syntax. Here is my code:
from tkinter import *
root=Tk()
root.title("Gallery")
text=Text(root)
text.grid(in=master)
root.mainloop()
Can anyone explain to me what the problem is?
1 Answer 1
From the documentation, it states you need to use in_, as in is a reserved word in python--that's why you are getting your syntax error because in isn't being treated as a keyword.
Note that in is a reserved word in Python. To use it as a keyword option, append an underscore (in_).
Also, you don't have master defined anywhere in your code. Perhaps you meant root?
inis a reserved keyword in Python, so this cannot work... where did you read that?help(root)or maybehelp(text.grid)?help(Text(Tk()).grid)