Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore Automate the Boring Stuff with Python

Automate the Boring Stuff with Python

Published by atsalfattan, 2023-03-23 07:32:41

Description: Automate the Boring Stuff with Python

Search

Read the Text Version

["copying and pasting, 135 T double quotes for, 124 endswith() method, 131 tag_name attribute, 258 escape characters, 124\u2013125 Tag objects, 246\u2013247 extracting PDF text as, 296\u2013297 tags, HTML, 240 getting traceback as, 217\u2013218 Task Scheduler, 354 indexes for, 126\u2013127 termination, program, 22, 58 in operator, 127 text attribute, 308, 311 isalnum() method, 129\u2013131 text messaging isalpha() method, 129\u2013130 isdecimal() method, 129\u2013131 automatic notifications, 383 islower() method, 128\u2013129 sending messages, 381\u2013382 isspace() method, 130 Twilio service, 380 istitle() method, 130 text() method, 408\u2013410 isupper() method, 128\u2013129 TEXT search key, 369 join() method, 131\u2013132 textsize() method, 409 literals, 124 third-party modules, installing, ljust() method, 133\u2013134 lower() method, 128\u2013129 441\u2013442 lstrip() method, 134\u2013135 Thread() function, 347\u2013348, 351 multiline, 125\u2013126 threading module, 335, 347 mutable vs. immutable data types, Thread objects, 347\u2013348 threads 94\u201396 not in operator, 127 concurrency issues, 349 overview, 17 join() method, 352 raw, 125 multithreading, 347\u2013348 replication of, 18 rjust() method, 133\u2013134 image downloader, 350\u2013352 rstrip() method, 134\u2013135 passing arguments to, 348\u2013349 slicing, 126\u2013127 processes vs., 352 split() method, 131\u2013133 tic-tac-toe board, 113\u2013117 startswith() method, 131 timedelta data type, 342\u2013343, 346 strip() method, 134\u2013135 timedelta objects, 342\u2013343 substituting using regular time module overview, 346 expressions, 163\u2013164 sleep() function, 337\u2013338, 344 upper() method, 128\u2013129 stopwatch project, 338\u2013340 strip() method, 134\u2013135 time() function, 336\u2013337 strptime() function, 345, 346 TLS encryption, 364 strs, 17, See also strings top-level domains, 167 Style objects, 282\u2013283 TO search key, 370 SUBJECT search key, 369 total_seconds() method, 342, 346 sublists, getting with slices, 82\u201383 traceback, getting from error, 217\u2013218 sub() method, 163\u2013164 transparency, 388, 397 submitButtonColor variable, 432, 435 transpose() method, 399 submitButton variable, 432 triple quotes ('''), 125, 164 submit() method, 260 truetype() function, 409 subprocess module, 335, 352\u2013354 truth tables, 35\u201336 subtraction (-) operator, 15, 88 \u201ctruthy\u201d values, 53 subtractive color model, 389 tuple data type Sudoku puzzles, 4 overview, 96\u201397 sys.exit() function, 58 tuple() function, 97 twilio module, 380 TwilioRestClient objects, 381 Index\u00a0\u00a0\u00a0477","Twilio service W automatic text messages, 383 overview, 380 \\\\W character class, 158 sending text messages, 381\u2013382 \\\\w character class, 158 %w directive, 344 TypeError, 81, 94 walk() function, 202\u2013203, 354 typewrite() function, 426, 427, 430, 431, WARNING level, 223 weather data, fetching, 329\u2013332 435, 436 downloading JSON data, 330\u2013331 U getting location, 330 loading JSON data, 331\u2013332 Ubuntu, 7 overview, 329 cron, 354\u2013355 webbrowser module launching processes from open() function, 355 Python,\u00a0353 opening browser using, 234\u2013236 opening files with default WebDriver objects, 257 applications, 355 WebElement objects, 257\u2013258 Unix philosophy, 356 web scraping bs4 module UNANSWERED search key, 370 UNDELETED search key, 370 creating object from HTML, underline attribute, 311 245\u2013246 underscore (_), 20 UNDRAFT search key, 370 finding element with select() UNFLAGGED search key, 370 method, 246\u2013247 Unicode encodings, 239 Unix epoch, 336, 341, 346 getting attribute, 248 Unix philosophy, 356 overview, 245 unlink() function, 200 downloading UNSEEN search key, 370 files, 239\u2013240 upper() method, 128\u2013129 images, 251\u2013256 UTC (Coordinated Universal pages, 237\u2013238 and Google maps project, 234\u2013236 Time),\u00a0336 and Google search project, 248\u2013251 HTML V browser developer tools and, ValueError, 88, 345 242\u2013243 values, defined, 14, 150 finding elements, 244 values() method, 107\u2013108 learning resources, 240 variables. See also lists overview, 240\u2013241 viewing page source, 241\u2013242 assignment statements, 18\u201319 overview, 233\u2013234 defined, 18 requests module, 237\u2013238 global, 70\u201371 selenium module initializing, 19 clicking buttons, 261 local, 67\u201370 finding elements, 257\u2013259 naming, 20\u201321 following links, 259 None value and, 65 installing, 256 overwriting, 19\u201320 sending special keystrokes, references, 97\u201399 saving with shelve module, 184\u2013185 260\u2013261 storing as list, 84\u201385 submitting forms, 259\u2013260 Verizon mail, 363, 367 using Firefox with, 256\u2013257 volumes, defined, 174 websites, opening from script, 355 478\u00a0\u00a0\u00a0Index","while loops X getting and printing mouse coordinates using, 418 XKCD comics infinite, 418 downloading project, 251\u2013256 overview, 45\u201349 designing program, 252\u2013253 downloading web page, whitespace, removing, 134\u2013135 253\u2013254 wildcard character (.), 160\u2013162 overview, 251\u2013252 Windows OS saving image, 255\u2013256 multithreaded downloading backslash vs. forward slash, 174\u2013175 project, 350\u2013352 installing Python, 6\u20137 creating and starting threads, installing third-party modules, 442 351\u2013352 launching processes from using downloadXkcd() function, 350\u2013351 Python,\u00a0353 waiting for threads to end, 352 logging out of automation Y program,\u00a0414 opening files with default %Y directive, 344 %y directive, 344 applications, 355\u2013356 Yahoo! Mail, 363, 367 pip tool on, 441\u2013442 Python support, 4 Z running Python programs on, zipfile module 444\u2013445 creating ZIP files, 205\u2013206 starting IDLE, 7 extracting ZIP files, 205 Task Scheduler, 354 and folders, 209\u2013212 Word documents overview, 203\u2013204 adding headings, 314\u2013315 reading ZIP files, 204 creating documents with ZipFile objects, 204\u2013205 nondefault styles, 310\u2013311 ZipInfo objects, 204 format overview, 306\u2013307 getting text from, 308\u2013309 line\/page breaks, 315 pictures in, 315\u2013316 python-docx module, 306 reading, 307\u2013308 Run object attributes, 311\u2013312 styling paragraphs, 309\u2013310 writing to file, 312\u2013314 Workbook objects, 267 workbooks, Excel, 266 creating worksheets, 278 deleting worksheets, 278 opening, 267 saving, 277 Worksheet objects, 268 write() method, 183\u2013184 Writer objects, 322\u2013323 writerow() method, 323 Index\u00a0\u00a0\u00a0479","RESOURCES Visit http:\/\/nostarch.com\/automatestuff\/ for resources, errata, and more information. More no-nonsense books from No Starch Press Python Playground Python Crash Course The Linux Command Line Geeky Weekend Projects A Hands-On, Project-Based A Complete Introduction for the Curious Programmer Introduction to Programming by william e. shotts, jr. by mahesh venkitachalam by eric matthes january 2012, 480 pp., $39.95 may 2015, 304 pp., $29.95 july 2015, 624 pp., $34.95 isbn 978-1-59327-389-7 isbn 978-1-59327-604-1 isbn 978-1-59327-603-4 JavaScript for Kids Statistics Done Wrong Data Visualization with JavaScript A Playful Introduction to Programming The Woefully Complete Guide by stephen a. thomas by nick morgan by alex reinhart march 2015, 384 pp., $39.95 december 2014, 336 pp., $34.95 march 2015, 176 pp., $24.95 isbn 978-1-59327-605-8 isbn 978-1-59327-408-5 isbn 978-1-59327-620-1 full color full color email: phone: sa l es @ nosta rch.com 800.420.7240 or web: 415.863.9900 w w w.nosta rch.com","LEARN PYTHON. GET STUFF DONE. If you\u2019ve ever spent hours renaming files or updating \u2022 Send reminder emails and text notifications hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have \u2022 Fill out online forms your computer do them for you? Step-by-step instructions walk you through each In Automate the Boring Stuff with Python, you\u2019ll program, and practice projects at the end of each learn how to use Python to write programs that do in chapter challenge you to improve those programs and minutes what would take you hours to do by hand\u2014 use your newfound skills to automate similar tasks. no prior programming experience required. Once you\u2019ve mastered the basics of programming, you\u2019ll Don\u2019t spend your time doing work a well-trained create Python programs that effortlessly perform monkey could do. Even if you\u2019ve never written a line useful and impressive feats of automation to: of code, you can make your computer do the grunt work. Learn how in Automate the Boring Stuff with Python. \u2022 Search for text in a file or across multiple files ABOUT THE AUTHOR \u2022 Create, update, move, and rename files and folders Al Sweigart is a software developer and teaches pro- gramming to kids and adults. He has written several \u2022 Search the Web and download online content Python books for beginners, including Hacking Secret Ciphers with Python, Invent Your Own Computer Games \u2022 Update and format data in Excel spreadsheets with Python, and Making Games with Python & Pygame. of any size \u2022 Split, merge, watermark, and encrypt PDFs COVERS PYTHON 3 $29.95 ($34.95 CDN) THE FINEST IN GEEK ENTERTAINMENT\u2122 SHELVE IN: w w w.nostarch.com PROGRAMMING LANGUAGES\/ \u201cI LIE FLAT.\u201d PYTHON This book uses a durable binding that won\u2019t snap shut. SFI-00000"]


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook