Apr-21-2019, 12:25 PM
i have this error why ?
![[Image: 1555849467-capture.png]](https://image.noelshack.com/fichiers/2019/16/7/1555849467-capture.png)
Error help me please :)
|
Apr-21-2019, 12:25 PM
i have this error why ?
![]()
Apr-21-2019, 12:29 PM
First, please don't use images. You could have just copy and pasted that text. Second, it's kind of hard to debug code we can't see. So posting your code (in Python tags) would be helpful.
That error usually pops up when you have a missing end quote on a string or a missing parenthesis or bracket at the end of your code. EOF means end of file.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness. Recommended Tutorials: BBCode, functions, classes, text adventures
Apr-21-2019, 12:32 PM
Ok thx and sorry for images my code its :
#!python3.7 import socket import mysql.connector import sys, os, time, logging, platform, subprocess from configobj import ConfigObj from time import strftime from twisted.internet import ssl, reactor from twisted.internet.protocol import Factory, Protocol from twisted.web import server, resource from util import json_services from util.logger import StreamHandler, FileHandler from fesl import fesl_client_manager, fesl_server_manager from theater import theater_client_manager, theater_server_manager from magma import magma_api from webbrowser import webbrowser_api mydb = mysql.connector.connect(host="localhost", user="heroes", passwd="!zovix", database="naomi") mycursor = mydb.cursor() try: mycursor.execute("INSERT INTO users (id, username, email, birthday, language, country, password, remember_token, created_at, updated_at, noctification, ip_address, game_token) VALUES(%s)", game_token) cursor.execute("SELECT game_token, FROM users WHERE id", id) result =cursor.fetchall() def theater_client(conn): conn.send(str.encode('Welcome to Remake Heroes\n')) while True: data = conn.recv(8096) reply = 'Server output: '+ data.decode('utf-8') if not data: break conn.sendall(str.encode(reply)) def run(): log = logging.getLogger('root') if platform.system() != "Windows": log.warning('Will not attempt to automatically start the game since we are not running on Windows.') else: log.debug('Attempting to automatically start the game...') try: subprocess.STARTF_USESHOWWINDOW = 1 subprocess.Popen(cmdline, shell=True) log.info('Game started.') except Exception as err: log.error(err) log.error('A strange error occured whilst trying to start the game. Have you renamed any files?') services = json_services.services for service in services: port = services[service]['port'] if service != "MagmaAPI" and service != "WebBrowserAPI": try: factory = Factory() if service == "FESLClientManager": factory.protocol = fesl_client_manager.run elif service == "FESLServerManager": factory.protocol = fesl_server_manager.run elif service == "TheaterClientManager": factory.protocol = theater_client_manager.run reactor.listenUDP(port, theater_client_manager.run_datagram()) elif service == "TheaterServerManager": factory.protocol = theater_server_manager.run reactor.listenUDP(port, theater_server_manager.run_datagram()) reactor.listenTCP(port, factory) except Exception as err: log.error(err) sys.exit(1) else: try: if service == "MagmaAPI": site = server.Site(magma_api.run()) elif service == "WebBrowserAPI": site = server.Site(webbrowser_api.run()) reactor.listenTCP(port, site) except Exception as err: log.error(err) sys.exit(1) log.info(f'[{service}] Now listening on port {str(port)}') reactor.run() def setup_logging(): log_file = 'logs/backend-'+strftime('%b-%d-%Y-%H-%M-%S')+'.log' os.makedirs(os.path.dirname(log_file), exist_ok=True) log = logging.getLogger('root') log.setLevel('DEBUG') log.addHandler(StreamHandler()) log.addHandler(FileHandler(log_file)) if __name__ == '__main__': setup_logging() run()
Apr-21-2019, 12:53 PM
It looks like your entire code is indented under the try statement on line 21. It's just by one space, but that counts as an indent. You need an except or finally to go with the try statement, and you need to unindent all the code after that.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness. Recommended Tutorials: BBCode, functions, classes, text adventures |
|