Can anyone help me with this python program?

Kunal Desai
import csv
with open(r'C:\Users\Kunal Desai\workspace\Kunal\Kunal.csv') as csvfile:
     readCSV = csv.reader(csvfile,delimiter=',')
     print(readCSV)    

Its just printing

Traceback (most recent call last):

File "C:\Users\Kunal Desai\workspace\Kunal\data.py", line 2, in

with open(r'C:/Users/Kunal Desai/workspace/Kunal/Kunal.csv') as csvfile:

FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Kunal

Desai/workspace/Kunal/Kunal.csv'

Anedar

The Python documentation has a short example how to read CSVs:

>>> import csv
>>> with open('eggs.csv', 'rb') as csvfile:
...     spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
...     for row in spamreader:
...         print ', '.join(row)
Spam, Spam, Spam, Spam, Spam, Baked Beans
Spam, Lovely Spam, Wonderful Spam

It shows, that the result of csv.reader() is an object you have to iterate over instead of printing it directly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can anyone help me to use the enter key to execute this program?

Can anyone help me with my library catalog C program?

Can anyone help me with this error

Can anyone help me with these minidumps?

Can anyone help me with this javascript?

Can anyone help me debug it?

Can anyone help me what is wrong with my python script?

Can anyone help me with reading a continuously updating video file with python?

Can anyone help me with this SQLite 3 Python Operational Error?

Can anyone help me understand how value is assigned to Dictionary in python?

Can anyone help me how to creat a c program prints the center of the words inside a sentance?

When I use CMake to compile a program to catch an exception, a compile error occurs. Anyone can help me?

Can anyone help me in this design problem?

can anyone help me to resize the javaFX scene

can anyone help me to resolve MultiValueDictKeyError in django

Can anyone help me to find a error in PHP?

Can anyone help me in the below scenario in Talend

can anyone help me to turn this to js syntax?

Can anyone help me with aligning a icon by CSS?

Can anyone help me fix grub?

Can anyone help me in below scenario on DAC

Can anyone help me with this StackOverFlow.Exception?

Can anyone help me to optimize my query?

Can anyone help me convert this paperscript to javascript?

Can anyone help me installing PYPY on windows?

Can anyone help me with a PIPELINED function?

Can anyone help me with this drawback with Hibernate and JSF?

Can anyone help me to make require working?

Can anyone help me with this simple For Loop?