I'm trying to create a file file a unique file name, every time my script is ran, it's only intended to be weekly or monthly. so I chose to use the date for the file name.
f = open('%s.csv', 'wb') %name
Traceback (most recent call last):
File "C:\Users\User\workspace\new3\stjohnsinvoices\BabblevoiceInvoiceswpath.py", line 143, in <module>
f = open('%s.csv', 'ab') %name
TypeError: unsupported operand type(s) for %: 'file' and 'str'
You need to put
% name straight after the string:
f = open('%s.csv' % name, 'wb')
The reason your code doesn't work is because you are trying to
% a file, which isn't string formatting, and is also invalid.