Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45773

RE: Modules list-tool

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 <carlosnepomuceno@outlook.com>
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 <carlosnepomuceno@outlook.com>
To "python-list@python.org" <python-list@python.org>
Subject RE: Modules list-tool
Date Thu, 23 May 2013 08:19:31 +0300
Importance Normal
In-Reply-To <CAGGBd_qQzx88Roy7aUMCGOw_h11GapgLK+C677tqV0pd9G7wMg@mail.gmail.com>
References <CAGGBd_qQzx88Roy7aUMCGOw_h11GapgLK+C677tqV0pd9G7wMg@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1991.1369286380.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


Have you tried Inspect Shell[1]?

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:

"python inspect_shell.py"

When you get the prompt you can enter the following to show the list of modules:

localhost:1234> '\n'.join(['{}={}'.format(k,v) for k,v in sys.modules.items()])


[1] https://github.com/amoffat/Inspect-Shell


________________________________
> Date: Wed, 22 May 2013 21:39:52 -0700 
> Subject: Re: Modules list-tool 
> From: drsalists@gmail.com 
> To: gvanem@broadpark.no 
> CC: python-list@python.org 
>  
> On Tue, May 21, 2013 at 12:35 PM, Gisle Vanem  
> <gvanem@broadpark.no<mailto:gvanem@broadpark.no>> wrote: 
> Are anyone aware of a tool that can show me at run-time 
> which modules (pyd/dll) are loaded into a Python program at a specific  
> time (or over time)? 
>  
> To clarify, e.g. when running a sample from PyQt4 
> (examples\tutorials\addressbook\part1.pyw) and using Process Explorer [1], 
> I can launch WinDbg from it and get this list of modules: 
> .... 
>  
> ModLoad: 1d000000 1d00a000   G:\ProgramFiler\Python27\python.EXE 
> ModLoad: 7c900000 7c9b1000   F:\WINDOWS\system32\ntdll.dll 
> ModLoad: 7c800000 7c8f7000   F:\WINDOWS\system32\kernel32.dll 
> ModLoad: 1e000000 1e261000   f:\windows\system32\python27.dll 
> ModLoad: 7e410000 7e4a1000   F:\WINDOWS\system32\USER32.dll 
> ModLoad: 77f10000 77f59000   F:\WINDOWS\system32\GDI32.dll 
> ModLoad: 77dc0000 77e6a000   F:\WINDOWS\system32\ADVAPI32.dll 
> ModLoad: 77e70000 77f03000   F:\WINDOWS\system32\RPCRT4.dll 
> ModLoad: 77fe0000 77ff1000   F:\WINDOWS\system32\Secur32.dll 
> ModLoad: 7c9c0000 7d1d8000   F:\WINDOWS\system32\SHELL32.dll 
> ModLoad: 77c00000 77c58000   F:\WINDOWS\system32\msvcrt.dll 
> ModLoad: 77f60000 77fd6000   F:\WINDOWS\system32\SHLWAPI.dll 
> ModLoad: 78520000 785c3000    
> f:\windows\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43\MSVCR90.dll 
> ModLoad: 76370000 7638d000   f:\windows\system32\IMM32.DLL 
> ModLoad: 62f20000 62f29000   f:\windows\system32\LPK.DLL 
> ModLoad: 75420000 7548b000   f:\windows\system32\USP10.dll 
> ModLoad: 773c0000 774c3000  
> f:\windows\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll 
> ModLoad: 5d5d0000 5d66a000   F:\WINDOWS\system32\comctl32.dll 
> ModLoad: 78aa0000 78b5f000   f:\windows\system32\MSVCR100.dll 
> ModLoad: 00d90000 00f29000    
> g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtCore.pyd 
> ModLoad: 67000000 67260000    
> g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtCore4.dll 
> ModLoad: 774d0000 7760e000   F:\WINDOWS\system32\ole32.dll 
> ModLoad: 71aa0000 71ab7000   f:\windows\system32\WS2_32.dll 
> ModLoad: 71a90000 71a98000   f:\windows\system32\WS2HELP.dll 
> ModLoad: 78480000 7850e000    
> f:\windows\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43\MSVCP90.dll 
> ModLoad: 00a60000 00a73000    
> g:\ProgramFiler\Python27\lib\site-packages\sip.pyd 
> ModLoad: 011f0000 0177f000    
> g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtGui.pyd 
> ModLoad: 65000000 657c4000    
> g:\ProgramFiler\Python27\lib\site-packages\PyQt4\QtGui4.dll 
> ... 
>  
> ------------- 
>  
> My example may be mooth since part1.pyw above (when I enter 
> the debugger) is just waiting for events. The stack of pythonw.exe as  
> shown in Process Explorer: 
> ... 
> ntdll.dll!ZwWaitForMultipleObjects+0xc 
> kernel32.dll!WaitForMultipleObjectsEx+0x12c 
> USER32.dll!RealMsgWaitForMultipleObjectsEx+0x13e 
> QtCore4.dll!QEventDispatcherWin32::processEvents+0x3c3 
> ntdll.dll!RtlAcquirePebLock+0x28 
>  
> Is there a tool that can do something similar? (written in Python  
> maybe?). But a bit simpler to use than my current method. Just launch  
> it from the command-line; something like "pyXX part1.pyw <more args>" 
>  
> [1] http://technet.microsoft.com/en-gb/sysinternals/bb896653 
>  
> --gv 
> --  
> http://mail.python.org/mailman/listinfo/python-list 
>  
> Python -v reports on modules. 
>  
> -- http://mail.python.org/mailman/listinfo/python-list 		 	   		  

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

RE: Modules list-tool Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-23 08:19 +0300

csiph-web