Python\'s IDLE has \'Check Module\' (Alt-X) to check the syntax which can be called without needing to run the code. Is there an equivalent way to do this in Emacs instead of ru
Or from emacs (or vim) you could run python -c 'import x'
where x is the name of your file minus the .py
extension.
You can use Pyflakes together with Flymake in order to get instant notification when your python code is valid (and avoids a few common pitfalls as well).
You can use pylint for such things and there seems to be a way to integrate it into emacs, but I've never done the latter b/c I'm a vim user.
python -m py_compile script.py
You can use pylint, pychecker, pyflakes etc. from Emacs' compile
command (M-x compile
).
Hint: bind a key (say, F5) to recompile
.