[英]Sublime text 3: No output when building system
So i cannot get my Python programs to run from Sublime text 3. When i try running the code nothing happens. 因此,我无法让我的Python程序从Sublime文本3运行。当我尝试运行代码时,什么都没有发生。 All that happens is a small text saying 发生的只是一小段文字
"Build finished" on the bottom. 底部的“构建完成”。
This is what is in console 这就是控制台中的内容
Running python -u "C:\\Users\\Sindre\\Documents\\Python\\Forbruk.py" 运行python -u“ C:\\ Users \\ Sindre \\ Documents \\ Python \\ Forbruk.py”
I have added python to windows path 我已经在Windows路径中添加了python
The code: 编码:
def how_much (times_a_week, price):
'''
(int, int) -> str
Prints out my usage of that item.
>>> how_much (3, 25)
day: 10.71 kr
month: 326.11 kr
year: 3913.32 kr
lifetime: 309152 kr
hour: 0.44625000000000004 kr
minute: 0.0074375000000000005 kr
second: 0.00012395833333333334 kr
'''
day = round((times_a_week * price) / 7, 2)
month = round((times_a_week * price) * 4.34812141, 2)
year = round(month * 12, 2)
lifetime = round(year * 79)
hour = day / 24
minute = hour / 60
second = minute / 60
print("day:", day,"kr")
print("month:", month,"kr")
print("year:", year,"kr")
print("lifetime:", lifetime,"kr")
print("hour:", hour,"kr")
print("minute:", minute,"kr")
print("second:", second,"kr")
how_much(3, 25)
UPDATE 更新
Found the problem. 找到了问题。 The problem was this line of code in my sublime settings "show_panel_on_build": false
Changed it to True and the it worked 问题是我的崇高设置"show_panel_on_build": false
中的这一行代码"show_panel_on_build": false
将其更改为True并可以正常工作
Do you have: 你有:
if __name__ == '__main__':
main()
at the bottom? 在底部? Replace main() with whatever function drives your script. 用任何驱动脚本的函数替换main()。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.