Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does stdin mean in Python Errors? [duplicate]

When I get a syntax error for example, I get this block of text:

  File "<stdin>", line 1, in ?
    while True print('Hello world')
        while True print('Hello world')
                       ^
SyntaxError: invalid syntax

I did some research and I found out there are three standard streams.

"The three I/O connections are called standard input (stdin), standard output (stdout) and standard error (stderr)."

So why isn't this standard error?


1 Answers

Because the source of the code is stdin, e.g. it was typed in at a console.

like image 196
Ignacio Vazquez-Abrams Avatar answered May 27 '26 07:05

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!