File "C:\Users\jpb71\ENV\testNfl.py", line 10, in
players.csv('rusing.csv')
File "C:\Users\jpb71\ENV\lib\site-packages\nflgame\seq.py", line 333, in csv
csv.DictWriter(open(fileName, 'wb+'), fieldNames).writerows(rows)
File "c:\users\jpb71\appdata\local\programs\python\python38\Lib\csv.py", line 157, in writerows
return self.writer.writerows(map(self._dict_to_list, rowdicts))
TypeError: a bytes-like object is required, not 'str'
In the current Seq.py file on line 333, the code to write row is like below:
csv.DictWriter(open(fileName, 'wb+'), fieldNames).writerows(rows)
However, that results in the following error:
File "C:\Users\jpb71\ENV\testNfl.py", line 10, in
players.csv('rusing.csv')
File "C:\Users\jpb71\ENV\lib\site-packages\nflgame\seq.py", line 333, in csv
csv.DictWriter(open(fileName, 'wb+'), fieldNames).writerows(rows)
File "c:\users\jpb71\appdata\local\programs\python\python38\Lib\csv.py", line 157, in writerows
return self.writer.writerows(map(self._dict_to_list, rowdicts))
TypeError: a bytes-like object is required, not 'str'
This is happening because that is the python 2 version of that call. See: https://stackoverflow.com/questions/34283178/typeerror-a-bytes-like-object-is-required-not-str-in-python-and-csv
It should be:
'csv.DictWriter(open(fileName, 'w'), fieldNames).writerows(rows)'