Python writing CSV file how to set filepath

Dear all,

I'm writing a CSV file using the below code block. How do I set the filepath where I'd like to file to be saved?

import csv

with open('output.csv', 'wb') as csvFile:
    outputwriter = csv.writer(csvFile, delimiter=',')

Thanks
AndyC1000Asked:
Who is Participating?
 
clockwatcherConnect With a Mentor Commented:
The first parameter to open is the file name and path:

with open(r'c:\some\path\somefilename.csv', 'wb') as csvFile:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.