I'm trying to convert a fairly simple Python game into an executable file, and nothing happened to me. Here is the error:
File "C:\Users\ΠΠΈΡΠΈΠ»\AppData\Local\Programs\Python\Python35-32\Scripts\pyinstaller-script.py", line 1 SyntaxError: Non-UTF-8 code starting with '\xea' in file C:\Users\ΠΠΈΡΠΈΠ»\AppData\Local\Programs\Python\Python35-32\Scripts\pyinstaller-script.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details And here is the game code:
# -*- coding: utf-8 -*- try: import colorama, logging, os logging.basicConfig(filename = "game.log", level = logging.DEBUG, format = '%(asctime)s : %(levelname)s[LINE:%(lineno)d] - %(message)s', datefmt = '%d-%b-%y %H:%M:%S') colorama.init() red = '\x1b[6;30;41m' green = '\x1b[6;30;42m' n_text = '\x1b[4;31;47m' end = '\x1b[0m' class Player: data = {'health': '100', 'money': '100', 'name': 'player', 'chapter': '1'} inv = {} #saving function def save_game(self): f = open('savefile.txt', 'w') #open file f.write(p.data.get('health')) #writing f.write(" ") f.write(p.data.get('money')) f.write(" ") f.write(p.data.get('name')) f.write(" ") f.write(p.data.get('chapter')) f.close() #closing #loading function def load_game(self): f = open('savefile.txt', 'r') #open file save = f.readline() #reading first string save = save.split() #spliting up first string f.close() #closing return save #list output def init_var(self): #needed before saving p.data = {'health': list[0], 'money': list[1], 'name': list[2], 'chapter': str(list[3])} def clear_log(self): logfile_size = os.stat('game.log').st_size // 1024 if logfile_size >= 10: f = open('game.log', 'r+') f.truncate() logging.info('Log file is cleaned.') f.close() if logfile_size < 10: logging.info('Π‘leaning the log file is not required.') p = Player() list = p.load_game() logging.info('Save: {}'.format(list)) #-----------------------------------------------------------------------------------------------------------------------------------------# print(' __ ') print(' ________ __ ____ _______/ |_ ') print(' / ____/ | \_/ __ \ / ___/\ __\ ') print('< <_| | | /\ ___/ \___ \ | | ') print(' \__ |____/ \___ >____ > |__| ') print(' |__| \/ \/ \n') if list[3] == '1': #chapter one print(n_text + '--------------------------------------Chapter one: name---------------------------------------------' + end) print(n_text + 'chapter one' + end) input('ΠΠ°ΠΆΠΌΠΈΡΠ΅ Enter...') list[3] = str(int(p.data.get('chapter')) + 1) a = 'You have reached chapter ' + list[3] + '!' logging.info(a) p.init_var() p.save_game() os.system('cls') if list[3] == '2': #chapter two print(n_text + '--------------------------------------Chapter two: name---------------------------------------------' + end) print(n_text + 'chapter two' + end) input('ΠΠ°ΠΆΠΌΠΈΡΠ΅ Enter...') list[3] = str(int(list[3]) + 1) a = 'You have reached chapter ' + list[3] + '!' logging.info(a) p.init_var() p.save_game() os.system('cls') if list[3] == '3': #chapter three print(n_text + '--------------------------------------Chapter three: name-------------------------------------------' + end) print(n_text + 'chapter three' + end) input('ΠΠ°ΠΆΠΌΠΈΡΠ΅ Enter...') list[3] = str(int(list[3]) + 1) a = 'You have reached chapter ' + list[3] + '!' logging.info(a) p.init_var() p.save_game() os.system('cls') if list[3] == '4': #chapter four print(n_text + '--------------------------------------Chapter four: name--------------------------------------------' + end) print(n_text + 'chapter four' + end) input('ΠΠ°ΠΆΠΌΠΈΡΠ΅ Enter...') list[3] = str(int(list[3]) + 1) a = 'You have reached chapter ' + list[3] + '!' logging.info(a) p.init_var() p.save_game() os.system('cls') if list[3] == '5': #chapter five print(n_text + '--------------------------------------Chapter five: name--------------------------------------------' + end) print(n_text + 'chapter five' + end) input('ΠΠ°ΠΆΠΌΠΈΡΠ΅ Enter...') list[3] = str(int(list[3]) + 1) a = 'You have reached chapter ' + list[3] + '!' logging.info(a) p.init_var() p.save_game() p.clear_log() os.system('cls') #-----------------------------------------------------------------------------------------------------------------------------------------# p.init_var() p.save_game() logging.info('Data that has been saved: {}'.format(p.data)) except ImportError: print('Error importing libraries for the game. Wait for updates.') logging.critical('Error importing libraries for the game.') except OSError: print('OS error. Wait for updates.') logging.critical('OS error.') except SyntaxError: print('Syntax error. Wait for updates.') logging.critical('Syntax error.') except SystemError: print('Internal error. Wait for updates.') logging.critical('Internal error.') except: print('Unspecified error. Wait for updates.') logging.critical('Unspecified error.') Maybe someone knows how to solve? Thank you in advance.