Jun-04-2018, 08:41 PM
If you don't know encoding - you can use
chardet
module to check it out; first read file content as bytesting, then check encoding - and either decode data or read the file anewwith open(<file>, 'rb') as infile: content = infile.read() data = content.decode(chardet.detect(content)['encoding']
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.