Tkinter Flashcards

1
Q

What must you place before everything when writing a program in Tkinter?

A

root = Tk().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you create an input field in Tkinter?

A

Using Entry().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you display a widget on the screen in Tkinter?

A

Using .pack(), .grid() or .place()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you create a label in Tkinter?

A

Using Label()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you create a button in Tkinter?

A

Using Button()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What must you place at the end of your Tkinter program?

A

root.mainloop()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does root.mainloop() in Tkinter do?

A

It checks where the mouse cursor is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What function checks where the mouse cursor is in Tkinter?

A

root.mainloop()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What must every button in Tkinter include?

A

A command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you get the input of an entry widget in Tkinter?

A

using .get()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you insert text inside of an input box in Tkinter?

A

Using .insert(0, )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you make a Tkinter Label span two columns?

A

.grid(columnspan = 2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does .grid(columnspan = 2) do?

A

It makes a Tkinter label span two columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you pass a parameter through a function that is a command of a Tkinter button?

A

Using lambda: function(parameter)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you clear a Tkinter input box?

A

With .delete(0, END)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is type conversion?

A

The process of converting the value of one data type (integer, string, float, etc.) to another data type.

17
Q

What is the process of converting a value of one data type to another data type called?

A

Type conversion.

18
Q

What types of type conversion does Python have?

A

Implicit and explicit.

19
Q

What is Implicit Type Conversion in Python?

A

Automatically converting one data type to another data type.

20
Q

What does the type() function do?

A

It returns the type of a variable.

21
Q

What function returns the type of a variable?

A

type()

22
Q

What functions do we use in Explicit Type Conversion?

A

int(), float(), str(), etc.