'unknown' command processing in python ?

R

rjain7

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top