Execute code fragment in console action(PY-2633).