attributeerror

    120熱度

    5回答

    我有兩個Python模塊: a.py import b def hello(): print "hello" print "a.py" print hello() print b.hi() b.py import a def hi(): print "hi" 當我運行a.py,我得到: AttributeError: 'module' object ha

    1熱度

    3回答

    我不斷收到以下錯誤: AttributeError: Caribou instance has no attribute 'on_key_up' 的問題是,我敢肯定我確實有這種屬性... 下面是一些摘錄從我的代碼(從caribou.py) : def on_key_up(self, event): if event.event_string == "Shift_R": _r

    3熱度

    3回答

    我應該在班級中重新定義什麼特殊方法(s?),以便它處理AttributeError的例外情況並在這些情況下返回特殊值? 例如, >>> class MySpecialObject(AttributeErrorHandlingClass): a = 5 b = 9 pass >>> >>> obj = MySpecialObject() >>> >>> o

    2熱度

    2回答

    我是python的新手,今天剛下載它。我正在使用它來處理網絡蜘蛛,爲了測試它並確保一切正常,我下載了一個示例代碼。不幸的是,它不工作,並給我的錯誤: 「AttributeError的:‘MyShell’對象有沒有‘裝’屬性」 我不知道如果代碼自身有錯誤,或我沒有安裝python時要正確地做一些事情。安裝python時需要做什麼,比如添加環境變量等?那個錯誤通常意味着什麼? 下面是我用進口蜘蛛類使用

    10熱度

    2回答

    我試圖做到這一點在我的計劃: dest = socket.gethostbyname(host) 我已經包含行: from socket import * 在文件的開頭。 我收到此錯誤: AttributeError: type object '_socketobject' has no attribute 'gethostbyname' 我運行Vista 64位。我的操作系統可能有問題嗎

    2熱度

    2回答

    我的GAE應用程序運行正常,從我的電腦,但是當我上傳,我開始變得一個AttributeError,具體是: AttributeError: 'dict' object has no attribute 'item' 我使用pylast接口(用於last.fm--的API link)。具體來說,我訪問這種類型的變量列表: SimilarItem = _namedtuple("SimilarIte

    0熱度

    1回答

    當我在我的生產服務器上部署我的應用程序時,我遇到了一個奇怪的行爲,使用tornadoweb的最新分支。 我測試了幾次代碼,當我在我的筆記本電腦(Archlinux)上用python 2.6.3和MySQLdb 1.2.3b2測試時,它已經完全工作。 只要我在生產服務器(Ubuntu x64)上使用python 2.6.2,MySQLdb 1.2.3.c1(已經測試過1.2.1版本)並調用該頁面,就