Jun-13-2023, 01:11 AM
I'm using Python 3.11.4 (64-bit) on windows 11.
I've installed libraries from the book, Introduction to Python Programming.
One of these is called stdio. From a Python prompt, I can import stdio and it works fine.
When I try to run the following program from IDLE, however, I get the error message below.
File "D:\LANGS\Python Programs\introcs-python\helloworld.py", line 5, in <module>
import stdio
File "C:\Users\tlake\AppData\Roaming\Python\Python311\site-packages\stdio.py", line 31, in <module>
sys.stdin = open(sys.stdin.fileno(), 'r', newline=None)
io.UnsupportedOperation: fileno
What's going on?
I've installed libraries from the book, Introduction to Python Programming.
One of these is called stdio. From a Python prompt, I can import stdio and it works fine.
When I try to run the following program from IDLE, however, I get the error message below.
#----------------------------------------------------------------------- # helloworld.py #----------------------------------------------------------------------- import stdio # Write 'Hello, World' to standard output. stdio.writeln('Hello, World')Traceback (most recent call last):
File "D:\LANGS\Python Programs\introcs-python\helloworld.py", line 5, in <module>
import stdio
File "C:\Users\tlake\AppData\Roaming\Python\Python311\site-packages\stdio.py", line 31, in <module>
sys.stdin = open(sys.stdin.fileno(), 'r', newline=None)
io.UnsupportedOperation: fileno
What's going on?