Here is my code:
import Tkinter
top = Tkinter.Tk()
top.geometry('600x600')
scale = Tkinter.Scale(top,from_=10,to=40, orient=HORIZONTAL)
scale.pack()
The following error appeared:
NameError: name 'HORIZONTAL' is not defined
I want to set my scale to be horizontal, and my reference is here but it doesn't work.
import *
can be handy when you're experimenting, but it's a bad habit to get into.Tkinter.HORIZONTAL
is much better as it doesn't clutter your namespace with all the Tkinter stuff. If you doimport *
with multiple modules, things get very messy if the same name is used in more than one module. :) As a compromise, you can give a module a shorter name usingimport ... as ...
syntax. – Triiodomethane