Domanda Syserr dopo aver inserito un system

Stato
Discussione chiusa ad ulteriori risposte.

Herlomz

Utente Iron
17 Aprile 2020
1
1
0
10
Ciao poco fa ho provato ad inserire un system e mi ritrovo con la schermata bloccata dopo la scelta del personaggio.
Ho provato vari fix,anche quelli trovati su internet nel post stesso, ma comunque la situazione rimane questa. Avete idee?

Questa è la parte interessata principalmente
"sono stati rispettati i TAB"
Python:
    def __BuildKeyDict(self):
        onPressKeyDict = {}


        onPressKeyDict[app.DIK_1]    = lambda : self.__PressNumKey(1)
        onPressKeyDict[app.DIK_2]    = lambda : self.__PressNumKey(2)
        onPressKeyDict[app.DIK_3]    = lambda : self.__PressNumKey(3)
        onPressKeyDict[app.DIK_4]    = lambda : self.__PressNumKey(4)
        onPressKeyDict[app.DIK_5]    = lambda : self.__PressNumKey(5)
        onPressKeyDict[app.DIK_6]    = lambda : self.__PressNumKey(6)
        onPressKeyDict[app.DIK_7]    = lambda : self.__PressNumKey(7)
        onPressKeyDict[app.DIK_8]    = lambda : self.__PressNumKey(8)
        onPressKeyDict[app.DIK_9]    = lambda : self.__PressNumKey(9)
        onPressKeyDict[app.DIK_F1]    = lambda : self.__PressQuickSlot(4)
        onPressKeyDict[app.DIK_F2]    = lambda : self.__PressQuickSlot(5)
        onPressKeyDict[app.DIK_F3]    = lambda : self.__PressQuickSlot(6)
        onPressKeyDict[app.DIK_F4]    = lambda : self.__PressQuickSlot(7)
        ##wiki
        onPressKeyDict[app.DIK_F9]  = lambda : self.__OnWiki()
        #wiki
      
        onPressKeyDict[app.DIK_LALT]        = lambda : self.ShowName()
        onPressKeyDict[app.DIK_LCONTROL]    = lambda : self.ShowMouseImage()
        onPressKeyDict[app.DIK_SYSRQ]        = lambda : self.SaveScreen()
        onPressKeyDict[app.DIK_SPACE]        = lambda : self.StartAttack()

0621 21:59:12779 :: Traceback (most recent call last):

0621 21:59:12779 :: File "networkModule.py", line 234, in SetGamePhase

0621 21:59:12779 :: File "system.py", line 177, in __hybrid_import

0621 21:59:12779 :: File "
0621 21:59:12779 :: game.py
0621 21:59:12779 :: ", line
0621 21:59:12779 :: 325
0621 21:59:12779 ::

0621 21:59:12779 ::
0621 21:59:12779 :: onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()

0621 21:59:12779 ::
0621 21:59:12779 :: ^

0621 21:59:12779 :: IndentationError
0621 21:59:12779 :: :
0621 21:59:12779 :: unexpected indent
0621 21:59:12779 ::
 
Ultima modifica:
Ciao,
c'è un errore di indentazione secondo il syserr. Attento ad usare il tab e non gli spazi (se usi notepad++ senza la visualizzazione di questi caratteri è molto facile che anche premendo tab ti abbia messo degli spazi).
Il python richiede l'indentazione per capire la funzione sotto cosa si trova, al contrario di altri linguaggi (forse è quasi una fortuna per chi deve leggere il codice di altri visto che non tutti indentano).

Se hai ancora difficoltà puoi contattarmi su discord:

Alexxx#2760
Messaggio unito automaticamente:

Il problema è stato risolto. Per chiunque legga questo thread:

Il problema era l'indentazione, vi consiglio (se usate notepad++) di mettere sempre la visualizzazione dei caratteri speciali come spazio e tab.
A volte notepad++ quando premi invio o premi tab sostituisce questo carattere con spazio(il quale non va bene per indentare su python).
Enjoy.
 
  • Mi piace
Reazioni: isPsycho
Stato
Discussione chiusa ad ulteriori risposte.