print(end="")
在python2中会出现语法错误,python3无此问题,处理方法:
# 检查版本
import sys
sys.version
# 导入python2模块
from __future__ import print_function
print("finish", end=' ')
在vscode中配置python3环境
{
# 输出到终端
"code-runner.runInTerminal": true,
# 更换编辑器解析器路径(换成你自己的)
"python.pythonPath": "/usr/local/bin/python3",
# code runner使用python3运行
"code-runner.executorMap": {
"python": "python3 -u",
}
}