''' Purpose: print the contents of a CSV web file ''' # import local module url to help automate getting contents of a web resource import url # define the base folder for course csv datasets CSV_WEB_FOLDER = "http://www.cs.virginia.edu/~cs1112/datasets/csv/" # specify data source reply = input( "Enter name of dataset: " ) # clean up the reply to get file name file_name = reply.strip() # get url link for dataset link = CSV_WEB_FOLDER + file_name # get web resource dataset as rows of strings dataset = url.get_raw_dataset( link ) # echo dataset row by row for row in dataset : print( row ) print() # get web resource dataset as rows of values dataset = url.get_dataset( link ) # echo dataset row by row for row in dataset : print( row )