Found my error - I forget to declare some of the variable global earlier...
hence not the globals()...
On Wednesday, April 19, 2017 at 11:40:55 PM UTC+2, Robert Vergnes wrote:
>
> Hi,
>
> I managed to pass my globals() to the console while creating it but then
> after how to update the console namespace then?
>
> namespace = {'pg': pg, 'np': np, 'outlet':outlet, 'inlet':inlet,
> 'dft1':dft1}
> text = ""
> w2 = pg.console.ConsoleWidget(namespace=globals(), text=text)
> d2.addWidget(w2) #added my consoleWidget to a dock
>
> #all this woks well BUT how to update the namespace after...?
>
> //...... other code and update all variables in my main routine.....///
>
> I tried these below but nothing works and can't find a proper definition
> of what would work ... even the log is not logged...
>
> w2.locals['zib']=123
> w2.user_ns.update(zob = 123)
> w2.consoleWidget.log("prout=123")
> w2.kernel.shell.push({'lfilename':lfilename,'inlet':inlet,
> 'outlet':outlet})
> w2.pushVariables(prout=123)
>
> any idea?
>
> many thanks for support.
>
> Best
>
> Robert
>
>
> On Monday, May 9, 2016 at 8:00:12 AM UTC+2, Luke Campagnola wrote:
>>
>> This is what the "namespace" argument is for in ConsoleWidget.__init__().
>> You can provide a dictionary of variables that will be immediately
>> available from the console.
>>
>> On Mon, May 2, 2016 at 7:06 AM, <[email protected]> wrote:
>>
>>> I'm on a steep learning curve at the moment - I've managed to create a
>>> PyQt application with two tabs, that loads a Pandas HDFStore and then
>>> creates additional dataframes based on user selections and plots them using
>>> pyqtgraph. I've also been able to implement a pyqtgraph console on the
>>> second tab.
>>>
>>> My question is - within my application is it possible to have access to
>>> the application data from within the console.
>>>
>>> E.g. I have self.store, and self.df1, etc and it would be good to
>>> address them directly in the console.
>>>
>>> Thanks in advance for helping a newbie.
>>>
>>> Best Regards,
>>>
>>> Ben
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "pyqtgraph" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pyqtgraph/c0cf8eec-4284-483d-bce8-1ebf98147a33%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/pyqtgraph/c0cf8eec-4284-483d-bce8-1ebf98147a33%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/06b6dffc-7aa5-49fc-8ad9-80ffcdb24600%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.