官术网_书友最值得收藏!

Technical requirements

We will use some more built-in libraries from the standard Python distribution for this chapter. This includes tkinter, os, math, threading, and pickle modules.

To verify that these modules exist, simply run the following statement in your Python3 IDLE interactive prompt:

 >>> import tkinter, os, math, time, threading, pickle 

This should not cause an error, as Python3 comes with these modules built into the distribution.

Other than this, you need to add an extra Python module called pygame. We will be using the version named 1.9.3 Package, which can be downloaded at http://www.pygame.org/download.shtml.

Linux users may additionally want to take a look at the following page for instructions on getting pygame to work with Python 3.x: http://www.pygame.org/wiki/CompileUbuntu?parent=Compilation.

pygame is a cross-platform package normally used for making games with Python. However, we will just be using a small module from the package named pygame.mixer, which is used for loading and playing sounds. The API documentation for this module can be found at http://www.pygame.org/docs/ref/mixer.html.

After you have installed the module, you can verify it by importing it:

>>> import pygame
>>> pygame.version.ver

If no errors are reported and the version output is 1.9.3, you are ready to program the drum machine. Let's start!

主站蜘蛛池模板: 个旧市| 淮南市| 昭觉县| 东莞市| 池州市| 西昌市| 新竹市| 乌拉特前旗| 康平县| 万盛区| 屯留县| 北流市| 尚志市| 湘乡市| 高邑县| 六安市| 宁津县| 玉林市| 台山市| 始兴县| 东兴市| 舟曲县| 青浦区| 扶余县| 客服| 天津市| 大化| 萨迦县| 色达县| 商水县| 乌拉特前旗| 秀山| 龙山县| 青田县| 和顺县| 万山特区| 龙里县| 贺州市| 玛多县| 肇州县| 峡江县|