Skip to content

Instantly share code, notes, and snippets.

@quasarj
Created May 30, 2018 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quasarj/2bdc638434a38aaadad5368dd18e7bc2 to your computer and use it in GitHub Desktop.
Save quasarj/2bdc638434a38aaadad5368dd18e7bc2 to your computer and use it in GitHub Desktop.
test
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