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

311
Vistas
How to run multiline Python statement in VSCode without needing to select it all?

I want to be able to run the entirety of a multiline statement like this

dtypes = {
    'date' : 'str',
    'item_code' : 'category',
    'branch_code' : 'category',
    'sale_qty' : 'float',
    'sale_val' : 'float',
    'return_qty' : 'float',
    'return_val' : 'float'
}

by having the cursor on the first line and pressing a shortcut.

I currently have the command jupyter.execSelectionInteractive bound to ctrl+enter, however that only executes either the current line if nothing is selected or the selection. So in a statement like the one mentioned above, it would attempt to run dtypes = { only and fail with an error and I would need to manually select the whole statement to execute it.

This is a built in function in many IDEs like RStudio where if you press the shortcut for running the current line, it intelligently knows that the current line is part of a multiline statement and runs the whole statement.

I would like to know if there is a way to do this in VSCode?

I also already know that I can use the comment #%% to create Jupyter cells that I can run at once, but I don't want to have to insert #%% at every single multiline statement so I can execute it easily without selecting it all.

over 4 years ago · Santiago Trujillo
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