1:pycharm code area Suddenly can't edit the problem
Workaround:
(1) If Pycharm is using a free trial version, this can happen because the trial is over! Re-download continue to use or purchase, download free version can solve this problem
(2) to exclude (1) The problem is that the software itself when you open the error occurred! Turn it off and then turn it back on to solve the problem
2:python non-ascii character bug when using Chinese annotation in the process of writing code again
The code hints in
Control Panel are: Syntaxerror:non-ascii character in file testpy3/t.py on line 5but Span class= "Hljs-title" >no encoding declared; see http://python. Org/dev/peps/pep-0263/for details
< Span class= "Hljs-command" > This means that there is a problem with Chinese garbled
Workaround:
python defaults to ASCII encoding when writing code. The code has the following characteristics:
1, the concept: is based on the Latin alphabet a set of computer coding system. It is primarily used to display modern English, while its extended version Eascii can partially support other Western European languages and is equivalent to ISO/IEC 646.
2. Features: ASCII code uses the specified 7-bit or 8-bit binary number combination to represent 128 or 256 possible characters. The standard ASCII code is also called the base ASCII code, using a 7-bit binary number to represent all uppercase and lowercase letters, numbers 0 through 9, punctuation, and special control characters used in American English
So to define a Chinese source code code, there must be a magical comment, placed at the beginning of the file. As shown below:
#!/usr/bin/python
#-*-Coding: <encoding name>-*-
The encoding of the Chinese language is the following code is OK!
#!/usr/bin/python
#-*-Coding:utf8-*-
Non-ascii character bug in Python and Pycharm code area suddenly can't edit the problem