运行 AquaEmacs,我想在Python中执行一个缓冲区(C-c C-c)。
该缓冲区以以下内容开头:
AquaEmacs 的执行从以下开始:
该缓冲区以以下内容开头:
from __future__ import print_function
AquaEmacs 的执行从以下开始:
import sys,imp
if'test_one_liners' in sys.modules:
imp.reload(test_one_liners)
else:
import test_one_liners
其中test_one_liners.py是我的文件。这会导致出现以下错误:
SyntaxError: from __future__ imports must occur at the beginning of the file
有人知道在哪里以及如何修复这个问题吗?
让我再次添加信息以使其更清晰。
创建此缓冲区:
from __future__ import print_function
print("Hello")
使用文件/更改缓冲区模式/Python将其设置为Python,然后使用C-c C-c执行;不需要保存。该缓冲区被写入某个临时文件并出现SyntaxError: from __future__ imports must occur at the beginning of the file
错误。回溯包括一个生成的文件,其中包含对临时文件的引用。相反,应该打印Hello。