python assert提示

assert 1 > 2, "Error"

输出:

Traceback (most recent call last):
  File "G:/Python_Tensorflow/Faster-RCNN-TensorFlow-Python3.5-master/test.py", line 1, in <module>
    assert 1 > 2, "Error"
AssertionError: Error

如果不加提示:

assert 1 > 2

输出:

Traceback (most recent call last):
  File "G:/Python_Tensorflow/Faster-RCNN-TensorFlow-Python3.5-master/test.py", line 1, in <module>
    assert 1 > 2
AssertionError

猜你喜欢

转载自blog.csdn.net/oMoDao1/article/details/82193483