INDEX [nostarch ]

3y ago
25 Views
2 Downloads
221.57 KB
17 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Nixon Dill
Transcription

INDEXSymbols (assignment) operator, 9 (augmented addition assignment)operator, 87/ (augmented division assignment)operator, 87% (augmented modulus assignment)operator, 87* (augmented multiplicationassignment) operator, 87- (augmented subtraction assignment)operator, 87\ (backslash)escape character, 130–131line continuation character, 92{} (braces)in dictionaries, 111greedy vs. nongreedy matching,171, 176matching specific repetitions with,170–171 (caret symbol)matching beginning of string, 174negative character classes, 174: (colon), 29, 30, 35, 44, 80 (dollar sign), 174–175. (dot character), 206–207.* (dot-star character), 175" (double quotes), 130 (equal to) operator, 23, 24** (exponent) operator, 5/ (forward slash), 202–203division operator, 5 (greater than) operator, 23 (greater than or equal to)operator, 23# (hash character), 13, 132// (integer division/floored quotient)operator, 5 (less than) operator, 23 (less than or equal to) operator, 23% (modulus/remainder) operator, 5* (multiplication) operator, 5! (not equal to) operator, 23() (parentheses), 5, 14, 59, 96, 166 (pipe character), 168 (plus sign)addition operator, 5concatenation operator, 7, 81? (question mark), 168–169' (single quote), 7, 130[] (square brackets), 78* (star character), 169- (subtraction operator), 5''' (triple quotes), 131, 132(underscore), 11, 173Aabsolute path, 206, 209abspath() function (os.path module), 209activate() function (PyAutoGUI), 489active sheet, 302, 304add break() method (Docx), 366add heading() method (Docx), 366add paragraph() method (Docx),364, 365add picture() method (Docx), 367add run() method (Docx), 365Adding a Logo project, 460–465Adding Bullets to Wiki Markup project,147–149addition operator ( ), 5addPage() method (PyPDF2), 351–352algebraic chess notation, 119alpha transparency, 448and binary operator, 25API (application programminginterface), 381, 383append() list method, 114, 89argumentsfunction, 13, 58, 59keyword, 62argv variable (sys module), 145ASCIIbetical order, 91

assertions, 253–254, 513assignment ( ) operator, 9assignment statement, 9, 81asterisk, 169attributes, 48, 275augmented assignment operators, 87Automatic Form Filler project, 495–501BBacking Up a Folder project, 243–246back() method (Selenium), 297backslash (\), 92, 131–132BarChart() function (OpenPyXL),211–212basename() function (os.path module),211–212basicConfig() function (loggingmodule), 256Beautiful Soup, 279. See also bs4modulebinary files, 347, 215binary operatorsand, 25and comparison operators, 26–27not, 26or, 26bitwise or operator, 179blocking execution, 392blocks of code, 27Boolean data type, 22, 85binary operators, 25–26“truthy” and “falsey” values, 43using binary and comparisonoperators, 26–27box tuple, 450braces ({})in dictionaries, 111greedy vs. nongreedy matching,171, 176matching specific repetitions with,170–171break statementoverview, 39using in for loop, 44browser, opening using webbrowsermodule, 268bs4 modulecreating object from HTML, 280finding element with select()method, 280532   Indexgetting attribute, 282overview, 279built-in functions, 47Ccalling functions, 13call stack, 63–65camelcase, 11caret symbol ( )matching beginning of string, 174negative character classes, 174Cascading Style Sheets (CSS), 279case sensitivity, 11, 135, 177Cell data type (OpenPyXL), 304cells, in Excel spreadsheets, 302accessing, 304writing values to, 314center() string method, 140–142chaining method calls, 457character classes, 172creating, 173negative, 174shorthand, 172character styles, 361Chart objects, 324chdir() function (os module), 451, 205chess, 119Chrome, developer tools in, 276clear() methodOpenPyXL, 342Selenium, 294click() function (PyAutoGUI), 478clicking the mouse, 478click() method (Selenium), 295clipboard, copying and pasting,143–144close() File method, 216Cm() method (OpenPyXL), 367colon (:), 29, 30, 35, 44, 80color values, RGBA, 448–449column index from string() function(OpenPyXL), 306columns, in Excel spreadsheetssetting height and width of, 321slicing Worksheet objects to get Cellobjects, 306Combining Select Pages from ManyPDFs project, 355–358comma-delimited items, 78

