Cannot enter (č Δ‡ ΕΎ Δ‘) in python 2.7.x console

So, I was looking for internet access and it is so frustrating. When I try to search, I get explanations on how to decode and encode unicode files. But that doesn't interest me. I know that this is possible, since I was able to do it. I do not know what happened. Also, I tried reinstalling python. Change settings in IDLE settings, etc. There are no problems on my laptop. I can do it:

>> a = 'Δ‡' >> >> print a >> Δ‡ 

And on my pc I get:

  >> a = 'Δ‡' >> Unsupported characters in input 

I repeat, I'm not talking about coding in a program. I am talking about the Python console and it works on my laptop and works on my previous machines. There must be a solution to this problem.

Also, take a look at this:

 >>> a = u'Γ§' >>> a u'\xe7' >>> print a Γ§ >>> a = u'Δ‡' Unsupported characters in input >>> 
+5
source share
2 answers

The Windows console is limited in what it can display. You can change the code page using the old DOS CHCP .

 CHCP 65001 

This will change the code page to UTF-8 and make the console more relaxed. You will probably see a square instead of the actual character, but at least you won't see an error.

+1
source

Try:

 import sys reload(sys) sys.setdefaultencoding('utf-8') ... 
-3
source

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


All Articles