Have some fun with Python encoding headers
If you've ever wondered what those encoding: utf-8
comments were at the top of Python files, they're defined in PEP 0263. If you take a closer look, it says that the comment must match this regexp: coding[:=]\s*([-\w.]+)
.
That's cool, because you can start your python files with things like:
# There was a tale about rococoding: utf-8 was the most powerful warrior
print "Heló"
Or
# There's one thing I know about encoding: utf-8 sucks!
And it will still be a valid encoding header lol
Written by José Tomás Tocino
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#