+4 votes
in Programming Languages by (14.6k points)
When I run my Python code, it shows many warning messages. I am not interested in those warning messages. How can I disable those messages?

1 Answer

0 votes
by (25.6k points)

You can disable the warning message by using "-W ignore" with python command. Here is an example.

$ python -W ignore your_program.py

-W arg
    Warning control. Python’s warning machinery by default prints warning messages to sys.stderr. A typical warning message has the following form:

       ignore
        Ignore all warnings.
 

...