Created
May 30, 2018 20:41
-
-
Save quasarj/2bdc638434a38aaadad5368dd18e7bc2 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv # Used for reading from CSV files | |
import requests # Used for submitting to the webserver for grading | |
def process_row(row): | |
"""You must implement this function!""" | |
print(row) | |
return row | |
def main(): | |
"""Read rows from the CSV file, process them, and submit | |
YOU WILL NOT NEED TO MODIFY ANYTHING IN THIS FUNCTION! | |
""" | |
with open('data.csv', 'r') as csvfile: | |
reader = csv.reader(csvfile) | |
next(reader) # skip the header row | |
for row in reader: | |
result = process_row(row) | |
requests.post('http://localhost:5000/image', json=result) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment