0

Why does this Python code give rise to Error 2 [Errno 2] No such file or directory: ?

import csv
from datetime import date
today=date.today()
datum=today.strftime('%Y-%m-%d')
nyMedlemFile = open('CiviCRM_Indata/utdata/'+datum+'/nyaMedlemmar.csv', 'w')
nyMedlem = csv.writer(nyMedlemFile)

I am writing so the file should not be expected to exist. I am puzzled!

Claes

  • Does this answer your question? [Python open() gives FileNotFoundError/IOError: Errno 2 No such file or directory](https://stackoverflow.com/questions/12201928/python-open-gives-filenotfounderror-ioerror-errno-2-no-such-file-or-directory) – Sven Eberth Oct 12 '21 at 20:38
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 14 '21 at 08:28

0 Answers0