python中模組沒有屬性 模組沒有要顯示的屬性

2021-10-18 14:35:56 字數 1307 閱讀 4728

這是我在pygame視窗中繪製網格的**,當我在學校的一台pc上執行它時,它工作得很好。現在我試圖在家裡繼續,出現了乙個我自己找不到解決辦法的錯誤:import sys, pygame

pygame.init()

white = (255, 255, 255)

black = (0,0,0)

orange = (255, 165,0)

green = (0,128, 0)

radius = 25

screen = pygame.display.set_mode((715,715))

screen.fill(white)

pygame.display.update()

def grid():

pygame.draw.line(screen, (black), (60, 0), (60,715))

pygame.draw.line(screen, (black), (360, 0), (360,715))

pygame.draw.line(screen, (black), (0, 65), (715, 65))

pygame.draw.line(screen, (black), (0, 130), (715, 130))

pygame.draw.line(screen, (black), (0, 195), (715, 195))

pygame.draw.line(screen, (black), (0, 260), (715, 260))

pygame.draw.line(screen, (black), (0, 325), (715, 325))

pygame.draw.line(screen, (black), (0, 390), (715, 390))

pygame.draw.line(screen, (black), (0, 455), (715, 455))

pygame.draw.line(screen, (black), (0, 520), (715, 520))

pygame.draw.line(screen, (black), (0, 585), (715, 585))

pygame.draw.line(screen, (black), (0, 650), (715, 650))

pygame.draw.line(screen, (black), (0,715), (715, 715))

pygame.display.update()

grid()

grid()

當我執行這段**時,我得到乙個錯誤:

^$當我嘗試了幾種不同的方法時,我的**有什麼問題?在

import pymysql 沒有模組 模組 包

模組就是 python 件。製作模組其實就是定義 個 python 件。使 模組的好處 可以直接使 系統或者是別 直接寫好的功能。注意點 模組的名字 件的名字 要遵循識別符號的規 則 由字 數字和下劃線組成,不能以數字開頭 只有遵循識別符號規則的 件名字才能被導 使 方法一 import 模組名 使...

模組,name屬性,sys模組

模組 包 name屬性 模組是乙個可執行的.py檔案,乙個模組被另乙個程式引入,若在引用的時候不想讓模組中的有些方法執行.這時候我們就需要使用name屬性去處理.建立乙個say2.py檔案 user bin env python encoding utf 8 作為模組執行 height 180 we...

python內建模組中的time模組

time時間模組 import time t time.time 獲取當前的utc時間 t time.asctime 將時間元組轉換為日期時間字串 不傳引數返回當前的時間 t time.gmtime 用給定秒數轉換為用utc表達的時間元組 預設返回當前時間元組 t time.mktime 2018,...