小编Rob*_*Rob的帖子

Python:"缩进错误:unindent与任何外部缩进级别都不匹配"

我只是无法弄清楚这有什么问题......

#!/usr/bin/env python
#
#       Bugs.py
#       

from __future__ import division

# No Module!
if __name__ != '__main__': 
    print "Bugs.py is not meant to be a module"
    exit()

# App
import pygame, sys, random, math
pygame.init()

# Configuration Vars
conf = {
    "start_energy": 50, 
    "food_energy": 25, 
    "mate_minenergy": 50, 
    "mate_useenergy": 35, 
    "lifespan": 300000
}

class Bugs:
    def __init__(self):
        self.list  = []
        self.timers= {}
        # Names / colors for sexes
        self.sex = ["Male", "Female"]
        self.color = ["#CBCB25", "#A52A2A"]
        # Bug info tracking …
Run Code Online (Sandbox Code Playgroud)

python indentation

25
推荐指数
4
解决办法
12万
查看次数

标签 统计

indentation ×1

python ×1