# <editor-fold desc="折疊后要顯示的內容"> class Error4Code(object): """ Error code """ SUCCESS = ('10000', u'成功') API_PARAMS_ERROR = ('10001', u'API參數缺失或錯誤') API_APP_VERSION_ERROR = ('10151', u'您當前的APP版本過低,需要升級版本才能繼續發布房源') API_IOS_BIND_FAIL_ERROR = ('10182', u'綁定ios失敗') dict_info = dict() for attr in dir(Error4Code): if not callable(getattr(Error4Code, attr)) and not attr.startswith("__"): i = getattr(Error4Code, attr) dict_info[i[0]] = i[1] print(dict_info) print(dict_info.get('10000')) # </editor-fold>
效果圖:
折疊代碼塊快捷鍵:
展開
展開當前代碼塊ctrl +
徹底展開當前代碼塊ctrl alt +
展開所有代碼塊ctrl shift +
折疊
折疊當前代碼塊ctrl -
徹底折疊當前代碼塊ctrl alt -
折疊所有代碼塊ctrl shift -