+3 votes
in Programming Languages by (13.2k 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 (23.4k 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 all warnings.