Why is the first line of my program - # - * - encoding: cp1252 - * -?

I never write it, but now when I open the script, there is the first line:

# -*- coding: cp1252 -*-.

What is it? Why, if I never wrote this, is there something similar?

+4
source share
2 answers

I would suggest that your IDE inserted it when saving the file. This is the file encoding for your source file.

+6
source

If you are a file containing some special character without an ASCII character, for example "®", then ide will add this line to the top of your file. If you delete this line from the beginning of the file, the ASCII character is not recognized.

0
source

Source: https://habr.com/ru/post/1540431/


All Articles