Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

379
Vistas
How to select an answer from options in command line(terminal) using python.?

I am trying to access command line form python code. here is two example where I got stuck. In this code, there is a question and 3 or 4 options to select as answer. How can I select any of these answer using python code. In real case If I am using it from command line I have to use up and down arrow ↑ ↓ key or right and left arrow < > key then enter key to select any one of the options.

*example:1>*

? How would you like to use ESLint? … 
  To check syntax only
▸ To check syntax and find problems
  To check syntax, find problems, and enforce code style

*example:2>*

✔ How would you like to use ESLint? · problems
? What type of modules does your project use? … 
▸ JavaScript modules (import/export)
  CommonJS (require/exports)
  None of these

Normally, I have to answer it by selecting answer from list and pressing enter from terminal, is there any possibility to answer these questions by using python code?


Here I am describing my use case.

I am trying to create automate ESLint vulnerability check for TypeScript files using python.

I am able to run ESLint --init to initialise ESLint in my project. While initializing ESLint --init is asking some questions to specify the type of project. Some of the questions are following:

*example:1>*

? How would you like to use ESLint? … 
  To check syntax only
▸ To check syntax and find problems
  To check syntax, find problems, and enforce code style

*example:2>*

✔ How would you like to use ESLint? · problems
? What type of modules does your project use? … 
▸ JavaScript modules (import/export)
  CommonJS (require/exports)
  None of these

Normally, I have to answer it by selecting answer from list and pressing enter from terminal, is there any possibility to answer these questions by using python code?

following code was used to run eslint --init from python code:

def eslint_init():
    if pathlib.Path('.eslintrc.js').exists():
        print('already initialized')
    else:
        os.system('eslint --init')
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda