简体   繁体   English

pyscripter和python shell之间有什么区别?

[英]different between pyscripter and python shell?

when I wrote this program in python shell i could see the result easily: 当我在python shell中编写此程序时,我可以轻松看到结果:

import numpy as np
a = np.array([0,1,2,3])
a

and the output is array([0,1,2,3]) but when I do it in pyscripter and I run the program nothing happen!I should to write it in this form print(a) and the I saw the [0,1,2,3] what's the problem? 并且输出是array([0,1,2,3]),但是当我在pyscripter执行它并运行程序时,什么都没发生!我应该以这种形式将它写成print(a) ,然后我看到了[0 ,1,2,3]出了什么问题?

When you execute it in pyscripter, I assume you wrote 当您在pyscripter中执行它时,我假设您写了

import numpy as np
a = np.array([0,1,2,3])
a

in main. 在主要。 The function will return None (default return value of a function without a return), which is why you see nothing in the pyscripter interpreter. 该函数将返回None(没有返回值的函数的默认返回值),这就是为什么在pyscripter解释器中看不到任何内容的原因。 Try return a instead and you should see it. 尝试return a ,您应该会看到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM