Join Barron Stone for an in-depth discussion in this video Capturing mouse input, part of Code Clinic: Python (2014).
In this video, I'll show you how I used tkinter package…to create a canvas and capture mouse inputs from the user.…When you open up the theremin.py script,…you notice that the program is structured as a class…called theremin, which is a common structure…used for programs that use tkinter to generate a gui.…There are several methods that make up the class.…Looking down here, we have a calq_freq,…calq <u>volume, and a sine</u> wave helper method,…although these will be discussed in the next video.…But, above them there are three methods called…mouse<u>move, mouse</u>down, and mouse_up,…which we'll examine in this video.…
Those are what are called in response to…user inputs from the mouse.…Now to begin though, let's look…at the init constructor method.…It begins by initializing several class variables.…The prev variable will store the…previous location in the mouse,…which the program will use when it has to draw the line.…We'll see how that's done later.…The sound variable will store the sound wave form to play…
Barron introduce challenges and provides an overview of his solutions in Python. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, Java, PHP, and Ruby.
Skill Level Intermediate
Q: Why can't I access the Lake Pend Orielle site (http://lpo.dt.navy.mil)?
A: The Lake Pend Orielle site is not accessible in some geographical areas. We have contacted the owner of the server to try to resolve this issue.
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.