Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'run-time': 0.05; '21,': 0.07; 'method.': 0.07; 'events.': 0.09; 'skip:g 60': 0.09; 'skip:k 40': 0.09; 'url:github': 0.09; 'python': 0.11; '"python': 0.16; '(when': 0.16; '(written': 0.16; 'modules.': 0.16; 'received:65.55.116.7': 0.16; 'run:': 0.16; 'skip:f 90': 0.16; 'skip:g 50': 0.16; 'skip:q 50': 0.16; 'subject:Modules': 0.16; 'time)?': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; "skip:' 30": 0.19; 'skip:f 30': 0.19; 'stack': 0.19; 'example': 0.22; 'to:name:python-list@python.org': 0.22; 'received:65.55.116': 0.24; 'simpler': 0.24; '(or': 0.24; 'source': 0.25; 'script': 0.25; 'shown': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; '[1]': 0.29; 'skip:( 40': 0.30; 'skip:g 30': 0.30; 'subject:list': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'inspect': 0.31; 'anyone': 0.31; 'url:python': 0.33; 'running': 0.33; 'date:': 0.34; 'tool': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'reports': 0.37; 'url:microsoft': 0.37; 'list': 0.37; 'email addr:python.org': 0.37; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'pm,': 0.38; 'skip:_ 30': 0.39; 'subject:': 0.39; 'launch': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'skip:n 30': 0.60; 'email addr:gmail.com': 0.63; 'show': 0.63; 're:': 0.63; 'email name:python-list': 0.65; 'sample': 0.67; 'prompt': 0.68; '1st': 0.74; 'explorer': 0.84; 'subject:tool': 0.84; 'url:en-gb': 0.91; '2013': 0.98 X-TMN: [7q6RcT6O8KSQp39JvyU/Yy8JgYsXJXcx] X-Originating-Email: [carlosnepomuceno@outlook.com] From: Carlos Nepomuceno To: "python-list@python.org" Subject: RE: Modules list-tool Date: Thu, 23 May 2013 08:19:31 +0300 Importance: Normal In-Reply-To: References: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 23 May 2013 05:19:31.0615 (UTC) FILETIME=[1B00CAF0:01CE5775] 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: 106 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369286380 news.xs4all.nl 15950 [2001:888:2000:d::a6]:44286 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45773 Have you tried Inspect Shell[1]?=0A= =0A= All you have to do to monitor your script is include "import inspect_shell"= in the 1st line of you source code and then run:=0A= =0A= "python inspect_shell.py"=0A= =0A= When you get the prompt you can enter the following to show the list of mod= ules:=0A= =0A= localhost:1234> '\n'.join(['{}=3D{}'.format(k=2Cv) for k=2Cv in sys.modules= .items()])=0A= =0A= =0A= [1] https://github.com/amoffat/Inspect-Shell=0A= =0A= =0A= ________________________________=0A= > Date: Wed=2C 22 May 2013 21:39:52 -0700 =0A= > Subject: Re: Modules list-tool =0A= > From: drsalists@gmail.com =0A= > To: gvanem@broadpark.no =0A= > CC: python-list@python.org =0A= > =0A= > On Tue=2C May 21=2C 2013 at 12:35 PM=2C Gisle Vanem =0A= > > wrote: =0A= > Are anyone aware of a tool that can show me at run-time =0A= > which modules (pyd/dll) are loaded into a Python program at a specific = =0A= > time (or over time)? =0A= > =0A= > To clarify=2C e.g. when running a sample from PyQt4 =0A= > (examples\tutorials\addressbook\part1.pyw) and using Process Explorer [1]= =2C =0A= > I can launch WinDbg from it and get this list of modules: =0A= > .... =0A= > =0A= > ModLoad: 1d000000 1d00a000 G:\ProgramFiler\Python27\python.EXE =0A= > ModLoad: 7c900000 7c9b1000 F:\WINDOWS\system32\ntdll.dll =0A= > ModLoad: 7c800000 7c8f7000 F:\WINDOWS\system32\kernel32.dll =0A= > ModLoad: 1e000000 1e261000 f:\windows\system32\python27.dll =0A= > ModLoad: 7e410000 7e4a1000 F:\WINDOWS\system32\USER32.dll =0A= > ModLoad: 77f10000 77f59000 F:\WINDOWS\system32\GDI32.dll =0A= > ModLoad: 77dc0000 77e6a000 F:\WINDOWS\system32\ADVAPI32.dll =0A= > ModLoad: 77e70000 77f03000 F:\WINDOWS\system32\RPCRT4.dll =0A= > ModLoad: 77fe0000 77ff1000 F:\WINDOWS\system32\Secur32.dll =0A= > ModLoad: 7c9c0000 7d1d8000 F:\WINDOWS\system32\SHELL32.dll =0A= > ModLoad: 77c00000 77c58000 F:\WINDOWS\system32\msvcrt.dll =0A= > ModLoad: 77f60000 77fd6000 F:\WINDOWS\system32\SHLWAPI.dll =0A= > ModLoad: 78520000 785c3000 =0A= > f:\windows\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_= x-ww_31a54e43\MSVCR90.dll =0A= > ModLoad: 76370000 7638d000 f:\windows\system32\IMM32.DLL =0A= > ModLoad: 62f20000 62f29000 f:\windows\system32\LPK.DLL =0A= > ModLoad: 75420000 7548b000 f:\windows\system32\USP10.dll =0A= > ModLoad: 773c0000 774c3000 =0A= > f:\windows\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_= 6.0.2600.6028_x-ww_61e65202\comctl32.dll =0A= > ModLoad: 5d5d0000 5d66a000 F:\WINDOWS\system32\comctl32.dll =0A= > ModLoad: 78aa0000 78b5f000 f:\windows\system32\MSVCR100.dll =0A= > ModLoad: 00d90000 00f29000 =0A= > g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtCore.pyd =0A= > ModLoad: 67000000 67260000 =0A= > g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtCore4.dll =0A= > ModLoad: 774d0000 7760e000 F:\WINDOWS\system32\ole32.dll =0A= > ModLoad: 71aa0000 71ab7000 f:\windows\system32\WS2_32.dll =0A= > ModLoad: 71a90000 71a98000 f:\windows\system32\WS2HELP.dll =0A= > ModLoad: 78480000 7850e000 =0A= > f:\windows\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_= x-ww_31a54e43\MSVCP90.dll =0A= > ModLoad: 00a60000 00a73000 =0A= > g:\ProgramFiler\Python27\lib\site-packages\sip.pyd =0A= > ModLoad: 011f0000 0177f000 =0A= > g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtGui.pyd =0A= > ModLoad: 65000000 657c4000 =0A= > g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtGui4.dll =0A= > ... =0A= > =0A= > ------------- =0A= > =0A= > My example may be mooth since part1.pyw above (when I enter =0A= > the debugger) is just waiting for events. The stack of pythonw.exe as = =0A= > shown in Process Explorer: =0A= > ... =0A= > ntdll.dll!ZwWaitForMultipleObjects+0xc =0A= > kernel32.dll!WaitForMultipleObjectsEx+0x12c =0A= > USER32.dll!RealMsgWaitForMultipleObjectsEx+0x13e =0A= > QtCore4.dll!QEventDispatcherWin32::processEvents+0x3c3 =0A= > ntdll.dll!RtlAcquirePebLock+0x28 =0A= > =0A= > Is there a tool that can do something similar? (written in Python =0A= > maybe?). But a bit simpler to use than my current method. Just launch = =0A= > it from the command-line=3B something like "pyXX part1.pyw " = =0A= > =0A= > [1] http://technet.microsoft.com/en-gb/sysinternals/bb896653 =0A= > =0A= > --gv =0A= > -- =0A= > http://mail.python.org/mailman/listinfo/python-list =0A= > =0A= > Python -v reports on modules. =0A= > =0A= > -- http://mail.python.org/mailman/listinfo/python-list =