From the course: Python Practice: Real-World Coding Challenges

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: When I move, you move

Solution: When I move, you move

(upbeat music) - [Instructor] If you've written any new classes that I don't have, the hardest part of this challenge was likely modifying your code to follow this new pattern of appending moves to a list that are going to be executed by the canvas later on. Once you have that done the next step is modifying the go function in the canvas. So you want to modify this to use threading. So first, obviously, you need to import the thread module at the top. Then, for scribe and scribes create a new list of threads. In order to create a new thread we need the function and a list of arguments. Fortunately, I've provided you with that list of arguments right here. So then the actual function is scribe moves i zero. Simply create the new thread object with that function and then the list of arguments. Then for thread in threads start, start all this threads and then for thread in threads, join. So let's check this out with…

Contents