View available modules for Python

Source: Internet
Author: User
Tags posix nltk
1. The problem with this approach is to list only the modules that are currently in the import context.

Go to the Python command line. Enter the following code:

$ Pythonpython 2.7.2 (default, Jan, 18:26:31) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on Linux2type "help", "Copyri Ght "," credits "or" license "for more information.>>> import sys>>> sys.modules{' Copy_reg ':
 
  , ' Sre_compile ':
  
   , ' _sre ':
   
    , ' encodings ':
    
     , ' site ':
     
      , ' __builtin__ ':
      
       , ' Sysconfig ':
       
        , ' __main__ ':
        
         , ' encodings.encodings ': None, ' abc ':
         
          , ' Posixpath ':
          
           , ' _weakrefset ':
           
            , ' errno ':
            
             , ' encodings.codecs ': None, ' sre_constants ':
             
              , ' re ':
              
               , ' _abcoll ':
               
                , ' Types ':
                
                 , ' _codecs ':
                 
                  , ' _warnings ':
                  
                   , ' Genericpath ':
                   
                    , ' stat ':
                    
                     , ' Zipimport ':
                     
                      , ' encodings.__builtin__ ': None, ' warnings ':
                      
                       , ' userdict ':
                       
                        , ' Encodings.utf_8 ':
                        
                         , ' sys ':
                         
                          , ' Codecs ':
                          
                           , ' ReadLine ':
                           
                            , ' Os.path ':
                            
                             , ' signal ':
                             
                              , ' Traceback ':
                              
                               , ' Linecache ':
                               
                                , ' POSIX ':
                                
                                 , ' encodings.aliases ':
                                 
                                  , ' Exceptions ':
                                  
                                   , ' Sre_parse ':
                                   
                                    , ' OS ':
                                    
                                     , ' _weakref ':
                                     
                                       }2. You can also get online help under the Python command line:>>> Assist () Welcome to Python 2.7! The online Help utility. If This is your first time using Python, you should definitely check outthe tutorial on the Internet at Http://docs.python . org/tutorial/. Enter the name of any module, keyword, or topic to get Help on Writingpython programs and using Python modules. To quit this help utility Andreturn to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summaryof what it does; To list the modules whose summaries contain a given wordsuch as "spam", type "modules spam" .>>> Modulesplease Wai T a moment while I gather a list of all available Modules.../usr/local/lib/python2.7/site-packages/nltk/app/__init__.py:3 0:userwarning:nltk.app package is not loaded (please install Tkinter Library). Warnings.warn ("Nltk.app Package not Loaded"/usr/local/lib/python2.7/site-packages/nltk/draw/__iniT__.py:16:userwarning:nltk.draw package is not loaded (please install Tkinter Library). Warnings.warn ("Nltk.draw Package not Loaded"/usr/local/lib/python2.7/site-packages/twisted/words/im/__init__.py:8 : UserWarning:twisted.im'll is undergoing a rewrite at some point in the future. Warnings.warn ("twisted.im'll be undergoing a-rewrite at some") Argimageplugin _lwpcookiejar dumbdbm readabilitybasehttpserver _mozillacookiejar dummy_thread readlineBastion __ builtin__ dummy_threading redisbdffontfile __future__ easy_install reprbeautifulsoup _abcoll Email Resourcebeautifulsouptests _ast encodings Rexecbmpimageplugin _bisect engine Rfc822bufrstubimageplugin _codecs errno Rlcompletercdrom _CODECS_CN Exceptions robotparsercgihttpserver _codecs_hk ext runpycanvas _codecs_iso2022 fcntl Schedconfigparser _codecs_jp filecmp scrapycontainerio _codecs_kr fileinput scrapydcookie _codecs_tw fnmatch Selectcrypto _collections Formatter servercurimageplugin _csv Fpformat SETSDLFCN _ctypes Fractions Setuptoolsdcximageplugin _ctypes_test ftplib sgmllibdialog _curses Functools shaDocXMLRPCServer _ Curses_panel future_builtins shelveepsimageplugin _elementtree GC shlexexiftags _functools Genericpath Shutilfiledialog _hashlib getopt signalfitsstubimageplugin _heapq getpass sitefixtk _hotshot GetText SixFliImagePlugin _ Imaging glob smtpdfontfile _imagingcms grp smtplibfpximageplugin _imagingft gzip Sndhdrgbrimageplugin _imagingmath Hashlib socketgdimagefile _io heapq spwdgifimageplugin _json HMAC sqlgimpgradientfile _locale hotshot Sqlalchemygimppalettefile _lsprof htmlentitydefs sqlite3gribstubimageplugin _md5 htmllib SreHTMLParser _ Multibytecodec httplib sre_compilehdf5stubimageplugin _multiprocessing idlelib sre_constantsin _mysql ihooks sre_ Parseicnsimageplugin _mysql_exceptions imaplib sslicoimageplugin _pyio imghdr statimimageplugin _random Imp Statvfsimage _sha importlib stringimagechops _sha256 imputil stringoldimagecms _sha512 Inspect StringprepImageColor _soCket io stropimagedraw _sre itertools structImageDraw2 _ssl json subprocessimageenhance _strptime keyword Sunauimagefile _ struct Lib2to3 sunaudioimagefileio _symtable linecache symbolimagefilter _testcapi Linuxaudiodev SymtableImageFont _ threading_local locale Sysimagegl _warnings logging sysconfigimagegrab _weakref lxml syslogimagemath _weakrefset Macpath Tabnannyimagemode _yappi macurl2path tarfileimageops ABC mailbox Telnetlibimagepalette AIFC mailcap TempfileImagePath AntiGravity markupbase termiosimageqt anydbm Marshal testimagesequence argparse Math testsimageshow Array MCrypt textwrap Imagestat ast MD5 THISIMAGETK asynchat mhlib threadimagetransform asyncore mimetools threadingimagewin atexit mimetypes th Riftimtimageplugin audiodev mimify timeiptcimageplugin audioop mmap timeitjpegimageplugin base64 Modulefinder Tkcolorchoosermcidasimageplugin bdb multifile tkcommondialogmicimageplugin binascii multiprocessing Tkfiledialogmimewriter BinHex Mutex Tkfontmpegimageplugin bisect netrc Tkmessageboxmspimageplugin bsddb new tksimpledialogmysqldb bz2file NIS toaiffolefileio cpickle nltk TokenOpenSSL cProfil E nntplib tokenizepil cstringio ntpath tornadopsdraw calendar nturl2path tracepalettefile CGI numbers TRACEBACKPALMIMAGEP lugin CGITB opcode transportpcdimageplugin chardet operator ttkpcffontfile Chunk optparse ttypcximageplugin cmath orm Turt Lepdfimageplugin cmd os twistedpixarimageplugin code os2emxpath typespngimageplugin codecs Ossaudiodev Unicodedatappmimageplugin CODEOP Parser Unittestpsdimageplugin collections pdb Urllibqueue Colorsys pickle Urllib2scrolledtext command pickletools urlparsesgiimageplugin commands pip Usersimpledialog compileall pipes Utilsimplehttpserver compiler pkg_resources Uusimplexmlrpcserver connectors Pkgutil Uuidsocketserver Constants Platform Virtualenvspiderimageplugin contextlib plistlib Virtualenv_supportstringio cookielib popen2 W3libsunimageplugin copy poplib warningstypes copy_reg posix wavetario crypt posixfile WeakreftgaimageplUgin csv posixpath webtiffimageplugin ctypes pprint webbrowsertifftags curses profile Whichdbtix databases protocol Wsgire ftkconstants datetime pstats XDRLIBTKDND dateutil pty xmltkinter dbhash pwd xmllibuserdict decimal py_compile xmlrpclibUse RList dialects Pyclbr xxsubtypeuserstring difflib pydoc yamlwalimagefile dircache pydoc_data yappiWmfImagePlugin dis Pyex Pat Zipfilexvthumbimageplugin distutils Quopri zipimportxbmimageplugin Django random zlibxpmimageplugin doctest re Zopeenter any module name to get more help. Or, type "modules spam" to searchfor modules whose descriptions contain the word "spam".
                                     
                                    
                                   
                                  
                                 
                                
                               
                              
                             
                            
                           
                          
                         
                        
                       
                      
                     
                    
                   
                  
                 
                
               
              
             
            
           
          
         
        
       
      
     
    
   
  
 
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.