Peter Hansen <[EMAIL PROTECTED]> writes:
> I'm not sure what "completion" means in this case, and I'm not aware
> of any "command-line completion" support in cmd.Cmd though it may well
> be there, so I can't say. Certainly there is nothing in any way
> different about the new attribute created by
Peter Hansen <[EMAIL PROTECTED]> writes:
> If it's truly just an alias you want, then something like this should
> work better. Replace everything in the if mo: section with this:
>
> if mo:
> newName = mo.group(1)
> existingName = mo.group(2)
> existingMethod = getattr(self, 'do_'
I have a class (Command) that derives from cmd.Cmd and I want to add
methods to it dynamically. I've added a do_alias() method and it would
be nice if I could turn an alias command into a real method of Command
(that way the user could get help and name completion). The code would
be generated dyna
Peter Hansen <[EMAIL PROTECTED]> writes:
> class _Helper(object):
> """Define the built-in 'help'.
> This is a wrapper around pydoc.help (with a twist).
>
> """
>
> def __repr__(self):
> return "Type help() for interactive help, " \
> "or help(object) f
Is there a way to get help the way you get it from the Python
interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the
module cmd.Cmd? I know how to add commands and help text to cmd.Cmd
but I would also like to get the man-page-like help for classes and
functions. Does anyone know how
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> Sarir Khamsi wrote:
>
>> I would like to start a child process (like w/ popen3(), or some such)
>> and then be able to interrupt it by sending it a control-c. How do I
>> do that in Python? Is there a bette
I would like to start a child process (like w/ popen3(), or some such)
and then be able to interrupt it by sending it a control-c. How do I
do that in Python? Is there a better way to gracefully halt a child
process? Is there a more cross-platform way to start a child process
(popen() is only on UN
I come from a C++ background and am learning some of the details of
Python's OO capability and now have some questions. Given:
#!/bin/env python
class A(object):
_x = 10
def __init__(self): self.x = 20
def square(self): return self.x * self.x
print 'A.x = %d' % A._x
a = A()
print 'a.x =