LISTENING FOR INPUTS
Expanding our repertoire beyond the command line
1
INPUT AND EVENTS
2
Considering different ways of executing programs
NOTE: You will not be tested on inputs and events, but these slides will help you with Project 1.
INPUTS AND EVENTS
3
Many ways that you interact w/computers do not involve the command line. For example:
EXAMPLES OF INPUTS
4
There are many different kinds of inputs, which should all be very familiar to you:�
EVENTS: WAYS OF RESPONDING TO USER INPUT
5
Events allow programs to listen to particular events (clicks, drags, etc.) and execute parts of a program based on the input. Events have two parts:
ASIDE: READING TECHNICAL DOCUMENTATION
6
At this point in the course, I encourage you to begin trying to read the technical documentation that is associated with various Python modules and functions. We will have a lesson on interpreting documentation after the quiz/exam
ASIDE: READING TECHNICAL DOCUMENTATION
7
Caveat: The tkinter documentation was last updated in 2005, using an old version of Python (2.x — you all are using Python ~3.7). Some things have changed:
Python 2.x | Python 3.x |
print ‘Hello world!’ | print(‘Hello world!’) |
import Tkinter # title case | import tkinter # lowercase |
mainloop() | master.mainloop() |
ASIDE: LEARNING TO WORK WITH MODULES
8
Every module / library is its own unique snowflake, filled with both amazing functionality and things that make no intuitive sense. Example (tkinter):
BIG IDEA: Learning to work with third-party modules and �technical documentation is the key skill you’re learning
Examples of UI Input Events
9
As you begin to arrange and connect these interface widgets together and connect them to executable functions, you can actually create your own Windows / Mac Desktop applications that others might download and use!
Graphics UI Demos / Activities
/event_demos/
10