command line arguments, 145, 269,384, 408comma-separated values (CSV). SeeCSV (comma-separatedvalues)commentsmultiline, 132overview, 13comparison operators, 23–25equal to ( ), 23, 24greater than ( ), 23greater than or equal to ( ), 23less than ( ), 23less than or equal to ( ), 23not equal to (! ), 23compile() function (re module), 165compressed filescreating ZIP files, 239extracting ZIP files, 238–239overview, 237reading ZIP files, 238computer screencoordinates of, 448, 476resolution of, 476concatenation operator ( )lists, 81strings, 7concurrency issues, 403conditions, 27continue statementoverview, 40using in for loop, 44convertAddress() function(EZSheets), 338Conway’s Game of Life project,102–106Coordinated Universal Time(UTC), 390coordinatesof computer screen, 448, 476of an image, 449–450copy() functioncopy module, 101Pyperclip, 143–144copy() method (Pillow), 454copy modulecopy() function, 101deepcopy() function, 101copyTo() function (EZSheets), 343copytree() function (shutilmodule), 232countdown() function (PyAutoGUI), 493Countdown project, 410cProfile module, 391crashes, programs, 4create() method (Twilio), 439, 440createSheet() function (EZSheets), 342create sheet() method (OpenPyXL), 314createSpreadsheet() function(EZSheets), 336critical() function (loggingmodule), 256CRITICAL logging level, 258cron, 408crop() method (Pillow), 453CSS (Cascading Style Sheets), 279CSV (comma-separated values)defined, 371delimiter for, 375format overview, 371line terminator for, 375module, 372reader objects, 373reading data in loop, 374writer objects, 374current working directory, 205cwd() method (pathlib module), 205D\D character class, 173\d character class, 165, 173data typesBooleans, 22defined, 7dictionaries, 111floating-point numbers, 7integers, 7lists, 78mutable vs. immutable, 94–95None value, 61strings, 7tuples, 96date arithmetic, 397datetime moduledatetime() function, 395, 400datetime objects, 305, 395, 398, 399fromtimestamp() function, 395, 400now() function, 395timedelta() function, 396, 400total seconds() method, 400debug() function (logging module), 256DEBUG logging level, 258Index   533

