1

When I press C-c C-c(python-shell-send-buffer), I get output shown below. Afterwards when I do the same operation (C-c C-c) I always see Sent: #!/usr/bin/env python3... in the echo area.

  • I just want to see the output rather than seeing the send code.

=> How can I instead see only the output of the code in the echo area (if possible)? or show it on the minibuffer compact as possible and close it when C-g is pressed.

enter image description here

The output in the *Python* buffer:

#!/usr/bin/env python3
... 
... print("hello world")
import codecs, os;__pyfile = codecs.open('''/var/folders/mx/m3c2fd193h169gg6nd5x3p480000gn/T/pyK57xMh''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/mx/m3c2fd193h169gg6nd5x3p480000gn/T/pyK57xMh''');exec(compile(__code, '''/Users/alper/code/doo.py''', 'exec'));
hello world
#!/usr/bin/env python3
... 
... print("hello world")
import codecs, os;__pyfile = codecs.open('''/var/folders/mx/m3c2fd193h169gg6nd5x3p480000gn/T/pyK57xMh''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/mx/m3c2fd193h169gg6nd5x3p480000gn/T/pyK57xMh''');exec(compile(__code, '''/Users/alper/code/doo.py''', 'exec'));
hello world

My setup in my init file:

(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))

(setq python-shell-interpreter "python3"
      python-shell-prompt-detect-failure-warning nil
      flycheck-python-pycompile-executable "python3"
      python-shell-completion-native-enable nil
      python-shell-completion-native-disabled-interpreters '("python3")
      elpy-shell-echo-output nil ; https://github.com/jorgenschaefer/elpy/issues/1550#issuecomment-574512892
  )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.