python – TypeError: expected a character buffer object
python – TypeError: expected a character buffer object
Assuming you just want to write the string 649
to the file, change row
to 649
or issue f.write(str(row))
.
You can do what timgeb did or you can do
row = str(649)
python – TypeError: expected a character buffer object
I had the same error, in my code:
s.translate(table)
The s
obj was string
. The issue was s.translate
was expecting a unicode string. So, the fix was to use:
unicode(s).translate(table)
Related posts
- Flutter Dart: How can we achieve multithreading like python or java in dart
- python – seek() function?
- Python: Random numbers into a list
- Importing data and variable names from a text file in Python
- Using Hydrogen with Python 3
- user interface – Easiest way to develop simple GUI in Python
- Formatting the elements of tuples within a given list in Python
- datetime – Convert date to ordinal python?