I have a curses program that I want to invoke from Python shell by just typing hh
.
So, I have tried this:
class hh:
def __str__(self):
curses.wrapper(main)
def __repr__(self):
curses.wrapper(main)
...and then in shell:
>>> from package.module import hh
>>> hh
<class 'package.module.hh'>
However, had no success as you can see.
How can I invoke my curses program from Python shell by just typing hh
? That is, is it possible to call a function without the method invocation operator, i.e., with no parentheses? Or what else could I do that would have had the same effect?