首页 > 解决方案 > 在 cmd 中运行 python 脚本不会给出任何输出

问题描述

这是我在环境变量中的 python 路径

C:\Users\Kiwi\AppData\Local\Programs\Python\Python37-32\Scripts\
C:\Users\Kiwi\AppData\Local\Programs\Python\Python37-32\

如果我C:\Users\Kiwi>python --version在 cmd 中运行它会导致Python 3.7.4

这是我想在cmd中运行的脚本,脚本的位置是 C:\Users\Kiwi\JUPYTER_FILES\test_script.ipynb

import numpy as np
array = np.arange(0,10)
print(array)
print('hello');

我正在尝试从 cmd 运行该 python 脚本,但是当我运行它时它没有给出任何输出。

C:\Users\Kiwi>python C:\Users\Kiwi\JUPYTER_FILES\test_script.ipynb

C:\Users\Kiwi> //it just went blank like this after above command

我不知道怎么了。在我做了很多阅读和其他问题之后,没有任何效果。我已经正确设置了环境变量,我可以执行那个 python 版本命令,我已经用它的完整路径运行了 python 脚本,但是它仍然没有返回任何东西,而脚本非常简单并且从字面上打印了 2 件事。有没有什么办法解决这一问题?

标签: python

解决方案


推荐阅读