Skip to main content

Debug

Debugging

assert
  • 可用在程式的條件測試
  • assert <condition>, <message> : 如果 condition 為 True,沒有作用;如果為 False,會產生錯誤,並顯示訊息
x = 5
assert x == 5, "x should be 5"

assert type(username) == str, "username must be a string"
prinf debugging
print("Processing {}".format(basename))
strace