saving . . . saved modules has been deleted. modules has been hidden .
why do we use numpy.pi  or plt.plot instead of just pi or plot?

Python-3.4.3 Using-Python-Modules 06-07 min 0-10 sec 30-05-20, 1:16 p.m.


When you type ipython --pylab you get all the functions preloaded in the ipython terminal.
In case of modules i.e. the python script you need to import the functions beacuse unlike ipython the module file does no load the modules automatically.
If you still do not want to import and run the code then type
1. ipython --pylab in the windows command prompt/linux terminal.
2. %run -i inside ipython terminal.
This won't throw any error even if you use just pi or plot because the modules are already loaded in the ipython terminal.

But if you try to run the file as python then it will throw error saying function not found etc. In order to avoid errors you need to import the functions before the code.
31-05-20, 11:11 a.m.

Log-in to answer to this question.