different between pyscripter and python shell?

591 views Asked by At

when I wrote this program in python shell i could see the result easily:

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?

1

There are 1 answers

2
TheoretiCAL On

When you execute it in pyscripter, I assume you wrote

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. Try return a instead and you should see it.