0

I have this simple code:

f= open("onemajor.txt", "w")
f.write(str(deal))
f.write ("\n")
f.close()

That generates this error:

return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2660'
in position 0: character maps to <undefined>

The string being written looks like this:

♠AKJ63♡A3♢AK87♣92 ♠Q972♡9642♢T6♣KQT ♠♡KQ75♢J52♣J87543 ♠T854♡JT8♢Q943♣A6

Can someone tell me what I need to do?

BROnstott
  • 61
  • 3

0 Answers0