Python playground : geeky projects for the curious programmer /


by Mahesh Venkitachalam.
Bok Engelsk 2016 · Electronic books.
Omfang
1 online resource (353 p.)
Utgave
1st edition
Opplysninger
Includes index.. - Brief Contents ; Contents in Detail ; Acknowledgments; Introduction; Who Is This Book For?; What's in This Book?; Part I: Warming Up; Part II: Simulating Life; Part III: Fun with Images; Part IV: Enter the 3D; Part V: Hardware Hacking; Why Python?; Python Versions; The Code in This Book; Part I: Warming Up; Chapter 1: Parsing iTunes Playlists; Anatomy of the iTunes Playlist File; Requirements; The Code; Finding Duplicates; Extracting Duplicates; Finding Tracks Common Across Multiple Playlists; Collecting Statistics; Plotting Your Data; Command Line Options; The Complete Code. - Computing the Average BrightnessGenerating the ASCII Content from the Image; Command Line Options; Writing the ASCII Art Strings to a Text File; The Complete Code; Running the ASCII Art Generator; Summary; Experiments!; Chapter 7: Photomosaics; How It Works; Splitting the Target Image; Averaging Color Values; Matching Images; Requirements; The Code; Reading in the Tile Images; Calculating the Average Color Value of the Input Images; Splitting the Target Image into a Grid; Finding the Best Match for a Tile; Creating an Image Grid; Creating the Photomosaic; Adding the Command Line Options. - Controlling the Size of the Photomosaic. - How It WorksRequirements; The Code; Representing the Grid; Initial Conditions; Boundary Conditions; Implementing the Rules; Sending Command Line Arguments to the Program; Initializing the Simulation; The Complete Code; Running the Game of Life Simulation; Summary; Experiments!; Chapter 4: Generating Musical Overtones with the Karplus-Strong Algorithm; How It Works; The Simulation; Creating WAV Files; The Minor Pentatonic Scale; Requirements; The Code; Implementing the Ring Buffer with deque; Implementing the Karplus-Strong Algorithm; Writing a WAV File; Playing WAV Files with pygame. - Running the ProgramSummary; Experiments!; Chapter 2: Spirographs; Parametric Equations; Spirograph Equations; Turtle Graphics; Requirements; The Code; The Spiro Constructor; The Setup Functions; The restart Method; The draw Method; Creating the Animation; The SpiroAnimator Class; The genRandomParams Method; Restarting the Program; The update Method; Showing or Hiding the Cursor; Saving the Curves; Parsing Command Line Arguments and Initialization; The Complete Code; Running the Spirograph Animation; Summary; Experiments!; Part II: Simulating Life; Chapter 3: Conway's Game of Life. - The main MethodThe Complete Code; Running the Plucked String Simulation; Summary; Experiments!; Chapter 5: Boids: Simulating a Flock; How It Works; Requirements; The Code; Computing the Position and Velocities of the Boids; Setting Boundary Conditions; Drawing a Boid; Applying the Rules of the Boids; Adding a Boid; Scattering the Boids; Command Line Arguments; The Boids Class; The Complete Code; Running the Boids Simulation; Summary; Experiments!; Part III: Fun with Images; Chapter 6: ASCII Art; How It Works; Requirements; The Code; Defining the Grayscale Levels and Grid. - Python Playground is a collection of fun programming projects that will level up your Python skills.
Emner
Sjanger
Dewey
ISBN
1-4571-9716-2. - 1-59327-733-4

Bibliotek som har denne