[英]Basic addition of integers won't print in Sublime Text 3?
If I do a simple如果我做一个简单的
print('hello world')
sublime text will show the output as normal.崇高的文本将正常显示 output 。 However, if I do:但是,如果我这样做:
28 + 7
it wont show anything.它不会显示任何东西。 Not an error message or anything, its just blank.不是错误消息或任何东西,它只是空白。
I am making sure to use the correct build system, and I save my files with a.py to make sure they are running in python code.我确保使用正确的构建系统,并使用 a.py 保存我的文件,以确保它们在 python 代码中运行。 I have been using Sublime text for days now with no issues.我已经使用 Sublime text 好几天了,没有任何问题。 The only thing I changed recently was installing 'pip' upon the advisory of "Automate the Boring Stuff with Python".我最近唯一改变的是根据“使用 Python 自动化无聊的东西”的建议安装 'pip'。 I did this carefully and pip installed normally as well.我这样做很小心,pip 也正常安装。
Can someone help me figure out what's going on?有人可以帮我弄清楚发生了什么吗?
You need to print out the result.您需要打印出结果。 Eg:例如:
sum = 28 + 7
print(sum)
OR或者
print(28+7)
To get output in Sublime Text 3 text editor or IDE在 Sublime Text 3 文本编辑器或 IDE 中获取 output
You have to provide print(28+7)
in your python file您必须在 python 文件中提供print(28+7)
eg:例如:
In file.py
file write below two line and save it.And run using Ctrl+b
在file.py
文件中写入以下两行并保存。然后使用Ctrl+b
运行
print("Hello World")
print(28+7)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.