為什么Python運(yùn)行不了
import pygameimport sysfrom ***.locals import *from random import randintsize = w,h = 600,400fish1_speed = [randint(1,10),randint(1,10)]fish2_speed = [randint(1,10),randint(1,10)]fish3_speed = [randint(1,10),randint(1,10)]class main: def __init__(self,size): ***.init() ***.screen = pygame.***.set_mode(size) pygame.***.set_caption("Hello,this is the game:turtle eat fish") ***.bg = (210,210,210) def run_game(self): while True: for events in python.***.get(): if ***.type == ***.quit: ***.exit() self.***.fill(***.bg) pygame.***.flip()if __name__ == "__main__": setgo = main(size) ***.run_game()運(yùn)行不了也保存不了
程序有多個(gè)錯(cuò),,改好的(我測(cè)試正常運(yùn)行,,但你要安裝pygame庫)
運(yùn)行結(jié)果
Tags:Python
相關(guān)推薦
便查問答是一款實(shí)用的網(wǎng)絡(luò)熱門知識(shí)問答平臺(tái),,專注于分享你不知道的知識(shí)、經(jīng)驗(yàn)及生活問題,,在這里所有人都能找到答案歡迎網(wǎng)友參與討論,。