On Fri, Sep 23, 2016 at 4:40 PM, Peter Otten <__pete...@web.de> wrote:
> By the way, the current help() already loads a module if you pass its name
> as a string:
>
Yes, which is the basis of my alternate exec trick:
exec(tb.tb_frame.f_code, tb.tb_frame.f_globals, {n: n})
Basically it creates a
Veek M wrote:
> Is there a way to use .pythonrc.py to provide a help function that
> autoloads whatever module name is passed like so:
By the way, the current help() already loads a module if you pass its name
as a string:
$ echo 'print("importing foo")' > foo.py
$ python3
Python 3.4.3
Chris Angelico wrote:
> On Thu, Sep 22, 2016 at 8:10 PM, Veek M wrote:
>> Is there a way to use .pythonrc.py to provide a help function that
>> autoloads whatever module name is passed like so:
>> \>>> h(re)
>>
>> I tried inheriting site._Helper and overriding __init__ and
On Thu, Sep 22, 2016 at 8:10 PM, Veek M wrote:
> Is there a way to use .pythonrc.py to provide a help function that
> autoloads whatever module name is passed like so:
> \>>> h(re)
>
> I tried inheriting site._Helper and overriding __init__ and __call__ but
> that didn't
Is there a way to use .pythonrc.py to provide a help function that
autoloads whatever module name is passed like so:
\>>> h(re)
I tried inheriting site._Helper and overriding __init__ and __call__ but
that didn't work, also I don't know how to deal/trap/catch the NameError
(no quotes on h(re))