python-3.x

    1熱度

    1回答

    我需要通過鼠標垂直移動槳圖像,我該怎麼做?這是我的代碼。我想在pong遊戲中移動我的鼠標並將運動與槳聯繫起來。 import pygame pygame.init() width = 900 height = 600 black = (0,0,0) white = (255, 255, 255) screen = pygame.display.set_mode((width, he

    1熱度

    1回答

    我有如下每小時OHLC的數據框(請忽略OHLC的價值觀,我輸入他們爲了更好地說明), hr_df = Close High Low Open 2017-09-04 05:00:00 0.715035 0.715035 0.715035 0.715035 2017-09-04 06:00:00 0.715035 0.715045 0.715015 0.715035 2

    0熱度

    1回答

    我堅持一些列表/字典的工作。下面是字典的第一列表的一部分,我有 {'createdTime': '2017-11-18T11:11:42.223Z', 'fields': {'Pair ID': 307, 'Source': ['recmSPeRUDk7JxTEs'], 'Target': ['recEijqlS0kjmIjpL']}, 'id': 'rec02Au

    0熱度

    1回答

    從下面的html代碼中,我想單獨獲取數字&文本,我能夠獲得數字,但是文本是錯誤的,如下所示。 (注意:它是在for loop,對於少數幾個鏈接,它的工作與split(b'.')[1]匹配,如果索引沒有找到它給出的錯誤)。 錯誤: Traceback (most recent call last): File "C:/Users/Computers Zone/Google Drive/Py

    1熱度

    6回答

    我的代碼有問題。循環僅運行一次用戶輸入的號碼。謝謝您的幫助。 #create an empty list and ask the user how many items they want to add # take the items the user entered and add it to the empty list. print("enter the number of items

    -1熱度

    1回答

    我已經編寫了一個腳本,它應該根據不同的變量(xa,ya,xb等)計算相交點(xp,yp) yb,xc,yc,xd,yd)並用座標系中的點繪製線段。一般它的工作,但有一個問題。我想在Clickig按鈕「Oblicz」後在Tkinter窗口中顯示我的結果(xp,yp),但執行self.xp.set(XP)後出現錯誤AttributeError: Entry instance has no attrib

    -4熱度

    1回答

    values=input('Enter the numbers :') print ("The values are", values) numbers=[x for x in values.split(',') if int(x)%2!=0 ] print (",".join(numbers)) QUES的區別:大家好,我的代碼運行良好,它只是我想知道這兩個輸入12345和1之間的區別

    0熱度

    1回答

    我第一天學習編碼。必須讓我的答案成爲我的示例代碼中的3位有效數字。任何想法如何做到這一點? def M(m,p,V,R,T): Molar_Mass= m/p/V*R*T return(Molar_Mass) print(M(4.2,8*10**4,1*10**-3,8.31,300)) 130.8825

    0熱度

    3回答

    我有一本字典 dicto = {12:{34:45,56:78},45:{67:23,90:15}} 我想刪除一個鍵值對說dictionary.How的關鍵45的67:23做呢? 這是我做的,到目前爲止,但我得到的錯誤 dicto = {12:{34:45,56:78},45:{67:23,90:15}} for k,v in dicto.items(): for i in v.k

    0熱度

    1回答

    我正在從Tensorflow對象檢測模型動物園訓練ssd_mobilenet_v1_coco_2017_11_17模型。 我的數據集是衛星圖像,我的目標是檢測圖像中的車輛。 但是,培訓失敗與python內存問題。我正在使用CPU進行培訓,我的Windows 10機器有32 GB RAM。用於培訓的TF記錄文件大小爲1.7 GB。 我無法檢測這種故障的原因。 請幫忙。