id int64 0 25.6k | text stringlengths 0 4.59k |
|---|---|
2,800 | styling certain cellsrowsor columns can help you emphasize important areas in your spreadsheet in the produce spreadsheetfor exampleyour program could apply bold text to the potatogarlicand parsnip rows or perhaps you want to italicize every row with cost per pound greater than $ styling parts of large spreadsheet by h... |
2,801 | variable you then assign that variable to cell object' font attribute for examplethis code creates various font stylesimport openpyxl from openpyxl styles import font wb openpyxl workbook(sheet wb['sheet'fontobj font(name='times new roman'bold=truesheet[' 'font fontobj sheet[' ''bold times new romanfontobj font(size= i... |
2,802 | to formula that calculates the sum of values in cells to you can see this in action in figure - figure - cell contains the formula =sum( : )which adds the cells to an excel formula is set just like any other text value in cell enter the following into the interactive shellimport openpyxl wb openpyxl workbook(sheet wb a... |
2,803 | large number of spreadsheet filesit will be much quicker to write python program to do it rows and columns can also be hidden entirely from view or they can be "frozenin place so that they are always visible on the screen and appear on every page when the spreadsheet is printed (which is handy for headerssetting row he... |
2,804 | rectangular area of cells can be merged into single cell with the merge_cells(sheet method enter the following into the interactive shellimport openpyxl wb openpyxl workbook(sheet wb active sheet merge_cells(' : 'merge all these cells sheet[' ''twelve cells merged together sheet merge_cells(' : 'merge these two cells s... |
2,805 | openpyxleach worksheet object has freeze_panes attribute that can be set to cell object or string of cell' coordinates note that all rows above and all columns to the left of this cell will be frozenbut the row and column of the cell itself will not be frozen to unfreeze all panesset freeze_panes to none or ' table - s... |
2,806 | openpyxl supports creating barlinescatterand pie charts using the data in sheet' cells to make chartyou need to do the following create reference object from rectangular selection of cells create series object by passing in the reference object create chart object append the series object to the chart object add the ch... |
2,807 | chartobj openpyxl chart barchart(chartobj title 'my chartchartobj append(seriesobjsheet add_chart(chartobj' 'wb save('samplechart xlsx'this produces spreadsheet that looks like figure - the top-left corner is in figure - spreadsheet with chart added we've created bar chart by calling openpyxl chart barchart(you can als... |
2,808 | for the following questionsimagine you have workbook object in the variable wba worksheet object in sheeta cell object in cella comment object in command an image object in img what does the openpyxl load_workbook(function returnwhat does the wb sheetnames workbook attribute containhow would you retrieve the worksheet ... |
2,809 | row and column should be used for labels and should be in bold blank row inserter create program blankrowinserter py that takes two integers and filename string as command line arguments let' call the first integer and the second integer starting at row nthe program should insert blank rows into the spreadsheet for exa... |
2,810 | you can write this program by using nested for loops to read the spreadsheet' data into list of lists data structure this data structure could have sheetdata[ ][yfor the cell at column and row thenwhen writing out the new spreadsheetuse sheetdata[ ][xfor the cell at column and row text files to spreadsheet write progra... |
2,811 | working with google shee ts google sheetsthe freeweb-based spreadsheet application available to anyone with google account or gmail addresshas become usefulfeature-rich competitor to excel google sheets has its own apibut this api can be confusing to learn and use this covers the ezsheets third-party moduledocumented a... |
2,812 | to google' servers and make api requests ezsheets handles the interaction with these modulesso you don' need to concern yourself with how they work obtaining credentials and token files before you can use ezsheetsyou need to enable the google sheets and google drive apis for your google account visit the following web ... |
2,813 | browser window for you to log in to your google account click allowas shown in figure - figure - allowing quickstart to access your google account the message about quickstart comes from the fact that you downloaded the credentials file from the google sheets python quickstart page note that this window will open twice... |
2,814 | if you accidentally share the credential or token files with someonethey won' be able to change your google account passwordbut they will have access to your spreadsheets you can revoke these files by going to the google cloud platform developer' console page at account to view this page click the credentials link on t... |
2,815 | while most of your work will involve modifying the sheet objectsyou can also modify spreadsheet objectsas you'll see in the next section creatinguploadingand listing spreadsheets you can make new spreadsheet object from an existing spreadsheeta blank spreadsheetor an uploaded spreadsheet to make spreadsheet object from... |
2,816 | spreadsheet by passing the spreadsheet' full url to the function orif there is only one spreadsheet in your google account with that titleyou can pass the title of the spreadsheet as string to make newblank spreadsheetcall the ezsheets createspreadsheet(function and pass it string for the new spreadsheet' title for exa... |
2,817 | ss sheettitles the titles of all the sheet objects ('students''classes''resources'ss sheets the sheet objects in this spreadsheetin order (<sheet sheetid= title='classes'rowcount= columncount= ><sheet sheetid= title='resources'rowcount= columncount= >ss[ the first sheet object in this spreadsheet ss['students'sheets ca... |
2,818 | the sheet object' index attribute to see "creating and deleting sheetson page for information on how to do this the download functions all return string of the downloaded file' filename you can also specify your own filename for the spreadsheet by passing the new filename to the download functionss downloadasexcel('a_d... |
2,819 | ss sheets[ gets the first sheet object in this spreadsheet ss[ also gets the first sheet object in this spreadsheet you can also obtain sheet object with the square brackets operator and string of the sheet' name the spreadsheet object' sheettitles attribute holds tuple of all the sheet titles for exampleenter the foll... |
2,820 | multiple users can update sheet simultaneously to refresh the local data in the sheet objectcall its refresh(methodsheet refresh(all of the data in the sheet object is loaded when the spreadsheet object is first loadedso the data is read instantly howeverwriting values to the online spreadsheet requires network connect... |
2,821 | the ' string-style addresses are convenient if you're typing addresses into your source code but the (columnrowtuple-style addresses are convenient if you're looping over range of addresses and need numeric form for the column the convertaddress()getcolumnletterof()and getcolumnnumberof(functions are helpful when you n... |
2,822 | sheet updaterow( ['pumpkin'' '' '' ']sheet getrow( ['pumpkin'' '' '' '''''columnone sheet getcolumn( for ivalue in enumerate(columnone)make the python list contain uppercase stringscolumnone[ivalue upper(sheet updatecolumn( columnoneupdate the entire column in one request the getrow(and getcolumn(functions retrieve the... |
2,823 | this is because the uploaded sheet has column count of but we have only columns of data you can read the number of rows and columns in sheet with the rowcount and columncount attributes then by setting these valuesyou can change the size of the sheet sheet rowcount the number of rows in the sheet sheet columncount the ... |
2,824 | sheets ss createsheet('eggs'create another new sheet ss sheettitles ('sheet ''spam''eggs'ss createsheet('bacon' create sheet at index in the list of sheets ss sheettitles ('bacon''sheet ''spam''eggs'these instructions add three new sheets to the spreadsheet"bacon,"spam,and "eggs(in addition to the default "sheet "the s... |
2,825 | ss sheettitles ('sheet ''eggs'sheet ss['eggs'assign variable to the "eggssheet sheet delete(delete the "eggssheet ss sheettitles ('sheet ',ss[ clear(clear all the cells on the "sheet sheet ss sheettitles the "sheet sheet is empty but still exists ('sheet ',deleting sheets is permanentthere' no way to recover the data h... |
2,826 | exceed this quota will raise the googleapiclient errors httperror "quota exceeded for quota groupexception ezsheets will automatically catch this exception and retry the request when this happensthe function calls to read or write data will take several seconds (or even full minute or twobefore they return if the reque... |
2,827 | what functions will create new spreadsheet object and new sheet objectrespectively what will happen ifby making frequent read and write requests with ezsheetsyou exceed your google account' quotapractice projects for practicewrite programs to do the following tasks downloading google forms data google forms allows you ... |
2,828 | howeverthere is mistake in one of the , rows in this sheet that' too many rows to check by hand luckilyyou can write script that checks the totals as hintyou can access the individual cells in row with ss[ getrow (rownum)where ss is the spreadsheet object and rownum is the row number remember that row numbers in google... |
2,829 | working with pdf and word documents pdf and word documents are binary fileswhich makes them much more complex than plaintext files in addition to textthey store lots of fontcolorand layout information if you want your programs to read or write to pdfs or word documentsyou'll need to do more than simply pass their filen... |
2,830 | important that you install this version because future versions of pypdf may be incompatible with the code to install itrun pip install --user pypdf =from the command line this module name is case sensitiveso make sure the is lowercase and everything else is uppercase (check out appendix for full details about installi... |
2,831 | the following into the interactive shellimport pypdf pdffileobj open('meetingminutes pdf''rb'pdfreader pypdf pdffilereader(pdffileobjpdfreader numpages pageobj pdfreader getpage( pageobj extracttext('ooffffiicciiaall bbooaarrdd mmiinnuutteess meeting of march \ the board of elementary and secondary education shall prov... |
2,832 | true pdfreader getpage( traceback (most recent call last)file ""line in pdfreader getpage(--snip-file " :\python \lib\site-packages\pypdf \pdf py"line in getobject raise utils pdfreaderror("file has not been decrypted"pypdf utils pdfreaderrorfile has not been decrypted pdfreader pypdf pdffilereader(open('encrypted pdf'... |
2,833 | copy pages from the pdffilereader objects into the pdffilewriter object finallyuse the pdffilewriter object to write the output pdf creating pdffilewriter object creates only value that represents pdf document in python it doesn' create the actual pdf file for thatyou must call the pdffilewriter' write(method the write... |
2,834 | to the pdffilewriter object get the page object by calling getpage(on pdffilereader object then pass that page object to your pdffilewriter' addpage(method these steps are done first for pdf reader and then again for pdf reader when you're done copying pageswrite new pdf called combinedminutes pdf by passing file objec... |
2,835 | rotated degrees clockwise overlaying pages pypdf can also overlay the contents of one page over anotherwhich is useful for adding logotimestampor watermark to page with pythonit' easy to add watermarks to multiple files and only to pages your program specifies download watermark pdf from place the pdf in the current wo... |
2,836 | getpage( to get page object for the first page and store this object in minutesfirstpage we then make pdffilereader object for watermark pdf and call mergepage(on minutesfirstpage the argument we pass to mergepage(is page object for the first page of watermark pdf now that we've called mergepage(on minutesfirstpageminu... |
2,837 | it will be used for both passwords in this examplewe copied the pages of meetingminutes pdf to pdffilewriter object we encrypted the pdffilewriter with the password swordfishopened new pdf called encryptedminutes pdfand wrote the contents of the pdffilewriter to the new pdf before anyone can view encryptedminutes pdfth... |
2,838 | pdffiles [for filename in os listdir(')if filename endswith(pdf')pdffiles append(filenamepdffiles sort(key str lowerpdfwriter pypdf pdffilewriter(todoloop through all the pdf files todoloop through all the pages (except the firstand add them todosave the resulting pdf to file after the shebang line and the descriptive ... |
2,839 | for each pdfyou'll want to loop over every page except the first add this code to your program#python combinepdfs py combines all the pdfs in the current working directory into single pdf import pypdf os --snip-loop through all the pdf files for filename in pdffiles--snip-loop through all the pages (except the firstand... |
2,840 | pdfoutput close(passing 'wbto open(opens the output pdf fileallminutes pdfin writebinary mode thenpassing the resulting file object to the write(method creates the actual pdf file call to the close(method finishes the program ideas for similar programs being able to create pdfs from the pages of other pdfs will let you... |
2,841 | colorand other styling information associated with it style in word is collection of these attributes run object is contiguous run of text with the same style new run object is needed whenever the text style changes reading word documents let' experiment with the docx module download demo docx from nostarch com/automat... |
2,842 | if you care only about the textnot the styling informationin the word documentyou can use the gettext(function it accepts filename of docx file and returns single string value of its text open new file editor tab and enter the following codesaving it as readdocx py#python import docx def gettext(filename)doc docx docum... |
2,843 | in word for windowsyou can see the styles by pressing ctrl-altshift- to display the styles panewhich looks like figure - on macosyou can view the styles pane by clicking the view styles menu item figure - display the styles pane by pressing ctrlaltshift- on windows word and other word processors use styles to keep the ... |
2,844 | to the end of its name for exampleto set the quote linked style for paragraph objectyou would use paragraphobj style 'quote'but for run objectyou would use runobj style 'quote charin the current version of python-docx ()the only styles that can be used are the default word styles and the styles in the opened docx new s... |
2,845 | attribute description bold the text appears in bold italic the text appears in italic underline the text is underlined strike the text appears with strikethrough double_strike the text appears with double strikethrough all_caps the text appears in capital letters small_caps the text appears in capital letterswith lower... |
2,846 | the styles of paragraphs and runs look in restyled docx figure - the restyled docx file you can find more complete documentation on python-docx' use of styles at writing word documents enter the following into the interactive shellimport docx doc docx document(doc add_paragraph('helloworld!'doc save('helloworld docx'to... |
2,847 | with the new paragraph' text or to add text to the end of an existing paragraphyou can call the paragraph' add_run(method and pass it string enter the following into the interactive shellimport docx doc docx document(doc add_paragraph('hello world!'paraobj doc add_paragraph('this is second paragraph 'paraobj doc add_pa... |
2,848 | calling add_heading(adds paragraph with one of the heading styles enter the following into the interactive shelldoc docx document(doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc save('headings docx'the arguments to add_heading(are str... |
2,849 | on the first page and this is on the second pageon the second even though there was still plenty of space on the first page after the text this is on the first page!we forced the next paragraph to begin on new page by inserting page break after the first run of the first paragraph adding pictures document objects have ... |
2,850 | docobj saveas(pdffilenamefileformat=wdformatpdfdocobj close(wordobj quit(to write program that produces pdfs with your own contentyou must use the docx module to create word documentthen use the pywin package' win com client module to convert it to pdf replace the code to create word document goes here comment with doc... |
2,851 | what methods do you use to rotate pagewhat method returns document object for file named demo docxwhat is the difference between paragraph object and run objecthow do you obtain list of paragraph objects for document object that' stored in variable named doc what type of object has boldunderlineitalicstrikeand outline ... |
2,852 | break after the last paragraph of each invitation this wayyou will need to open only one word document to print all of the invitations at once figure - the word document generated by your custom invite script you can download sample guests txt file from /automatestuff brute-force pdf password breaker say you have an en... |
2,853 | working with csv files nd json data in you learned how to extract text from pdf and word documents these files were in binary formatwhich required special python modules to access their data csv and json fileson the other handare just plaintext files you can view them in text editorsuch as mu but python also comes with... |
2,854 | each line in csv file represents row in the spreadsheetand commas separate the cells in the row for examplethe spreadsheet example xlsx from : ,apples, : ,cherries, : ,pears, : ,oranges, : ,apples, : ,bananas, : ,strawberries, will use this file for this interactive shell examples you can download example csv from text... |
2,855 | to read data from csv file with the csv moduleyou need to create reader object reader object lets you iterate over lines in the csv file enter the following into the interactive shellwith example csv in the current working directoryimport csv examplefile open('example csv'examplereader csv reader(examplefileexampledata... |
2,856 | for large csv filesyou'll want to use the reader object in for loop this avoids loading the entire file into memory at once for exampleenter the following into the interactive shellimport csv examplefile open('example csv'examplereader csv reader(examplefilefor row in examplereaderprint('row #str(examplereader line_num... |
2,857 | file will be double-spaced the writerow(method for writer objects takes list argument each value in the list is placed in its own cell in the output csv file the return value of writerow(is the number of characters written to the file for that row (including newline charactersthis code produces an output csv file that ... |
2,858 | is newline you can change characters to different values by using the delimiter and lineterminator keyword arguments with csv writer(passing delimiter='\tand lineterminator='\ \nchanges the character between cells to tab and the character between rows to two newlines we then call writerow(three times to give us three r... |
2,859 | column headers in the first rowthe dictreader object would use : ''apples'and ' as the dictionary keys to avoid thisyou can supply the dictreader(function with second argument containing made-up header namesimport csv examplefile open('example csv'exampledictreader csv dictreader(examplefile['time''name''amount']for ro... |
2,860 | passed to writerow(doesn' matterthey're written in the order of the keys given to dictwriter(for exampleeven though you passed the phone key and value before the name and pet keys and values in the fourth rowthe phone number still appeared last in the output notice also that any missing keyssuch as 'petin {'name''bob''... |
2,861 | import csvos os makedirs('headerremoved'exist_ok=trueloop through every file in the current working directory for csvfilename in os listdir(')if not csvfilename endswith(csv')continue skip non-csv files print('removing header from csvfilename 'todoread the csv file in (skipping first rowtodowrite out the csv file the o... |
2,862 | line in the csv file it is currently reading another for loop will loop over the rows returned from the csv reader objectand all rows but the first will be appended to csvrows as the for loop iterates over each rowthe code checks whether readerobj line_num is set to if soit executes continue to move on to the next row ... |
2,863 | removing header from naics_data_ csv this program should print filename each time it strips the first line from csv file ideas for similar programs the programs that you could write for csv files are similar to the kinds you could write for excel filessince they're both spreadsheet files you could write programs to do ... |
2,864 | scrape raw data from websites (accessing apis is often more convenient than downloading web pages and parsing html with beautiful soup automatically download new posts from one of your social network accounts and post them to another account for exampleyou could take your tumblr posts and post them to facebook create "... |
2,865 | print jsondataaspythonvalue writing json with the dumps(function the json dumps(function (which means "dump string,not "dumps"will translate python value into string of json-formatted data enter the following into the interactive shellpythonvalue {'iscat'true'micecaught' 'name''zophie''felineiq'noneimport json stringof... |
2,866 | the api key secretanyone who knows it can write scripts that use your account' usage quota step get location from the command line argument the input for this program will come from the command line make getopenweather py look like this#python getopenweather py prints the weather for location from the command line appi... |
2,867 | openweathermap org provides real-time weather information in json format first you must sign up for free api key on the site (this key is used to limit how frequently you make requests on their serverto keep their bandwidth costs down your program simply has to download the page at openweathermap org/data/ /forecast/da... |
2,868 | 'temp'{'day' 'eve' 'max' 'min' 'morn' 'night' }'weather'[{'description''sky is clear''icon'' '--snip-you can see this data by passing weatherdata to pprint pprint(you may want to check these fields mean for examplethe online documentation will tell you that the after 'dayis the daytime temperature in kelvinnot celsius ... |
2,869 | clouds few clouds day after tomorrowclear sky is clear (the weather is one of the reasons like living in san francisco!ideas for similar programs accessing weather data can form the basis for many types of programs you can create similar programs to do the followingcollect weather forecasts for several campsites or hik... |
2,870 | what method takes list argument and writes it to csv filewhat do the delimiter and lineterminator keyword arguments dowhat function takes string of json data and returns python data structurewhat function takes python data structure and returns string of json datapractice project for practicewrite program that does the... |
2,871 | keeping timesche dul ing ta sksand aunching progr ams running programs while you're sitting at your computer is finebut it' also useful to have programs run without your direct supervision your computer' clock can schedule programs to run code at some specified time and date or at regular intervals for exampleyour prog... |
2,872 | your computer' system clock is set to specific datetimeand time zone the built-in time module allows your python programs to read the system clock for the current time the time time(and time sleep(functions are the most useful in the time module the time time(function the unix epoch is time reference commonly used in p... |
2,873 | the result is digits long took seconds to calculate note another way to profile your code is to use the cprofile run(functionwhich provides much more informative level of detail than the simple time time(technique the cprofile run(function is explained at /profile html the return value from time time(is usefulbut not h... |
2,874 | release your program to execute other code--until after the number of seconds you passed to time sleep(has elapsed for exampleif you enter time sleep( yyou'll see that the next prompt (doesn' appear until seconds have passed rounding numbers when working with timesyou'll often encounter float values with many digits af... |
2,875 | find the current time by calling time time(and store it as timestamp at the start of the programas well as at the start of each lap keep lap counter and increment it every time the user presses enter calculate the elapsed time by subtracting timestamps handle the keyboardinterrupt exception so the user can press ctrl- ... |
2,876 | tryv while trueinput( laptime round(time time(lasttime totaltime round(time time(starttime print('lap #% % (% )(lapnumtotaltimelaptime)end=''lapnum + lasttime time time(reset the last lap time except keyboardinterrupthandle the ctrl- exception to keep its error message from displaying print('\ndone 'if the user presses... |
2,877 | the time module is useful for getting unix epoch timestamp to work with but if you want to display date in more convenient formator do arithmetic with dates (for examplefiguring out what date was days ago or what date is days from now)you should use the datetime module the datetime module has its own datetime data type... |
2,878 | true halloween newyears false newyears halloween true newyears !oct true make datetime object for the first moment (midnightof october and store it in halloween make datetime object for the first moment of january and store it in newyears then make another object for midnight on october and store it in oct comparing ha... |
2,879 | datetime values for exampleto calculate the date , days from nowenter the following into the interactive shelldt datetime datetime now(dt datetime datetime( thousanddays datetime timedelta(days= dt thousanddays datetime datetime( firstmake datetime object for the current moment and store it in dt then make timedelta ob... |
2,880 | computer doesn' waste cpu processing cycles simply checking the time over and over ratherthe while loop will just check the condition once per second and continue with the rest of the program after halloween (or whenever you program it to stopconverting datetime objects into strings epoch timestamps and datetime object... |
2,881 | in oct st passing strftime(the custom format string '% /% /% % :% :%sreturns string containing and separated by slashes and and separated by colons passing '% :%mpreturns ' : pm'and passing "% of '%yreturns "october of ' note that strftime(doesn' begin with datetime datetime converting strings into datetime objects if ... |
2,882 | this function returns an epoch timestamp float value of the current moment time sleep(secondsthis function stops the program for the number of seconds specified by the seconds argument datetime datetime(yearmonthdayhourminutesecondthis function returns datetime object of the moment specified by the arguments if hourmin... |
2,883 | discussion of flow controlwhen you imagined the execution of program as placing your finger on line of code in your program and moving to the next line or wherever it was sent by flow control statement singlethreaded program has only one finger but multithreaded program has multiple fingers each finger still moves to t... |
2,884 | that has been executing the time sleep( callpauses for seconds after it wakes from its -second napit prints 'wake up!and then returns from the takeanap(function chronologically'wake up!is the last thing printed by the program normally program terminates when the last line of code in the file has run (or the sys exit(fu... |
2,885 | return value (print()' return value is always noneas the target keyword argument it doesn' pass the print(function itself when passing arguments to function in new threaduse the threading thread(function' args and kwargs keyword arguments concurrency issues you can easily create several new threads and have them all ru... |
2,886 | com/ /thread that you create will call downloadxkcd(and pass different range of comics to download add the following code to your threadeddownloadxkcd py program#python threadeddownloadxkcd py downloads xkcd comics using multiple threads import requestsosbs threading os makedirs('xkcd'exist_ok=truestore comics in /xkcd... |
2,887 | now that we've defined downloadxkcd()we'll create the multiple threads that each call downloadxkcd(to download different ranges of comics from the xkcd website add the following code to threadeddownloadxkcd py after the downloadxkcd(function definition#python threadeddownloadxkcd py downloads xkcd comics using multiple... |
2,888 | for downloadthread in downloadthreadsdownloadthread join(print('done 'the 'done string will not be printed until all of the join(calls have returned if thread object has already completed when its join(method is calledthen the method will simply return immediately if you wanted to extend this program with code that run... |
2,889 | the program' filename to subprocess popen((on windowsright-click the application' start menu item and select properties to view the application' filename on macosctrl-click the application and select show package contents to find the path to the executable file the popen(function will then immediately return keep in mi... |
2,890 | check whether poll(returns none it shouldas the process is still running then we close the ms paint program and call wait(on the terminated process now wait(and poll()return indicating that the process terminated without errors note unlike mspaint exeif you run calc exe on windows using subprocess popen()you'll notice ... |
2,891 | the webbrowser open(function can launch web browser from your program to specific websiterather than opening the browser application with subprocess popen(see "projectmapit py with the webbrowser moduleon page for more details running other python scripts you can launch python script from python just like any other app... |
2,892 | passing it list containing the program name (in this example'startfor windowsand the filename we also pass the shell=true keyword argumentwhich is needed only on windows the operating system knows all of the file associations and can figure out that it should launchsaynotepad exe to handle the hello txt file on macosth... |
2,893 | todoat the end of the countdownplay sound file after importing time and subprocessmake variable called timeleft to hold the number of seconds left in the countdown it can start at --or you can change the value here to whatever you needor even have it get set from command line argument in while loopyou display the remai... |
2,894 | countdown is simple delay before continuing the program' execution this can also be used for other applications and featuressuch as the followinguse time sleep(to give the user chance to press ctrl- to cancel an actionsuch as deleting files your program can print "press ctrl- to cancelmessage and then handle any keyboa... |
2,895 | what does the round(function returnwhat is the difference between datetime object and timedelta objectusing the datetime modulewhat day of the week was january say you have function named spam(how can you call this function and run the code inside it in separate threadwhat should you do to avoid concurrency issues with... |
2,896 | sending email and te messages checking and replying to email is huge time sink of courseyou can' just write program to handle all your email for yousince each message requires its own response but you can still automate plenty of email-related tasks once you know how to write programs that can send and receive email fo... |
2,897 | read emails from gmail accountsas well as python module for using the standard smtp and imap email protocols warning highly recommend you set up separate email account for any scripts that send or receive emails this will prevent bugs in your programs from affecting your personal email account (by deleting emails or ac... |
2,898 | isn' verified,but this is fineclick advanced and then go to quickstart (unsafe(if you write python scripts for others and don' want this warning appearing for themyou'll need to learn about google' app verification processwhich is beyond the scope of this book when the next page prompts you with "quickstart wants to ac... |
2,899 | go through the login process again to obtain new token json file reading mail from gmail account gmail organizes emails that are replies to each other into conversation threads when you log in to gmail in your web browser or through an appyou're really looking at email threads rather than individual emails (even if the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.