Emacs - run current file in Python

I am using ELPY in emacs on Windows. How to update current file inside emacs using shortcut.

When I use eval-buffer . I get the messages below.

Flymake cannot work without buffer file name

Removed if the construction main == < main ", use the prefix argument to evaluate.

+4
source share
1 answer

Emacs has a built-in function that works with the python shell (bottom) to prevent inadvertent use of the entire script, which happens by overriding (or deleting) __name__before it runs.

script __name__ = "__main__", - " ".

, , main, :

`C-u C-c C-c`

, - , - :

(global-set-key (kbd "<f7>") (kbd "C-u C-c C-c"))

, .

+6

All Articles