Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
What just happened?
We did two tests in the last program. First, we used the new run() method, passing to it the code that is to be executed and two dictionaries that define the current execution context—the first dictionary contains global symbols and the second contains local symbols. The dictionaries come from Python's __main__ module (which, among other things, defines the print function). The run() method may modify the contents of the two dictionaries—the first call defines the tuple called foo, and the second call prints it to the standard output.
The second test calls a function from an imported module; in this case, we call two functions from the os module—the first function, chdir, changes the current working directory, and the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access