I imported numpy module in my script but whenever I execute it in my IDLE it is getting restarted every time saying:
========== RESTART: C:\Users\2303p\Desktop\python_code\np_array.py ========== =============================== RESTART: Shell ===============================
Even tried executing the script file from command prompt but no error there as well it simply doesn't print anything.
Below is the code:
import numpy as np
list1 = [1,2,3,4]
print(list1)
array1 = np.array(list1)
Just execute above in IDLE using F5 and restart message is displayed and nothing is printed.
Same code when executed in Pycharm prints:
Process finished with exit code -1073741819 (0xC0000005).
Actually it is behavior or python shell every time you run your script_file.py (any file name) using F5 it will restart the shell and and load every thing from scratch.
1. Load every import statement
2. It will initialize each variable again.
3. Initialize every function again.
Suggestion : If you don't want to reload each and every thing again and again you should go for Anaconda IDE it will be easy to use.
EDITED : Try to restart (close and reopen) your IDE, Also print(array1) at end it seems that you are not printing it.
User contributions licensed under CC BY-SA 3.0