Hacker
Professional
- Messages
- 1,044
- Reaction score
- 804
- Points
- 113
If you are using the python console and you get syntax warnings like this:
Then you can disable the annoying warnings by the following code:
First of all we imported the warnings, and then we filtered warnings to "ignore".
No warnings
Code:
x = 0
x is 1
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
False
Then you can disable the annoying warnings by the following code:
Code:
import warnings
warnings.filterwarnings("ignore")
First of all we imported the warnings, and then we filtered warnings to "ignore".
Code:
x is 1
False
No warnings