0

I am a beginner, I have created my own ide to run python code but I am getting some error when run input() code

Enter any numberTraceback (most recent call last):

  File "C:\Users\USER\Downloads\N1.py", line 1, in <module>

    a = input("Enter any number")

EOFError: EOF when reading a line

my run python script function is below

command = f"python {self.file}"
run_file = subprocess.Popen(command, stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
Output, error = run_file.communicate()
self.output.insert(END,f"{self.file}>>\n")
self.output.insert(END,Output)
self.output.insert(END,error)
Patrick
  • 1,121
  • 4
  • 10
  • 19
Anmol
  • 25
  • 5
  • This exception is raised when one of the built-in function, most common returns End-Of-File(EOF) without reading any data. Sometimes all our program tries to do is to fetch something and modify it. But when it is unable to fetch, it will raise this exception. – LSeu Feb 28 '22 at 09:34
  • Also what version of Python are you using? – LSeu Feb 28 '22 at 09:35
  • i am using python 3.10.1 – Anmol Feb 28 '22 at 14:46
  • I have created and simple ide but when i use input() function it show this error, What modification i have to do in my run function – Anmol Feb 28 '22 at 14:47
  • this may help : https://stackoverflow.com/questions/1https://stackoverflow.com/questions/17675925/eoferror-eof-when-reading-a-line7675925/eoferror-eof-when-reading-a-line – LSeu Mar 01 '22 at 14:30

0 Answers0