On 2/21/2019 11:40 AM, ast wrote:
Hello
Is it normal to have 151 entries in dictionary sys.modules
just after starting IDLE or something goes wrong ?
The is the right number. When Python starts, it imports around 50
modules. When it runs IDLE, most of idlelib modules are imported, plus
Hello,
On 22/02/19 5:40 AM, ast wrote:
Is it normal to have 151 entries in dictionary sys.modules
just after starting IDLE or something goes wrong ?
>>> import sys
>>> len(sys.modules)
151
I don't use Idle. Written in python, doesn't it require various packages
On Fri, Feb 22, 2019 at 6:03 AM Chris Warrick wrote:
>
> On Thu, 21 Feb 2019 at 18:57, ast wrote:
> >
> > Hello
> >
> > Is it normal to have 151 entries in dictionary sys.modules
> > just after starting IDLE or something goes wrong ?
> >
> >
On Thu, 21 Feb 2019 at 18:57, ast wrote:
>
> Hello
>
> Is it normal to have 151 entries in dictionary sys.modules
> just after starting IDLE or something goes wrong ?
>
> >>> import sys
> >>> len(sys.modules)
> 151
>
> Most of common modules
Hello
Is it normal to have 151 entries in dictionary sys.modules
just after starting IDLE or something goes wrong ?
>>> import sys
>>> len(sys.modules)
151
Most of common modules seems to be already there,
os, itertools, random ....
I thought that sys.modules was contain
On Tue, Feb 15, 2011 at 1:29 PM, Emile van Sebille wrote:
> On 2/15/2011 10:19 AM Chris Rebert said...
>> On Tue, Feb 15, 2011 at 7:17 AM, Jorge Vargas
>> wrote:
>>> I have the following situation. In a big project that involves many
>>> dependencies (and sadly some sys.module hacks) we have a b
Jorge,
It's been a while since I felt the need to use a Python debugger, but I
could swear that most (all?) Python debuggers allow you to watch a
specific variable.
Check out the debuggers on the following page:
http://wiki.python.org/moin/PythonDebuggers
Malcolm
--
http://mail.python.org/mailm
Emile van Sebille wrote:
> Out of curiosity, if it's immutable, what approach might you try to
> capture/trace reassignment? I've got a toy tracer that breaks with
> simple assignment:
AFAIK you'd have to replace the namespace dictionaries with dictionary-like
things that would react to rebindi
On 2/15/2011 10:19 AM Chris Rebert said...
On Tue, Feb 15, 2011 at 7:17 AM, Jorge Vargas wrote:
Hello,
I have the following situation. In a big project that involves many
dependencies (and sadly some sys.module hacks) we have a bug, and it
will really help if i could monitor all changes made t
On Tue, Feb 15, 2011 at 7:17 AM, Jorge Vargas wrote:
> Hello,
>
> I have the following situation. In a big project that involves many
> dependencies (and sadly some sys.module hacks) we have a bug, and it
> will really help if i could monitor all changes made to that variable.
> Is there a way to
Hello,
I have the following situation. In a big project that involves many
dependencies (and sadly some sys.module hacks) we have a bug, and it
will really help if i could monitor all changes made to that variable.
Is there a way to trace those changes ?
--
http://mail.python.org/mailman/listinfo
On Thu, 06 Aug 2009 20:01:42 +0200, Jean-Michel Pichavant wrote:
> > I'm completely perplexed by this behaviour. sys.modules() seems to be
> > a regular dict, at least according to type(), and yet assigning to an
> > item of it seems to have unexpected, and rat
Steven D'Aprano wrote:
Given this module:
#funny.py
import sys
print "Before:"
print " __name__ =", __name__
print " sys.modules[__name__] =", sys.modules[__name__]
sys.modules[__name__] = 123
print "After:"
print " __name__ =", __
Given this module:
#funny.py
import sys
print "Before:"
print " __name__ =", __name__
print " sys.modules[__name__] =", sys.modules[__name__]
sys.modules[__name__] = 123
print "After:"
print " __name__ =", __name__
print " sys =", sy
Fuzzyman wrote:
> That was a quick response. :-)
>
> Thanks very much.
Sigh.. When I'm drowning in arcane win32 c++ crap, I tend to jump on
anything interesting on python-list. It feels like a breath of fresh air!
[sreeram;]
signature.asc
Description: OpenPGP digital signature
--
http://mail
ference to the existing module,
> before overwriting with the new module.
>
> sys.blahblah = sys.modules['__main__']
> sys.modules['__main__'] = module
>
> [sreeram;]
That was a quick response. :-)
Thanks very much.
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
&g
module object gets deleted along with its globals 'module'
and 'namespace'. The code keeps working because the codeobject is
retained by the interpreter.
To make it work, simply retain a reference to the existing module,
before overwriting with the new module.
sys.blahbla
')
namespace = module.__dict__
namespace['__name__'] = '__main__'
# next put things into the names
# e.g. :
namespace['variable'] = 3
sys.modules['__main__'] = module
print module
print namespace
import __main__
print __main__.__dict__['variable'
18 matches
Mail list logo