daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CODE,PRODUCT
  2. 101,item_1
  3. 101,item_1
  4. 101,item_2
  5. 102,item_3
  6. 103,item_2
  7. 104,item_5
  8.    
  9. {101:{'item_1':2, 'item_2':1},
  10. 102:{'item_3':1},
  11. 103:{'item_2':1},
  12. 104:{'item_5':1}
  13.    
  14. import csv
  15. def csv_reader(file_obj):
  16.     reader = csv.reader(file_obj)
  17.     for row in reader:
  18.         print(" ".join(row))
  19. if __name__ == "__main__":
  20.     csv_path = 'g.csv'
  21.     with open(csv_path, "r") as f_obj:
  22.         csv_reader(f_obj)
  23.    
  24. {101:{'item_1':2, 'item_2':1},
  25.     102:{'item_3':1},
  26.     103:{'item_2':1},
  27.     104:{'item_5':1}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top