On 02/06/2012 02:12 PM, Debashish Saha wrote:
what is the basic difference between the commands
import pylab as *
import matplotlib.pyplot as plt
import numpy as np
import numpy as *
import pylab as * pollutes your global namespace with all kinds of symbols. If you don't know them all, you might accidentally use one of them in your own code, and wonder why things aren't working the way you expected.

Better is
   import pylab

and then use  pylab.something  to access a symbol from pylab

Some prefer
    import pylab as pab
         (or something)

and then use   pab.something to save some typing.

import matplotlib.pyplot as plt

looks in the matplotlib *package" for the module pyplot, then imports it with a shortcut name of plt



--

DaveA

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to