Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python在终端中执行_Python_Python 3.x_Terminal - Fatal编程技术网

Python在终端中执行

Python在终端中执行,python,python-3.x,terminal,Python,Python 3.x,Terminal,我正在学习用Python编程,有没有办法执行program.py以便在终端窗口中显示结果 例如,这是我的代码 temp = 6 freezing = 0 raining = False hail = True if hail == raining or (temp < freezing): print("Bad weather!") if temp > freezing: print("Not freezing") k=input("press close to

我正在学习用Python编程,有没有办法执行program.py以便在终端窗口中显示结果

例如,这是我的代码

temp = 6
freezing = 0
raining = False
hail = True
if hail == raining or (temp < freezing):
    print("Bad weather!")

if temp > freezing: 
    print("Not freezing")

k=input("press close to exit")
temp=6
冻结=0
雨=假
冰雹=真
如果冰雹=下雨或(温度<冰冻):
打印(“坏天气!”)
如果温度>冻结:
打印(“不冻结”)
k=输入(“按下关闭以退出”)

当我从cmdr(终端仿真器)执行命令时,它会打开一个包含程序的cmd窗口,有没有办法让输出显示在cmdr窗口中?

无需担心,键入python3 program.py是否回答了您的问题?