python-3.5

    -3熱度

    2回答

    我希望能夠打印到一個文本文件,但是我環顧四周,無法弄清楚我需要做什麼。 def countdown (n): while (n > 1): print('\n',(n), 'Bottles of beer on the wall,', (n), 'bottles of beer, take one down pass it around', (n)-1, 'bottles o

    0熱度

    1回答

    這是爲PYthon 3.5。我正在尋找添加小時和分鐘格式的列表,並讓它打印出來,目前它不會做。 我希望得到的是什麼輸入列表如下: 0:00 The temperature is ## 1:00 The temperature is ## 高達23:00。 感謝您的幫助。 HourlyTemperatures = [] def main(): def GetTemperatur

    2熱度

    1回答

    我將Python安裝從3.4更新爲3.5(Windows 7 Enterprise 64位上的CPython 64位)。在更新之後,colorama停止將ANSI轉義序列轉換爲Win32 API調用以更改命令行終端顏色。 需要明確的colorama.init(convert=True)才能獲得彩色輸出。我試圖縮小誤差下來: 它出現了,因爲Python的3.5更新 它可以圍繞我是否隱含調用init(

    0熱度

    1回答

    所以我在Python中玩弄瞭解你能做什麼,不能做什麼。現在,我試圖讓一個單行循環,像這樣 while i <= 100: print(i); i += 1 但正如你猜到了,這不工作,因爲我還沒有初始化i。我然後嘗試 i = 0; while i <= 100: print(i); i += 1 但是,也沒有說明invalid syntax "while"。 有沒有辦法在同一行上初始化i?

    0熱度

    2回答

    我被困了一段時間。我的配置是:python 3.5,xlwings 0.5.0和Windows 7。我得到以下回溯試圖import xlwings: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\Python 3.5\lib\site-p

    1熱度

    3回答

    我試圖反映對稱組的所有排列的平方。 正方形的「座標」用作字典中的鍵。現在假設值 沿着x軸反射。但由於某種原因 .pop()只想接受整數?我認爲它接受任何不包含不可變的類型,並且如果鍵不在字典中,則會引發KeyError。這是我的代碼: def y_reflection(insquare): """Function that reflects a square against it's y

    8熱度

    1回答

    以下產生NameError: name 'Client' is not defined。我該如何解決它? class Server(): def register_client(self, client: Client) pass class Client(): def __init__(self, server: Server): server.

    2熱度

    1回答

    我無法完成nltk軟件包的下載。它總是停在omw項目(Open Multi Wordnet)上。這是剩下的兩個。我查看了其他幫助項目(即install ntlk supporting packages或error installing Nltk),但問題仍然存在。它返回錯誤代碼11001,即錯誤的服務器位置。但服務器索引http://ntlk.org/nltk_data/適用於所有其他項目。我有點

    0熱度

    1回答

    編輯:我有另一個隨機誤差彈出我成功夾在命令提示,此時指向行69-段故障是否調用一個元組的長度在不同的字典等於號.... 我有一個長期運行的(最多一個星期),我設計測試SQLlite3插入時間不同結構的腳本。不幸的是腳本間歇性地崩潰python而不會將錯誤消息輸出到python GUI,下面是窗口在'python has stopped working'窗口中給出的錯誤信息; 完整的錯誤消息: Pr

    1熱度

    1回答

    def a_generator() -> Generator[Tuple[int, int]]: # blah blah blah. # Do some stuff to make some ints. yield int_one, int_two 我做了正確的返回類型註釋嗎?