debuggingassertions, 253–254defined, 249getting traceback as string, 251–252logging, 255in Mu, 260–264raising exceptions, 250decimal numbers. See floating-pointnumbersdecode() method (imaplib module), 350decrypt() function (PyPDF2), 350deduplicate, 58deepcopy() function (copy module), 101def statement, 58delete messages() method (imaplibmodule), 432, 433deleting files/folderspermanently, 234using send2trash module, 235delimiter, 78, 375del statement, 82, 90dictionariesget() method, 116items() method, 114keys() method, 114lists vs., 112nesting, 125overview, 111–112setdefault() method, 116values() method, 114directories. See foldersdirname() function (os.path module), 211disable() function (logging module), 211division (/) operator, 5Document objects (Docx), 358Docx moduleadd break() method, 366add heading() method, 366add paragraph() method, 364, 365add picture() method, 367add run() method, 365Document objects, 358Font() function, 318installing, 358LineChart() function, 325Paragraph objects, 349dollar sign ( ), 174–175dot character (.), 206–207dot-dot (.) folder, 206–207dot (.) folder, 206–207dot-star character (.*), 175534   IndexdoubleClick() function(PyAutoGUI), 478double quotes ("), 130downloadAsExcel() method(EZSheets), 335downloadAsHTML() method(EZSheets), 335downloadAsODS() method (EZSheets), 335downloadAsPDF() method (EZSheets), 335downloadAsTSV() method (EZSheets), 335downloadingfiles from web, 273web pages, 271–273Downloading XKCD Comics project,286–291drag() function (PyAutoGUI), 479dragging the mouse, 479dragTo() function (PyAutoGUI), 479Draw() function (Pillow), 465, 469drawing on imagesellipses, 466lines, 466points, 466polygons, 467rectangles, 466text, 468–469dumps() function (json module), 383Eehlo() method (smtplib module),421, 422elements, HTML, 278elif statement, 30ellipse() method (Pillow), 466else statements, 29, 51emailsdeleting, 424disconnecting from server, 433fetching, 424IMAP, 424marking message as read, 430searching, 426sending, 423SMTP, 420encodings, Unicode, 273encrypt() function (PyPDF2), 350endswith() string method, 138enumerate() function, 86epoch timestamp, 390, 399equal to ( ) operator, 23, 24

error() function (logging module), 256extractText() method (PyPDF2), 349ERROR logging level, 258errorscrashes and, 4help for, xxxivescape characters, 130–131evaluatation, 4, 60Excel spreadsheetsapplication support, 301charts in, 324column width, 321converting between column lettersand numbers, 306creating documents, 313creating worksheets, 314deleting worksheets, 314font styles, 318formulas in, 319freezing panes, 322–323getting cell values, 304getting rows and columns, 306getting worksheet names, 304merging and unmerging cells, 322opening documents, 303OpenPyXL, 302overview, 301reading files, 302row height, 321saving workbooks, 313updating, 315workbooks vs., 302writing values to cells, 314Exception objects, 251exceptionsassertions and, 253–254getting traceback as string, 251–253handling, 71raising, 250–251except statement, 71–72executiondefined, 28pausing until specific time, 397terminating, 49exists() function (os.path module),214, 215exit codes, 407exit() function (sys module), 402exponent (**) operator, 5expressions, 4expunge() method (imaplib module), 432extension, file, 201EZGmail, 416–420ezgmail moduleinit() function, 416recent() function, 419search() function, 419send() function, 417summary() function, 418unread() function, 418EZSheetscredentials and token files, 330installing, 330quotas, 343revoking credentials, 332Sheet objects, 336–337Spreadsheet objects, 332–336ezsheets moduleconvertAddress() function, 338copyTo() function, 343createSheet() function, 342createSpreadsheet() function, 336downloadAsExcel() method, 335downloadAsHTML() method, 335downloadAsODS() method, 335downloadAsPDF() method, 335downloadAsTSV() method, 335getColumn() method, 340getColumnLetterOf() function, 338getColumnNumberOf() function, 338getColumns() method, 340getRow() method, 340getRows() method, 340listSpreadsheets() function, 336Spreadsheet() function, 332updateColumn() function, 340updateColumns() function, 340updateRow() function, 340updateRows() function, 340upload() function, 339Ffactory() function (Pyzmail), 425FailSafeException exceptions, 475False Boolean value, 22“falsey” values, 43Fetching Current Weather project,383–387fetch() method (imaplib module),425, 430file editor, 11Index   535

file managementabsolute vs. relative paths, 206, 209backslash vs. forward slash,202–203compressed files, 237creating directories, 207current working directory, 205opening files, 217overview, 201paths, 201–202plaintext vs. binary files, 216reading files, 217renaming files, 233, 240–243send2trash module, 235shelve module, 219shutil module, 232walking directory trees, 236writing files, 218filename, 201File objects, 217findall() method (re module), 171find element by *() methods(Selenium), 239find elements by *() methods(Selenium), 239Firefox, developer tools in, 277Firefox() function (Selenium), 292floating point numbersfloat() function, 15integer equivalence, 17overview, 7rounding, 17flow controlblocks of code, 27break statements, 39conditions, 27continue statements, 40elif statements, 30else statements, 29, 51for loops, 44, 46, 51, 84, 114if statements, 28, 51overview, 27while loops, 35, 46folders, 205absolute paths in, 206, 209absolute vs. relative paths, 206, 209backslash vs. forward slash,202–203copying, 232creating, 207, 208current working directory, 205defined, 202536   Indexdeleting permanently, 234deleting using send2trashmodule, 235file sizes, 212folder contents, 212moving, 233path validity, 214root, 202, 206renaming, 233walking, 236font data type, 318Font() function (Docx), 318font styles, in Excel spreadsheets, 318form filler project, 495Formulas (Excel), 319for statements, 44, 46, 51, 84, 114forward slash (/), 202–203division operator, 5freeze panes in Excel spreadsheets, 323fromtimestamp() function (datetimemodule), 395, 400functions. See also names of individualfunctionsarguments, 59as “black box”, 70built-in, 47def statements, 59exception handling, 71keyword arguments, 62None value and, 61overview, 59parameters, 59return values, 60GGauss, Carl Friedrich, 45Generating Random Quizzes project,221–226getActiveWindow() function(PyAutoGUI), 487get addresses() method (Pyzmail),425, 431getAllWindows() function(PyAutoGUI), 487getColumnLetterOf() function(EZSheets), 338getColumn() method (EZSheets), 340getColumnNumberOf() function(EZSheets), 338getColumns() method (EZSheets), 340getcwd() function (os module), 205get() dictionary method, 116

get() function (requests module), 271getPage() method (PyPDF2), 349get payload() method (Pyzmail),425, 432getpixel() function (Pillow), 459getRow() method (EZSheets), 340getRows() method (EZSheets), 340get sheet by name() method(OpenPyXL), 304get sheet names() method(OpenPyXL), 304getsize() function (os.path module), 212get subject() method (Pyzmail),425, 431getWindowsAt() function(PyAutoGUI), 487getWindowsWithTitle() function(PyAutoGUI), 487GIF format, 451global scope, 65, 66global statement, 68global variable, 65, 67, 68Gmail, 416Google Maps, 268graphical user interface (GUI). See GUI(graphical user interface)greater than ( ) operator, 23greater than or equal to ( )operator, 23greedy matching, 171, 176group() method (re module), 166groups, regex, 166Guess the Number program, 49–51GUI (graphical user interface)controlling the keyboardhotkey combinations, 492key names, 490pressing and releasing, 491sending string fromkeyboard, 489controlling the mouseclicking the mouse, 478dragging the mouse, 479–480moving the mouse, 477scrolling the mouse, 480–481determining mouse position,477–478image recognition, 484installing PyAutoGUI module, 474overview, 473screenshots, 482stopping program, 475Hhash character (#), 13, 132headings, Word document, 366help, with programmingasking on forums, xxxiii–xxxixonline, xxxvi–xxxviiihotkey combinations, 492hotkey() function (PyAutoGUI), 492How to Keep an Idiot Busy for Hoursproject, 194–195HTML (Hypertext Markup Language)attributes, 275browser developer tools and, 278finding elements, 280learning resources, 274overview, 274viewing page source, 275–276IIDLE (integrated development andlearning environment),xxxvif statements, 28, 51imagesadding logo to, 460–465box tuples, 450color values in, 448–449coordinates in, 449–450copying and pasting in, 454cropping, 453drawing onellipses, 466lines, 466points, 466polygons, 467rectangles, 466text, 468–469flipping, 457–459opening with Pillow, 450pixel manipulation, 459recognition of, 484resizing, 456RGBA color values, 448–449rotating, 457–459transparent pixels, 465IMAP (Internet Message AccessProtocol)defined, 424deleting messages, 432disconnecting from server, 433Index   537

IMAP (Internet Message AccessProtocol) (continued)fetching messages, 430folders, 426logging into server, 426searching messages, 426IMAPClient() function (imaplib module),424, 426IMAPClient module, 424imaplib moduledecode() method, 350delete messages() method, 432, 433expunge() method, 432fetch() method, 425, 430IMAPClient() function, 424, 426list folders() method, 426login() method, 424, 426logout() method, 425, 433search() method, 425, 427, 429select folder() method, 425,427, 430immutable data types, 94importing modules, 47import statement, 47Inches() method (OpenPyXL), 367indentation, 27IndexError exception, 79, 112indexes, 78–79, 80, 132for dictionaries. See keysfor lists, 78for strings, 132negative, 80index() method, 88infinite loop, 39info() function (logging module), 256INFO logging level, 258init() function (EZGmail), 416in operator, 116, 84, 93, 133in place modification, 89inputBool() function (PyInputPlus), 189inputChoice() function(PyInputPlus), 189inputCustom() function(PyInputPlus), 193inputDatetime() function(PyInputPlus), 189inputEmail() function (PyInputPlus), 189inputFilepath() function(PyInputPlus), 189inputFloat() function(PyInputPlus), 190input() function, 14538   IndexinputInt() function (PyInputPlus), 190inputMenu() function (PyInputPlus), 189inputNum() function (PyInputPlus),189, 190inputPassword() function(PyInputPlus), 189inputStr() function (PyInputPlus), 189input validation, 137, 187inputYesNo() function (PyInputPlus), 189insert() list method, 89integer division/floored quotient (//)operator, 5integersfloating-point equivalence, 17int() function, 15overview, 7interactive development environment(IDLE), xxxvinteractive shell, xxxv–xxxvi, 3Internet Explorer, developer toolsin, 276Internet Message Access Protocol(IMAP). See IMAP (InternetMessage Access Protocol)int() function, 15isabs() function (os.path module), 209isalnum() string method, 136isalpha() string method, 136isdecimal() string method, 136isdir() function (os.path module), 215isEncrypted() method (PyPDF2), 350isfile() function (os.path module),215, 214islower() string method, 135isspace() string method, 136istitle() string method, 136isupper() string method, 135–136items() dictionary method, 114iteration, 37iter content() method (Requests),273–274Jjoin() function (os.path module), 202join() method (threading module), 405join() string method, 138JPEG format, 451JSON (JavaScript Object Notation),371, 381json moduledumps() function, 383loads() function, 382, 385

justifying text, 140–141“Just Text Me” Module project,441–442Kkeyboardhotkey combinations, 492key names, 490pressing and releasing, 491sending string from keyboard, 489KeyboardInterrupt exception, 41keyDown() function (PyAutoGUI), 491keys, dictionary, 111keys() dictionary method, 114keyUp() function (PyAutoGUI), 491key-value pair, 111keyword arguments, 62, 91Llaunchd, 408launching programsopening files with defaultapplications, 409opening websites, 268overview, 406passing command line arguments,145, 269, 384, 408running Python scripts, 144scheduling, 408lazy matching. See non-greedymatchinglen() function, 14, 81, 84, 86less than ( ) operator, 23less than or equal to ( ) operator, 23LibreOffice, 302, 358line breaks, Word documents, 366LineChart() function (Docx), 325line continuation character, 92line() method (Pillow), 466line terminator, 375linked styles, Word documents, 361Linuxbackslash vs. forward slash, 202–203cron, 402installing Python, xxiinstalling third-party modules,507–510starting IDLE, xxxiiistarting Mu, xxxiilistdir() function (os module), 212list folders() method (imaplibmodule), 426list() function, 97, 115, 373list-like, 93, 114, 220listsappend() method, 89changing values using index, 81concatenation, 81dictionaries vs., 112finding number of values usinglen(), 81index() method, 88insert() method, 89multiple assignment trick, 85mutable vs. immutable data types,94–95negative indexes, 80nesting, 125overview, 78remove() method, 90replication, 81sort() method, 90using with for loops, 84listSpreadsheets() function(EZSheets), 336ljust() string method, 140–142loads() function (json module), 382, 385load workbook() function(OpenPyXL), 303local scope, 65, 67local variable, 65, 66locateAllOnScreen() function(PyAutoGUI), 484locateOnScreen() function(PyAutoGUI), 484logging levelsCRITICAL, 258DEBUG, 258ERROR, 258INFO, 258WARNING, 258logging modulebasicConfig() function, 256critical() function, 256debug() function, 256, 258disable() function, 211error() function, 256info() function, 256warning() function, 256login() methodimaplib module, 424, 426smtplib module, 421, 423Index   539

logout() method (imaplib module),425, 433loops, 35lower() string method, 135–136lstrip() string method, 142MmacOSbackslash vs. forward slash, 202–203installing Python, xxxiii, xxxivinstalling third-party modules,507–510launchd, 408opening files with defaultapplications, 409open program, 410pip tool on, 507–508running Python progra

Firefox, developer tools in, 277 Firefox() function (Selenium), 292 floating point numbers float() function, 15 integer equivalence, 17 overview, 7 rounding, 17 flow control blocks of code, 27 break statements, 39 conditions, 27 continue statements, 40 elif statements, 30 else statements, 29, 51 for loops, 44, 46, 51, 84, 114 if statements, 28 .

Related Documents:

Abbreviations xxix PC Carli price index PCSWD Carruthers, Sellwood, Ward, and Dalén price index PD Dutot price index PDR Drobisch index PF Fisher price index PGL Geometric Laspeyres price index PGP Geometric Paasche price index PH Harmonic average of price relatives PIT Implicit Törnqvist price index PJ Jevons price index PJW Geometric Laspeyres price index (weighted Jevons index)

S&P BARRA Value Index RU.S.sell Indices: RU.S.sell 1000 Growth Index RU.S.sell 2000 Index RU.S.sell LEAP Set RU.S.sell 3000 Value Index S&P/TSX Composite Index S&P/TSX Venture Composite Index S&P/TSX 60 Canadian Energy TrU.S.t Index S&P/TSX Capped Telecommunications Index Sector-based Indices: Airline Index Bank Index

Index numbers – Simple and weighted index numbers - Laspeyer’s and Pasche‘s index number – Fisher’s ideal index number- Marshall Edgeworth’s index number – Tests to be satisfied by an ideal index number- uses of index numbers. Recommended Texts: 1. S.P. Gupta – Statistical Methods 2.

This map does not display non-motorized uses, over-snow uses, . Fort Polk Kurthwood Cravens Gardner Forest Hill 117 28 10 107 1200 113 112 111 118 121 28 121 399 468 496 28 112 488 463 465 MAP INDEX 8 MAP INDEX 1 MAP INDEX 3 MAP INDEX 2 MAP INDEX 4 MAP INDEX 5 MAP INDEX 7 MAP I

DOW'S FIRE & EXPLOSION INDEX HAZARD CLASSIFICATION GUIDE SEVENTH EDITION a AIChE techrzical manual published by the American Institute of Chemical Engineers 345 East 47th Street, New York, NY 10017 0 1994 . C1.jpgFile Size: 788KBPage Count: 9Explore furtherDow Fire and Explosion Index (F&EI) AIChEwww.aiche.orgDOW FIRE AND EXPLOSION INDEX pdfeasystudy.infoDow Fire and Explosion Index (Dow F&EI) and Mond Indexwww.slideshare.netDow's Fire and Explosion Index Hazard Classification Guide .www.wiley.com(PDF) Dow's fire and explosion index: a case-study in the .www.researchgate.netRecommended to you based on what's popular Feedback

U.S. Debt Index Non-LendableFund F, Equity Index Non-Lendable Fund F, Russell 2500 Index Non-LendableFund F, BlackRock MSCI ACWI ex-U.S. Index Non-Lendable Fund F, Russell 1000 Index Non-Lendable Fund F This form is submitted in connection with an amendment to the Investment Agreement or a proposed consent to amend the Investment Agreement.

logic relationship between the 1D element index (the nth element) and the 1D global node indices of the vertices of the elements, through the 2D element index (the natural \row" index r e and \column" index c e of an element in the 2D mesh) and the 2D node index (the natural \row" index r n and \column" index c n of a node in the 2D mesh) 11/103

The Nasdaq Clean Edge Green Energy Equal Weighted Index is an equal weighted index. The value of the Index equals the aggregate value of the Index share weights, also known as the Index Shares, of each of the Index Securities multiplied by each such security's Last