I am freaking out lately because I have spent a week writing a totally useless pyton module that transforms some spacial data to a .csv format.
I got not problemwith handling the spatial data but when the software runs I ask the user to submit some input from the command prompt or cygwin. After a lot of effort and googling I got it somehow to work with UTF-8.
I made the compromise to use only english language and not (greek) that I needed but now I get errors about english! Take a look at the error:
Please respond with 'yes' or 'no' or 'y' or 'n').
Would you like to add trips to the route with id ''no5leho'' and direction 0?
[y/n] y
Traceback (most recent call last):
File "main.py", line 296, in <module>
inputAddTrips = query_yes_no('Would you like to add trips to the route with id \'\'%s\'\' and direction 0?\r\n' % (i))
File "main.py", line 33, in query_yes_no
choice = input().lower()
File "C:\Python34\lib\codecs.py", line 319, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte
I have tried all sorts of try like setting PYTHONIOENCODING system variable to utf-8 and .encoding decoding every single print and input().
I have used
#!/usr/bin/env python
and
# -*- coding: utf-8 -*-
But nothing happens? I still get those errors! So I want to ask what you guys do when it comes to input and output? I am a begineer but I know that big websites and software are made in Python so there must be a way to aboid all those errors!!