0

It is working in VS CODE terminal but not in linux terminal.ERROR:

File "/home/shaheer/start.py", line 10, in <module>
ques = input("Are you ready? (y/n)")
EOFError: EOF when reading a line

MY CODE:

import os
import subprocess
from subprocess import Popen, PIPE, STDOUT
from subprocess import DEVNULL
import webbrowser
import time

time.sleep(10)

ques = input("Are you ready? (y/n)")
if ques == "y":
  print("Good!")
elif ques == "Y":
  print("Good!")
else:
  cmd = "pkill chrome"
  Popen([cmd], stderr=subprocess.DEVNULL, stdin=PIPE, shell=True)

I am making it as a reminder script for people who use their system for a long time.

2
  • Maybe this question is relevant: stackoverflow.com/questions/36688454/… Commented Aug 31, 2020 at 16:58
  • that might be the problem with your terminal just use python3 <filename.py> Commented Aug 31, 2020 at 16:58

1 Answer 1

0

[UPDATE] it's now working, i had to make another .py file and link that to this one. file 1 (start.py):

import os
os.system("python3 /home/shaheer/playsound.py")

file 2 (playsound.py):

import os
import subprocess
from subprocess import Popen, PIPE, STDOUT
from subprocess import DEVNULL
import webbrowser
import time

time.sleep(10)

ques = input("Are you ready? (y/n)")
if ques == "y":
  print("Good!")
elif ques == "Y":
  print("Good!")
else:
  cmd = "pkill chrome"
  Popen([cmd], stderr=subprocess.DEVNULL, stdin=PIPE, shell=True)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.