Question: How do I load a csv file from my computer desktop into my python program? Here's what I have so far, and it isn't pulling
How do I load a csv file from my computer desktop into my python program? Here's what I have so far, and it isn't pulling any info. I am creating a contact manager program that needs to read the csv file when it's opened.
import csv
import os
contacts
def loadcontacts:
if ospath.existscontactscsv:
with opencontactscsv moder as file:
reader csvreaderfile
for row in reader:
name, email, phone row
contacts.appendname: name, "email": email, "phone": phone
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
