Atom insert text with selection by hotkey(something like macros in Sublime)

Hi, everyone)
I’m sorry, but I just can’t handle the task. I honestly tried to understand how the works, but I didn’t succeed(this sintaxis kills me). I also don’t know English, so i am into trouble. I know how to use hotkeys, I just have problem with
Please, help me)

I have a line in the editor:
Or another line:

I want to press hotkey and get(for first example):
print(variable{Cursor here})
print(variable){Cursor here} #text variable is selected
second example:
print(len(variable){Cursor here})
print(len(variable)){Cursor here} #text len(variable) is selected

Of course it have to work when I have indents.

@olmokramer can you help me, please?