O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required