Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Getting': 0.07; 'instance.': 0.09; 'solution,': 0.09; 'subject:modules': 0.09; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'else,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'anyone': 0.31; 'subject:all': 0.32; 'actual': 0.34; "i'd": 0.34; 'problem': 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'rather': 0.38; '30,': 0.65; 'jul': 0.74; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=u8AzaWvnib/kkLG7aWrk8n7KKx+5xj5EjOadz2PXdtk=; b=yJUQoLbJ5BWet5aZMcN2hlz9lGirCI200HyP5FUu8pdZ9GTHt6y1vhz3aJFc571ne7 aKx1jDBvPeiuu6KEP8vWhN+D+EbHc44V63I/y/cUd5bcX3Z6FJOuz0s6zen+ZgVNFdfS tz9TYjkyb5X/8ybvddjNgdIMUyiwsPoPj5tHvOLGVWJuQEYgxpLi+UQ/CBDBNFH5y17E 71ixGr+kbnI61DAGqmOUdMheeOVkqcBoQk1x79JTxwRJKAy6+6ddzu99yCuic99CJAFs /FFuJYQYmlhTzwXJ9oLkUTvTz/BMVnIoZ/TAcXRWe+47sTNFdi201SCjOOX5bfwFuG5t XuLg== MIME-Version: 1.0 X-Received: by 10.50.176.202 with SMTP id ck10mr52165580igc.2.1406709187169; Wed, 30 Jul 2014 01:33:07 -0700 (PDT) In-Reply-To: <53d8a20e$0$29977$c3e8da3$5496439d@news.astraweb.com> References: <53d8a20e$0$29977$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 30 Jul 2014 18:33:07 +1000 Subject: Re: Getting a list of all modules From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406709195 news.xs4all.nl 2892 [2001:888:2000:d::a6]:47174 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75363 On Wed, Jul 30, 2014 at 5:43 PM, Steven D'Aprano wrote: > Is this problem already solved? Can anyone make any suggestions? I don't know of an actual solution, but I know where I'd look for one, and that's importlib. If nothing else, you can use importlib.machinery.all_suffixes() rather than hard-coding them, for instance. ChrisA