[英]How do I use python in sublimetext 3
I've set up python in sublimetext 3 but can't seem to do anything. 我已经在sublimetext 3中设置了python,但似乎无能为力。 It simply returns:
它只是返回:
[Finished in 0.2s]
What am I doing wrong? 我究竟做错了什么?
This is what I tried: I have been using spyder but it's too slow. 这是我尝试的方法:我一直在使用spyder,但是速度太慢。 PS: I have anaconda and don't want to use that either.
PS:我有水蟒,也不想使用。
def new_sum(x,y):
return(x+y)
new_sum(1,2)
You return a value, but you do not print it. 您返回一个值,但您不打印它。
Using the interpreter in interactive mode, if something returns something else than None and isn't placed in a variable, it will be printed. 在交互模式下使用解释器,如果返回的内容不是None且未放置在变量中,则将打印该内容。 This isn't the case with a script.
脚本不是这种情况。
It has nothing to do with ST3. 它与ST3无关。
Change new_sum(1,2)
to print(new_sum(1,2))
将
new_sum(1,2)
更改为print(new_sum(1,2))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.