'unknown' command processing in python ?

Discussion in 'Python' started by rjain7@yahoo.com, Apr 12, 2006.

  1. Guest

    Hello,

    I am a newbie; looking for an easy equivalent of TCL 'unknown' command
    in python. My basic aim is to be able to pass any command which python
    interpreter does not understand to my own C++ extension.

    The two ways that I understand:

    a) Extend cmd.Cmd() class: Will require me to write my own custom
    interpreter, however I do not want to execute my own command loop;
    rather retain existing user experience of python shell.

    b) Handle NameError exception: looks like I'd need to extend cmd.Cmd()
    class here as well...

    If you know of a simple enough way, or a code snippet that achieves
    similar purpose, I'd greatly appreciate it.

    Thanks,
    Rahul
    , Apr 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    470
    Michael Foord
    Sep 17, 2004
  2. News123
    Replies:
    6
    Views:
    1,233
    Michele Simionato
    Aug 3, 2010
  3. sarah
    Replies:
    1
    Views:
    116
    Chris Barber
    Jul 5, 2003
  4. Vincent Arnoux
    Replies:
    1
    Views:
    242
    Arnaud Bergeron
    Aug 11, 2006
  5. Priyank Shah
    Replies:
    3
    Views:
    111
    Brian Candler
    Aug 5, 2010
Loading...

Share This Page