[Tutor] Importing libraries

Blockheads Oi Oi breamoreboy at yahoo.co.uk
Sat Feb 4 11:18:07 CET 2012


On 04/02/2012 05:37, Michael Lewis wrote:
> Why don't I have to import str or list to access their attributes like I
> do with the math or random or any other library?
>
> --
> Michael J. Lewis
> mjolewis at gmail.com <mailto:mjolewis at gmail.com>
> 415.815.7257
>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

They're built in to Python so...

PythonWin 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit 
(Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' 
for further copyright information.
 >>> dir()
['__builtins__', '__doc__', '__name__', '__package__', 'pywin']
 >>> help(__builtins__)
Help on built-in module __builtin__:

NAME
     __builtin__ - Built-in functions, exceptions, and other objects.

FILE
     (built-in)

DESCRIPTION
     Noteworthy: None is the `nil' object; Ellipsis represents `...' in 
slices.

CLASSES
     object
         basestring
             str
             str
             unicode
         buffer
etc.

-- 
Cheers.

Mark Lawrence.



More information about the Tutor mailing list