Sublime Forum

Macro to create Python print statement for selected variable

#1

I would like to make a macro that would allow me to create a new line and make a print statement in Python for the selected variable.

Say I have this code:

density = mass_particle / volume_particle

If I select the parameter density and run the macro, I would like:

density = mass_particle / volume_particle
print(“density:\t” + str(density))

2 Likes