<s>
Tkinter	B-Language
is	O
a	O
Python	B-Language
binding	B-Application
to	O
the	O
Tk	B-Application
GUI	B-Application
toolkit	O
.	O
</s>
<s>
It	O
is	O
the	O
standard	O
Python	B-Language
interface	O
to	O
the	O
Tk	B-Application
GUI	B-Application
toolkit	O
,	O
and	O
is	O
Python	B-Language
's	O
de	O
facto	O
standard	O
GUI	B-Application
.	O
</s>
<s>
Tkinter	B-Language
is	O
included	O
with	O
standard	O
Linux	B-Application
,	O
Microsoft	B-Application
Windows	I-Application
and	O
macOS	B-Application
installs	O
of	O
Python	B-Language
.	O
</s>
<s>
The	O
name	O
Tkinter	B-Language
comes	O
from	O
Tk	B-Application
interface	O
.	O
</s>
<s>
Tkinter	B-Language
was	O
written	O
by	O
Steen	O
Lumholt	O
and	O
Guido	O
van	O
Rossum	O
,	O
then	O
later	O
revised	O
by	O
Fredrik	O
Lundh	O
.	O
</s>
<s>
Tkinter	B-Language
is	O
free	B-Application
software	I-Application
released	O
under	O
a	O
Python	B-License
license	I-License
.	O
</s>
<s>
As	O
with	O
most	O
other	O
modern	O
Tk	B-Application
bindings	O
,	O
Tkinter	B-Language
is	O
implemented	O
as	O
a	O
Python	B-Language
wrapper	O
around	O
a	O
complete	O
Tcl	B-Operating_System
interpreter	B-Application
embedded	O
in	O
the	O
Python	B-Language
interpreter	B-Application
.	O
</s>
<s>
Tkinter	B-Language
calls	O
are	O
translated	O
into	O
Tcl	B-Operating_System
commands	O
,	O
which	O
are	O
fed	O
to	O
this	O
embedded	O
interpreter	B-Application
,	O
thus	O
making	O
it	O
possible	O
to	O
mix	O
Python	B-Language
and	O
Tcl	B-Operating_System
in	O
a	O
single	O
application	O
.	O
</s>
<s>
There	O
are	O
several	O
popular	O
GUI	B-Application
library	O
alternatives	O
available	O
,	O
such	O
as	O
wxPython	B-Language
,	O
PyQt	B-Language
,	O
PySide	B-Language
,	O
Pygame	B-Operating_System
,	O
Pyglet	B-Library
,	O
and	O
PyGTK	B-Language
.	O
</s>
<s>
A	O
window	B-Application
which	O
acts	O
as	O
a	O
child	O
of	O
the	O
primary	O
window	B-Application
.	O
</s>
<s>
The	O
generic	O
term	O
for	O
any	O
of	O
the	O
building	O
blocks	O
that	O
make	O
up	O
an	O
application	O
in	O
a	O
graphical	B-Application
user	I-Application
interface	I-Application
.	O
</s>
<s>
Core	O
widgets	O
:	O
The	O
containers	O
:	O
frame	O
,	O
labelframe	O
,	O
toplevel	O
,	O
paned	O
window	B-Application
.	O
</s>
<s>
Tkinter	B-Language
provides	O
three	O
modules	O
that	O
allow	O
pop-up	O
dialogs	O
to	O
be	O
displayed	O
:	O
tk.messagebox	O
(	O
confirmation	O
,	O
information	O
,	O
warning	O
and	O
error	O
dialogs	O
)	O
,	O
tk.filedialog	O
(	O
single	O
file	O
,	O
multiple	O
file	O
and	O
directory	O
selection	O
dialogs	O
)	O
and	O
tk.colorchooser	O
(	O
colour	O
picker	O
)	O
.	O
</s>
<s>
Python	B-Language
2.7	O
and	O
Python	B-Language
3.1	O
incorporate	O
the	O
"	O
themed	O
Tk	B-Application
"	O
(	O
"	O
ttk	O
"	O
)	O
functionality	O
of	O
Tk8.5	O
.	O
</s>
<s>
This	O
allows	O
Tk	B-Application
widgets	O
to	O
be	O
easily	O
themed	O
to	O
look	O
like	O
the	O
native	O
desktop	O
environment	O
in	O
which	O
the	O
application	O
is	O
running	O
,	O
thereby	O
addressing	O
a	O
long-standing	O
criticism	O
of	O
Tk	B-Application
(	O
and	O
hence	O
of	O
Tkinter	B-Language
)	O
.	O
</s>
<s>
In	O
Tkinter	B-Language
,	O
the	O
Frame	O
widget	O
is	O
the	O
basic	O
unit	O
of	O
organization	O
for	O
complex	O
layouts	O
.	O
</s>
<s>
Here	O
is	O
a	O
minimal	O
Python	B-Language
3	O
Tkinter	B-Language
application	O
with	O
one	O
widget	O
:	O
</s>
<s>
For	O
Python	B-Language
2	O
,	O
the	O
only	O
difference	O
is	O
the	O
word	O
"	O
tkinter	B-Language
"	O
in	O
the	O
import	O
command	O
will	O
be	O
capitalized	O
to	O
"	O
Tkinter	B-Language
"	O
.	O
</s>
<s>
Developers	O
also	O
have	O
the	O
option	O
to	O
use	O
.grid( )	O
(	O
row	O
=	O
int	O
,	O
column	O
=	O
int	O
to	O
define	O
rows	O
and	O
columns	O
to	O
position	O
the	O
widget	O
,	O
defaults	O
to	O
0	O
)	O
and	O
.place( )	O
(	O
relx	O
=	O
int	O
or	O
decimal	O
,	O
rely	O
=	O
int	O
or	O
decimal	O
,	O
define	O
coordinates	O
in	O
the	O
frame	O
,	O
or	O
window	B-Application
)	O
.	O
</s>
<s>
Using	O
the	O
object-oriented	B-Language
paradigm	O
in	O
Python	B-Language
,	O
a	O
simple	O
program	O
would	O
be	O
(	O
requires	O
Tcl	B-Operating_System
version	O
8.6	O
,	O
which	O
is	O
not	O
used	O
by	O
Python	B-Language
on	O
MacOS	B-Application
by	O
default	O
)	O
:	O
</s>
<s>
line	O
1	O
:	O
Hashbang	B-Operating_System
directive	B-Operating_System
to	O
the	O
program	O
launcher	O
,	O
allowing	O
the	O
selection	O
of	O
an	O
appropriate	O
interpreter	B-Application
executable	O
,	O
when	O
self-executing	O
.	O
</s>
<s>
line	O
2	O
:	O
Imports	O
the	O
tkinter	B-Language
module	O
into	O
your	O
program	O
's	O
namespace	O
,	O
but	O
renames	O
it	O
as	O
tk	B-Application
.	O
</s>
<s>
line	O
5	O
:	O
The	O
application	O
class	O
inherits	O
from	O
Tkinter	B-Language
's	O
Frame	O
class	O
.	O
</s>
<s>
line	O
21	O
:	O
This	O
method	O
call	O
sets	O
the	O
title	O
of	O
the	O
window	B-Application
to	O
“	O
Sample	O
application	O
”	O
.	O
</s>
