Python How hide show error Message and Warnings when execute .exe

Viewed 35

IMAGE OF ERROR

When execute .exe show this IMAGE ERROR above. But the program is working properly, i need hide this show message and hide warnings i compiled used this code pyinstaller --noconsole --onefile Main.py

How i hide this message error, warnings and console ?

fast1.py line 1085

("stdin", sys.stdin.encoding),

Main.py line 41

        classFast = fast1
        classFast.main()```

1 Answers

You need to fix the bug in the code in order to get rid of the error window.

Whatever code you are running has no stdin so I am assuming it is a GUI program with no attached console. Therefore when you call sys.stdin it returns None, and NoneType object has no attribute encoding.

So the solution would either be to remove that line or use a conditional expression that tests if sys.stdin is None before running it.

For Exampl:

if `sys.stdin` is not None:
    ("stdin", sys.stdin.encoding)
Related