Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
emacs交互式python shell不显示任何反馈_Python_Emacs - Fatal编程技术网

emacs交互式python shell不显示任何反馈

emacs交互式python shell不显示任何反馈,python,emacs,Python,Emacs,在我的终端外壳中,如果我只是计算,例如,3+3,我得到 Python 3.6.1 (default, May 21 2017, 04:38:38) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> 3+3 6 >>> 但是,

在我的终端外壳中,如果我只是计算,例如,
3+3
,我得到

Python 3.6.1 (default, May 21 2017, 04:38:38) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 3+3
6
>>> 
但是,使用emacs的交互式shell,并且在使用
pythonshell发送行
pythonshell发送区域
评估代码时,我没有收到任何关于正在执行的代码的反馈(当然,除非涉及到一些
打印

我在
.emacs
中的相关配置如下:

(setq python-shell-interpreter "/opt/local/bin/python3.6"
      python-shell-interpreter-args "-i")
(add-hook 'python-mode-hook 'anaconda-mode)
我不确定它是否相关,但即使我安装了
readline
(如图所示),我也会收到以下警告:

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and "python3.6" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. 


我希望看到一些关于我执行的代码的反馈。有什么想法吗?

我使用以下绑定到C-C-C的命令。如果一行不是以YMMV开头,那么发送打印语句只是一个简单的技巧

;; send current line, with prefix print result
(defun python--send-line (arg)
  (interactive "P")
  (if (not arg)
      (python-shell-send-region (line-beginning-position) (line-end-position))
    (save-excursion
      (beginning-of-line)
      (if (looking-at-p "\\s-*print")
          (python-shell-send-region (line-beginning-position)
                                    (line-end-position))
        (python-shell-send-string
         (concat "print(" (buffer-substring (line-beginning-position)
                                            (line-end-position))
                 ")")))))
  (display-buffer (process-buffer (python-shell-get-process))))