id int64 0 25.6k | text stringlengths 0 4.59k |
|---|---|
2,700 | to open file with the open(functionyou pass it string path indicating the file you want to openit can be either an absolute or relative path the open(function returns file object try it by creating text file named hello txt using notepad or textedit type helloworldas the content of this text file and save it in your us... |
2,701 | read(method returns the string that is stored in the file alternativelyyou can use the readlines(method to get list of string values from the fileone string for each line of text for examplecreate file named sonnet txt in the same directory as hello txt and write the following text in itwhenin disgrace with fortune and... |
2,702 | baconfile close(baconfile open('bacon txt'content baconfile read(baconfile close(print(contenthelloworldbacon is not vegetable firstwe open bacon txt in write mode since there isn' bacon txt yetpython creates one calling write(on the opened file and passing write(the string argument 'helloworld/nwrites the string to th... |
2,703 | it path object after running the previous code on windowsyou will see three new files in the current working directorymydata bakmydata datand mydata dir on macosonly single mydata db file will be created these binary files contain the data you stored in your shelf the format of these binary files is not importantyou on... |
2,704 | will be your very own module that you can import whenever you want to use the variable stored in it for exampleenter the following into the interactive shellimport pprint cats [{'name''zophie''desc''chubby'}{'name''pooka''desc''fluffy'}pprint pformat(cats"[{'desc''chubby''name''zophie'}{'desc''fluffy''name''pooka'}]fil... |
2,705 | be lengthy and boring affair fortunatelyyou know some python here is what the program does creates different quizzes creates multiple-choice questions for each quizin random order provides the correct answer and three random wrong answers for each questionin random order writes the quizzes to text files writes the answ... |
2,706 | todocreate the quiz and answer key files todowrite out the header for the quiz todoshuffle the order of the states todoloop through all statesmaking question for each since this program will be randomly ordering the questions and answersyou'll need to import the random module to make use of its functions the capitals v... |
2,707 | unique number for the quiz that comes from quiznumthe for loop' counter the answer key for capitalsquiz txt will be stored in text file named capitalsquiz_answers txt each time through the loopthe {quiznum placeholder in 'capitalsquiz{quiznum txtand 'capitalsquiz_answers {quiznum txtwill be replaced by the unique numbe... |
2,708 | select the full list of answer options is the combination of these three wrong answers with the correct answers finallythe answers need to be randomized so that the correct response isn' always choice step write content to the quiz and answer key files all that is left is to write the question to the quiz file and the ... |
2,709 | hartford santa fe harrisburg charleston what is the capital of coloradoa raleigh harrisburg denver lincoln --snip-the corresponding capitalsquiz_answers txt text file will look like this --snip-projectupdatable multi-clipboard let' rewrite the "multi-clipboardprogram from so that it uses the shelve module the user will... |
2,710 | window by creating batch file named mcb bat with the following content@pyw exe :\python \mcb pyw %step comments and shelf setup let' start by making skeleton script with some comments and basic setup make your code look like the following#python mcb pyw saves and loads pieces of text to the clipboard usagepy exe mcb py... |
2,711 | mcbshelf close(if the first command line argument (which will always be at index of the sys argv listis 'savethe second command line argument is the keyword for the current content of the clipboard the keyword will be used as the key for mcbshelfand the value will be the text currently on the clipboard if there is only... |
2,712 | files are organized into folders (also called directories)and path describes the location of file every program running on your computer has current working directorywhich allows you to specify file paths relative to the current location instead of always typing the full (or absolutepath the pathlib and os path modules... |
2,713 | create mad libs program that reads in text files and lets the user add their own text anywhere the word adjectivenounadverbor verb appears in the text file for examplea text file may look like thisthe adjective panda walked to the noun and then verb nearby noun was unaffected by these events the program would find thes... |
2,714 | org anizing files in the previous you learned how to create and write to new files in python your programs can also organize preexisting files on the hard drive maybe you've had the experience of going through folder full of dozenshundredsor even thousands of files and copyingrenamingmovingor compressing them all by ha... |
2,715 | programming your computer to do these tasksyou can transform it into quick-working file clerk who never makes mistakes as you begin working with filesyou may find it helpful to be able to quickly see what the extension txtpdfjpgand so onof file is with macos and linuxyour file browser most likely shows extensions autom... |
2,716 | import shutilos from pathlib import path path home(shutil copytree( 'spam' 'spam_backup'windowspath(' :/users/al/spam_backup'the shutil copytree(call creates new folder named spam_backup with the same content as the original spam folder you have now safely backed up your preciousprecious spam moving and renaming files ... |
2,717 | be careful when using move(finallythe folders that make up the destination must already existor else python will throw an exception enter the following into the interactive shellshutil move('spam txt'' :\\does_not_exist\\eggs\\ham'traceback (most recent call last)--snip-filenotfounderror[errno no such file or directory... |
2,718 | will print the filename of the file that would have been deleted running this version of the program first will show you that you've accidentally told the program to delete rxt files instead of txt files once you are certain the program works as intendeddelete the print(filenameline and uncomment the os unlink(filename... |
2,719 | delicious cats catnames txt zophie jpg walnut waffles butter txt spam txt figure - an example folder that contains three folders and four files here is an example program that uses the os walk(function on the directory tree from figure - import os for foldernamesubfoldersfilenames in os walk(' :\\delicious')print('the ... |
2,720 | range( ):you can also choose the variable names for the three values listed earlier usually use the names foldernamesubfoldersand filenames when you run this programit will output the followingthe current folder is :\delicious subfolder of :\deliciouscats subfolder of :\deliciouswalnut file inside :\deliciousspam txt t... |
2,721 | to read the contents of zip filefirst you must create zipfile object (note the capital letters and fzipfile objects are conceptually similar to the file objects you saw returned by the open(function in the previous they are values through which the program interacts with the file to create zipfile objectcall the zipfil... |
2,722 | :optionallyyou can pass folder name to extractall(to have it extract the files into folder other than the current working directory if the folder passed to the extractall(method does not existit will be created for instanceif you replaced the call at with examplezip extractall(' :\delicious')the code would extract the ... |
2,723 | to european-style dates say your boss emails you thousands of files with american-style dates (mm-dd- yin their names and needs them renamed to europeanstyle dates (dd-mm- ythis boring task could take all day to do by handlet' write program to do it instead here' what the program does it searches all the filenames in t... |
2,724 | todoform the european-style filename todoget the fullabsolute file paths todorename the files from this you know the shutil move(function can be used to rename filesits arguments are the name of the file to rename and the new filename because this function exists in the shutil moduleyou must import that module but befo... |
2,725 | skip files without date if mo =nonecontinue get the different parts of the filename beforepart mo group( monthpart mo group( daypart mo group( yearpart mo group( afterpart mo group( --snip-if the match object returned from the search(method is none then the filename in amerfilename does not match the regular expression... |
2,726 | eurofilename beforepart daypart '-monthpart '-yearpart afterpart get the fullabsolute file paths absworkingdir os path abspath('amerfilename os path join(absworkingdiramerfilenameeurofilename os path join(absworkingdireurofilenamerename the files print( 'renaming "{amerfilename}to "{eurofilename}'#shutil move(amerfilen... |
2,727 | the programthe function will be called to perform the backup make your program look like this#python backuptozip py copies an entire folder and its contents into zip file whose filename increments import zipfileos def backuptozip(folder)back up the entire contents of "folderinto zip file folder os path abspath(folderma... |
2,728 | next let' create the zip file make your program look like the following#python backuptozip py copies an entire folder and its contents into zip file whose filename increments --snip-while truezipfilename os path basename(folder'_str(numberzipif not os path exists(zipfilename)break number number create the zip file prin... |
2,729 | backuptozip(' :\\delicious'you can use os walk(in for loop and on each iteration it will return the iteration' current folder namethe subfolders in that folderand the filenames in that folder in the for loopthe folder is added to the zip file the nested for loop can go through each filename in the filenames list each o... |
2,730 | rename/delete and add print(call instead so you can run the program and verify exactly what it will do often you will need to perform these operations not only on files in one folder but also on every folder in that folderevery folder in those foldersand so on the os walk(function handles this trek across the folders f... |
2,731 | mb (remember that to get file' sizeyou can use os path getsize(from the os module print these files with their absolute path to the screen filling in the gaps write program that finds all files with given prefixsuch as spam txtspam txtand so onin single folder and locates any gaps in the numbering (such as if there is ... |
2,732 | debugging now that you know enough to write more complicated programsyou may start finding not-so-simple bugs in them this covers some tools and techniques for finding the root cause of bugs in your program to help you fix bugs faster and with less effort to paraphrase an old joke among programmerswriting code accounts... |
2,733 | feature of mu that executes program one instruction at timegiving you chance to inspect the values in variables while your code runsand track how the values change over the course of your program this is much slower than running the program at full speedbut it is helpful to see the actual values in program while it run... |
2,734 | raise exception('height must be greater than 'print(symbol widthfor in range(height )print(symbol ((width )symbolprint(symbol widthfor symwh in (('*' )(' ' )(' ' )('zz' ))tryboxprint(symwhexcept exception as errprint('an exception happenedstr(err)you can view the execution of this program at here we've defined boxprint... |
2,735 | save it as errorexample pydef spam()bacon(def bacon()raise exception('this is the error message 'spam(when you run errorexample pythe output will look like thistraceback (most recent call last)file "errorexample py"line in spam(file "errorexample py"line in spam bacon(file "errorexample py"line in bacon raise exception... |
2,736 | traceback (most recent call last)file ""line in exceptionthis is the error message in "loggingon page you'll learn how to use the logging modulewhich is more effective than simply writing this error information to text files assertions an assertion is sanity check to make sure your code isn' doing something obviously w... |
2,737 | file ""line in assertionerror unlike exceptionsyour code should not handle assert statements with try and exceptif an assert failsyour program should crash by "failing fastlike thisyou shorten the time between the original cause of the bug and when you first notice the bug this will reduce the amount of code you will h... |
2,738 | stoplight[key'yellowelif stoplight[key='yellow'stoplight[key'redelif stoplight[key='red'stoplight[key'greenswitchlights(market_ ndyou may already see the problem with this codebut let' pretend you wrote the rest of the simulation codethousands of lines longwithout noticing it when you finally do run the simulationthe p... |
2,739 | on the other handa missing log message indicates part of the code was skipped and never executed using the logging module to enable the logging module to display log messages on your screen as your program runscopy the following to the top of your program (but under the #python shebang line)import logging logging basic... |
2,740 | : : , debug start of program : : , debug start of factorial( : : , debug is total is : : , debug is total is : : , debug is total is : : , debug is total is : : , debug is total is : : , debug is total is : : , debug end of factorial( : : , debug end of program the factorial(function is returning as the factorial of wh... |
2,741 | single logging disable(logging criticalcall unlike print()the logging module makes it easy to switch between showing and hiding log messages log messages are intended for the programmernot the user the user won' care about the contents of some dictionary value you need to see to help with debugginguse log message for s... |
2,742 | : : , error an error has occurred logging critical('the program is unable to recover!' : : , critical the program is unable to recoverthe benefit of logging levels is that you can change what priority of logging message you want to see passing logging debug to the basicconfig(function' level keyword argument will show ... |
2,743 | screen clear and store the messages so you can read them after running the program you can open this text file in any text editorsuch as notepad or textedit mu' debugger the debugger is feature of the mu editoridleand other editor software that allows you to execute your program one line at time the debugger will run s... |
2,744 | clicking the continue button will cause the program to execute normally until it terminates or reaches breakpoint ( will describe breakpoints later in this if you are done debugging and want the program to continue normallyclick the continue button step in clicking the step in button will cause the debugger to execute ... |
2,745 | enabled the program will output something like thisenter the first number to add enter the second number to add enter the third number to add the sum is the program hasn' crashedbut the sum is obviously wrong run the program againthis time under the debugger when you click the debug buttonthe program pauses on line whi... |
2,746 | variables are set to strings instead of integerscausing the bug in the debug inspector paneyou should see that the firstsecondand third variables are set to string values ' '' 'and ' instead of integer values and when the last line is executedpython concatenates these strings instead of adding the numbers togethercausi... |
2,747 | the step over button thousands of times before the program terminated if you were interested in the value of heads at the halfway point of the program' executionwhen of , coin flips have been completedyou could instead just set breakpoint on the line print('halfway done!'to set breakpointclick the line number in the fi... |
2,748 | running and is much more convenient to use than the print(function because of its different logging levels and ability to log to text file the debugger lets you step through your program one line at time alternativelyyou can run your program at normal speed and have the debugger pause execution whenever it reaches line... |
2,749 | for practicewrite program that does the following debugging coin toss the following program is meant to be simple coin toss guessing game the player gets two guesses (it' an easy gamehoweverthe program has several bugs in it run through the program few times to find the bugs that keep the program from working correctly... |
2,750 | web scr aping in those rareterrifying moments when ' without wi-fii realize just how much of what do on the computer is really what do on the internet out of sheer habit 'll find myself trying to check emailread friendstwitter feedsor answer the question"did kurtwood smith have any major roles before he was in the orig... |
2,751 | make it easy to scrape web pages in python comes with python and opens browser to specific page requests downloads files and web pages from the internet bs parses htmlthe format that web pages are written in selenium launches and controls web browser the selenium module is able to fill in forms and simulate mouse click... |
2,752 | when you load addressthe url in the address bar looks something like thisgoogle com/maps/place/ +valencia+st/@ ,- , /data=! ! ! ! ! dadc : xc bb the address is in the urlbut there' lot of additional text there as well websites often add extra data to urls to help track visitors or customize sites but if you try just go... |
2,753 | make your code look like the following#python mapit py launches map in the browser using an address from the command line or clipboard import webbrowsersyspyperclip if len(sys argv get address from command line address join(sys argv[ :]elseget address from clipboard address pyperclip paste(webbrowser open('if there are... |
2,754 | the requests module lets you easily download files from the web without having to worry about complicated issues such as network errorsconnection problemsand data compression the requests module doesn' come with pythonso you'll have to install it first from the command linerun pip install --user requests (appendix has ... |
2,755 | if the request succeededthe downloaded web page is stored as string in the response object' text variable this variable holds large string of the entire playthe call to len(res textshows you that it is more than , characters long finallycalling print(res text[: ]displays only the first characters if the request failed ... |
2,756 | sure that the download has actually worked before your program continues saving downloaded files to the hard drive from hereyou can save the web page to file on your hard drive with the standard open(function and write(method there are some slight differencesthough firstyou must open the file in write binary mode by pa... |
2,757 | on your computer the write(method returns the number of bytes written to the file in the previous examplethere were , bytes in the first chunkand the remaining part of the file needed only , bytes to reviewhere' the complete process for downloading and saving file call requests get(to download the file call open(with '... |
2,758 | figure - helloworldrendered in the browser the opening tag says that the enclosed text will appear in bold the closing tags tells the browser where the end of the bold text is there are many different tags in html some of these tags have extra properties in the form of attributes within the angle brackets for exampleth... |
2,759 | highly recommend viewing the source html of some of your favorite sites it' fine if you don' fully understand what you are seeing when you look at the source you won' need html mastery to write simple web scraping programs--after allyou won' be writing your own websites you just need enough knowledge to pick out data f... |
2,760 | in firefoxyou can bring up the web developer tools inspector by pressing ctrlshift- on windows and linux or by pressing option- on macos the layout is almost identical to chrome' developer tools in safariopen the preferences windowand on the advanced pane check the show develop menu in the menu bar option after it has ... |
2,761 | once your program has downloaded web page using the requests moduleyou will have the page' html content as single string value now you need to figure out which part of the html corresponds to the information on the web page you're interested in this is where the browser' developer tools can help say you want to write p... |
2,762 | forecast part of the web page is sunnywith high near west wind to mphwith gusts as high as mph this is exactly what you were looking forit seems that the forecast information is contained inside element with the forecast-text css class right-click on this element in the browser' developer consoleand from the context me... |
2,763 | the bs beautifulsoup(function needs to be called with string containing the html it will parse the bs beautifulsoup(function returns beautifulsoup object enter the following into the interactive shell while your computer is connected to the internetimport requestsbs res requests get(res raise_for_status(nostarchsoup bs... |
2,764 | selector passed to the select(method will match soup select('div'all elements named soup select('#author'the element with an id attribute of author soup select(notice'all elements that use css class attribute named notice soup select('div span'all elements named that are within an element named soup select('div span'al... |
2,765 | html we use select('#author'to return list of all the elements with id="authorwe store this list of tag objects in the variable elemsand len(elemstells us there is one tag object in the listthere was one match calling gettext(on the element returns the element' textor inner html the text of an element is the content be... |
2,766 | first matched element in spanelem passing the attribute name 'idto get(returns the attribute' value'authorprojectopening all search results whenever search topic on googlei don' look at just one search result at time by middle-clicking search result link (or clicking while holding ctrl) open the first several links in ... |
2,767 | display text while downloading the search result page res requests get('join(sys argv[ :])res raise_for_status(todoretrieve top search result links todoopen browser tab for each result the user will specify the search terms using command line arguments when they launch the program these arguments will be stored as stri... |
2,768 | finallywe'll tell the program to open web browser tabs for our results add the following to the end of your program#python searchpypi py opens several search results import requestssyswebbrowserbs --snip-open browser tab for each result linkelems soup select(package-snippet'numopen min( len(linkelems)for in range(numop... |
2,769 | blogs and other regularly updating websites usually have front page with the most recent post as well as previous button on the page that takes you to the previous post then that post will also have previous buttonand so oncreating trail from the most recent page to the first post on the site if you wanted copy of the ... |
2,770 | download and save the comic image to the hard drive with iter_content(find the url of the previous comic linkand repeat open new file editor tab and save it as downloadxkcd py step design the program if you open the browser' developer tools and inspect the elements on the pageyou'll find the followingthe url of the com... |
2,771 | just comments that outline the rest of your program step download the web page let' implement the code for downloading the page make your code look like the following#python downloadxkcd py downloads every single xkcd comic import requestsosbs url 'starting url os makedirs('xkcd'exist_ok=truestore comics in /xkcd while... |
2,772 | print('could not find comic image 'elsecomicurl 'https:comicelem[ get('src'download the image print('downloading image % (comicurl)res requests get(comicurlres raise_for_status(todosave the image to /xkcd todoget the prev button' url print('done 'from inspecting the xkcd home page with your developer toolsyou know that... |
2,773 | you need to write this image data to file on the hard drive you'll need filename for the local image file to pass to open(the comicurl will have value like '_explanation png'--which you might have noticed looks lot like file path and in factyou can call os path basename(with comicurland it will return just the last par... |
2,774 | the url you need to pass to requests get(howeversometimes this isn' so easy to find or perhaps the website you want your program to navigate requires you to log in first the selenium module will give your programs the power to perform such sophisticated tasks controlling the browser with the selenium module the seleniu... |
2,775 | following into the interactive shellfrom selenium import webdriver browser webdriver firefox(type(browserbrowser get('you'll notice when webdriver firefox(is calledthe firefox web browser starts up calling type(on the value webdriver firefox(reveals it' of the webdriver data type and calling browser get('directs the br... |
2,776 | downloads and download the zip file for your operating system this zip file will contain chromedriver exe (on windowsor chromedriver (on macos or linuxfile that you can put on your system path other major web browsers also have webdrivers availableand you can often find these by performing an internet search for "<brow... |
2,777 | method is looking forthe selenium module raises nosuchelement exception if you do not want this exception to crash your programadd try and except statements to your code once you have the webelement objectyou can find out more about it by reading the attributes or calling the methods in table - table - webelement attri... |
2,778 | webelement objects returned from the find_element_and find_elements_methods have click(method that simulates mouse click on that element this method can be used to follow linkmake selection on radio buttonclick submit buttonor trigger whatever else might happen when the element is clicked by the mouse for exampleenter ... |
2,779 | the selenium module has module for keyboard keys that are impossible to type into string valuewhich function much like escape characters these values are stored in attributes in the selenium webdriver common keys module since that is such long module nameit' much easier to run from selenium webdriver common keys import... |
2,780 | the selenium module can simulate clicks on various browser buttons as well through the following methodsclicks the back button clicks the forward button browser refresh(clicks the refresh/reload button browser quit(clicks the close window button browser back(browser forward(more information on selenium selenium can do ... |
2,781 | what is the css selector string that would find the elements with css class of highlight what is the css selector string that would find all the elements inside another element what is the css selector string that would find the element with value attribute set to favorite say you have beautiful soup tag object stored ... |
2,782 | is simple game where you combine tiles by sliding them updownleftor right with the arrow keys you can actually get fairly high score by repeatedly sliding in an uprightdownand left pattern over and over again write program that will open the game at github io/ and keep sending uprightdownand left keystrokes to automati... |
2,783 | working with xcel spre adshee ts although we don' often think of spreadsheets as programming toolsalmost everyone uses them to organize information into two-dimensional data structuresperform calculations with formulasand produce output as charts in the next two we'll integrate python into two popular spreadsheet appli... |
2,784 | are free alternatives that run on windowsmacosand linux both libreoffice calc and openoffice calc work with excel' xlsx file format for spreadsheetswhich means the openpyxl module can work on spreadsheets from these applications as well you can download the software from if you already have excel installed on your comp... |
2,785 | automatically provides for new workbooks (the number of default sheets created may vary between operating systems and spreadsheet programs figure - the tabs for workbook' sheets are in the lower-left corner of excel sheet in the example file should look like table - (if you didn' download example xlsx from the websitey... |
2,786 | you can get list of all the sheet names in the workbook by accessing the sheetnames attribute enter the following into the interactive shellimport openpyxl wb openpyxl load_workbook('example xlsx'wb sheetnames the workbook' sheetsnames ['sheet ''sheet ''sheet 'sheet wb['sheet 'get sheet from the workbook sheet type(she... |
2,787 | the string 'applesthe row attribute gives us the integer the column attribute gives us ' 'and the coordinate attribute gives us ' openpyxl will automatically interpret the dates in column and return them as datetime values rather than strings the datetime data type is explained further in specifying column by letter ca... |
2,788 | to convert from letters to numberscall the openpyxl utils column_index_from _string(function to convert from numbers to letterscall the openpyxl utils get_column_letter(function enter the following into the interactive shellimport openpyxl from openpyxl utils import get_column_lettercolumn_index_from_string get_column_... |
2,789 | --end of row -- : : cherries --end of row -- : : pears --end of row --herewe specify that we want the cell objects in the rectangular area from to and we get generator object containing the cell objects in that area to help us visualize this generator objectwe can use tuple(on it to display its cell objects in tuple th... |
2,790 | us tuple of tuples (each containing cell objects)and columns gives us tuple of tuples (each containing cell objectsto access one particular tupleyou can refer to it by its index in the larger tuple for exampleto get the tuple that represents column byou use list(sheet columns)[ to get the tuple containing the cell obje... |
2,791 | you' still have to select the cells for each of the , -plus counties even if it takes just few seconds to calculate county' population by handthis would take hours to do for the whole spreadsheet in this projectyou'll write script that can read from the census spreadsheet file and calculate statistics for each county i... |
2,792 | you'll use to print the final county data then it opens the censuspopdata xlsx file gets the sheet with the census data and begins iterating over its rows note that you've also created variable named countydatawhich will contain the populations and number of tracts you calculate for each county before you can store any... |
2,793 | each row in the spreadsheet has data for one census tract state sheet['bstr(row)value county sheet['cstr(row)value pop sheet['dstr(row)value make sure the key for this state exists countydata setdefault(state{}make sure the key for this county in this state exists countydata[statesetdefault(county{'tracts' 'pop' }each ... |
2,794 | --snip-open new text file and write the contents of countydata to it print('writing results 'resultfile open('census py'' 'resultfile write('alldata pprint pformat(countydata)resultfile close(print('done 'the pprint pformat(function produces string that itself is formatted as valid python code by outputting it to text ... |
2,795 | check whether spreadsheet has blank rows or invalid data in any cells and alert the user if it does read data from spreadsheet and use it as the input for your python programs writing excel documents openpyxl also provides ways of writing datameaning that your programs can create and edit spreadsheet files with pythoni... |
2,796 | sheets can be added to and removed from workbook with the create_sheet(method and del operator enter the following into the interactive shellimport openpyxl wb openpyxl workbook(wb sheetnames ['sheet'wb create_sheet(add new sheet wb sheetnames ['sheet''sheet 'create new sheet at index wb create_sheet(index= title='firs... |
2,797 | dictionary key on the worksheet object to specify which cell to write to projectupdating spreadsheet in this projectyou'll write program to update cells in spreadsheet of produce sales your program will look through the spreadsheetfind specific kinds of produceand update their prices download this spreadsheet from figu... |
2,798 | open the spreadsheet file for each rowcheck whether the value in column is celerygarlicor lemon if it isupdate the price in column save the spreadsheet to new file (so that you don' lose the old spreadsheetjust in casestep set up data structure with the update information the prices that you need to update are as follo... |
2,799 | the next part of the program will loop through all the rows in the spreadsheet add the following code to the bottom of updateproduce py#python updateproduce py corrects costs in produce sales spreadsheet --snip-loop through the rows and update the prices for rownum in range( sheet max_row)skip the first row producename... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.