sys.ps?

hello,

I don't know what this all about,
but trying to use wx\py\introspect,
I get an error, that

   sys.ps2

doesn't exists

if I check my sys (Python 2.5.2), it only knows

   sys.ps3

if I call the help of Python, it only describes

   sys.ps1
   sys.ps2

probably not a widespread constant :wink:

cheers,
Stef

Hello,

The wx.py package defines sys.ps* to use for the various prompts. To use introspect separately you need to do the same in your code. (i.e sys.ps1=‘>>>’, sys.ps2 = '… ', sys.ps3 = '<-- '). You may want to look at the code and see how introspect is used by pyshell, ect…

···

On Wed, Oct 1, 2008 at 2:04 PM, Stef Mientki s.mientki@ru.nl wrote:

hello,

I don’t know what this all about,

but trying to use wx\py\introspect,

I get an error, that

sys.ps2

doesn’t exists

if I check my sys (Python 2.5.2), it only knows

sys.ps3

if I call the help of Python, it only describes

sys.ps1

sys.ps2

probably not a widespread constant :wink:

cheers,

Stef


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Cody Precord wrote:

Hello,

The wx.py package defines sys.ps <http://sys.ps>* to use for the various prompts. To use introspect separately you need to do the same in your code. (i.e sys.ps1='>>>', sys.ps2 = '... ', sys.ps3 = '<-- '). You may want to look at the code and see how introspect is used by pyshell, ect...

thanks Cody,
I'm beginning to understand the code ..
... but I find this a little bit weird programming technique :wink:

cheers,
Stef

Stef Mientki wrote:

Cody Precord wrote:

Hello,

The wx.py package defines sys.ps <http://sys.ps>* to use for the various prompts. To use introspect separately you need to do the same in your code. (i.e sys.ps1='>>>', sys.ps2 = '... ', sys.ps3 = '<-- '). You may want to look at the code and see how introspect is used by pyshell, ect...

thanks Cody,
I'm beginning to understand the code ..

I indeed think I understand a lot more now,
probably also why code completion in editra is not working on my system wxPython 2.8.7.1 (msw-unicode),
but I've to admit I don't really understand this kind of code very well:

In introspect the following code is used, which I shameless copied:

def getCallTip(command='', locals=None):
    """For a command, return a tuple of object name, argspec, tip text.
       The call tip information will be based on the locals namespace."""
    calltip = ('', '', '') # object name, argspec, tip text.
    # Get the proper chunk of code from the command.
    root = getRoot(command, terminator='(')
    try:
        if locals is not None:
            object = eval(root, locals) #<<<===== problems

now this always returns nothing.
If I change "locals" to " locals()" everything works perfect.

cheers,
Stef