Page 12 - Python Basics: A Practical Introduction to Python 3
P. 12
Contents
12.5 Reading and Writing Files . . . . . . . . . . . . . . 351
12.6 Read and Write CSV Data . . . . . . . . . . . . . . . 366
12.7 Challenge: Create a High Scores List . . . . . . . . . 377
12.8 Summary and Additional Resources . . . . . . . . . 378
13 Installing Packages With pip 379
13.1 Installing Third-Party Packages With pip . . . . . . . 380
13.2 The Pitfalls of Third-Party Packages . . . . . . . . . 390
13.3 Summary and Additional Resources . . . . . . . . . 392
14 Creating and Modifying PDF Files 394
14.1 Extracting Text From a PDF . . . . . . . . . . . . . 395
14.2 Extracting Pages From a PDF . . . . . . . . . . . . . 402
14.3 Challenge: PdfFileSplitter Class . . . . . . . . . . . 409
14.4 Concatenating and Merging PDFs . . . . . . . . . . 410
14.5 Rotating and Cropping PDF Pages . . . . . . . . . . 417
14.6 Encrypting and Decrypting PDFs . . . . . . . . . . . 428
14.7 Challenge: Unscramble a PDF . . . . . . . . . . . . 433
14.8 Creating a PDF File From Scratch . . . . . . . . . . 433
14.9 Summary and Additional Resources . . . . . . . . . 440
15 Working With Databases 442
15.1 An Introduction to SQLite . . . . . . . . . . . . . . 443
15.2 Libraries for Working With Other SQL Databases . . 455
15.3 Summary and Additional Resources . . . . . . . . . 456
16 Interacting With the Web 458
16.1 Scrape and Parse Text From Websites . . . . . . . . 459
16.2 Use an HTML Parser to Scrape Websites . . . . . . . 469
16.3 Interact With HTML Forms . . . . . . . . . . . . . . 475
16.4 Interact With Websites in Real Time . . . . . . . . . 481
16.5 Summary and Additional Resources . . . . . . . . . 485
17 Scienti c Computing and Graphing 487
17.1 Use NumPy for Matrix Manipulation . . . . . . . . . 488
17.2 Use Matplotlib for Plotting Graphs . . . . . . . . . . 499
17.3 Summary and Additional Resources . . . . . . . . . 522
11