Python playground : geeky projects for the curious programmer /
"Python is a powerful programming language that's easy to learn and fun to play with. But once you've gotten a handle on the basics, what do you do next? Python Playground is a collection of imaginative programming projects that will inspire you to use Python to make art and music, bu...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
San Francisco :
No Starch Press,
[2016]
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- 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
- 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
- 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
- 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
- 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