I installed 3.5.1 Python several months ago on Windows 7. I have a python program which is in .py file. It runs fine from IDLE Python.
However, when I run it from command prompt, it says:
C:\_1\Python>info_.py
START -------------------------
Traceback (most recent call last):
File "C:\_1\Python\info_.py", line 33, in <module>
print (data)
File "C:\Program Files\Python35\lib\encodings\cp866.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\xab' in position 18
4: character maps to <undefined>
data is:
u = urllib.request.urlopen('http://www.****')
data = u.read()
I want to run programs from prompt too. What could I do to be sure my code works same in IDLE and via command prompt on Windows?