python日常
1029 ワード
私の不確実な基本功を記録する str()は何ですか?クラスに が実行される.異常なスナップtry...except...else.....finally いくつかのコード仕様: unittestを用いたユニットテスト
__str__
が定義されている場合、print
のクラスのインスタンスが実行されると、__str__
のコード1. except else return,finally
2. , __str__ , str , except someException as e ,print e
1. import , , ,
2. # -*- coding:utf-8 -*-
3. ,
4. , ,
5. , , ,
6. , # -*-。。。 import
,import unittest
5. schedule
6. property setter :
![image.png](http://upload-images.jianshu.io/upload_images/9693291-f38181dc954d9500.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
7. , ,
1.
2.
3.
4. : , ,
:
1.
2.