I start my python files (.py) with
#!/usr/bin/env python3
and sometimes
if __name__ == '__main__':
somefunc()
having done it some hundreds of time manually I decided to automate it in Emacs.
(eval-after-load 'autoinsert
'(define-auto-insert
'("\\.\\py\\'" . "python skeleton")
'(""
"#!/usr/bin/env python3" \n
"# ")))
I thought that putting the above snippet in the .emacs
file
would be enough.
A new .py
file is still empty.
I temporarily removed all Elpy related setups from my .emacs
file
having proved (I guess) that Elpy doesn't contribute to the problem.
Using Emacs 24.5.1, Python 3.5.3, Debian 4.9.130-2, Elpy 1.28.0