6

I have been writing:

#!/usr/bin/python3
# -*- coding: utf-8 -*-

But I believe Python3 uses Unicode by default.

zadrozny
  • 1,353
  • 2
  • 19
  • 25

1 Answers1

16

The default encoding for python3 code is utf-8. See python's unicode support.

If you want to support python2.x in the same file or if you want to use a coding other than utf-8, you need that comment, otherwise you can leave it off without any repercussions.

mgilson
  • 283,004
  • 58
  • 591
  • 667