Satya,
One way would be to save away the original/default displayhook function,
then restore it when done:
# Save original displayhook; assign new
oldfunc, sys.displayhook = sys.displayhook, eatdisplay
# ... call misc functions here
# restore original displayhook
sys.displayhook = oldfunc
--A
----- Original Message -----
From: Satya Ghattu
To: Jeff Emanuel
Cc: 'Jython-Users (E-mail)'
Sent: Tuesday, September 23, 2003 4:06 PM
Subject: Re: [Jython-users] Does Jython Function's always print the return
value?
Jeff,
Thanks for the answer. How do I get back to the default behavior after the
function call?
Thanks,
-satya
Jeff Emanuel wrote:
Perhaps this will help:
def foo():
... return "a string"
...
foo()
'a string'
import sys
def eatdisplay(dummy):
... pass
...
sys.displayhook=eatdisplay
foo()
-----Original Message-----
From: Satya Ghattu [mailto:sghattu@...]
Sent: Tuesday, September 23, 2003 9:34 AM
To: 'Jython-Users (E-mail)'
Subject: [Jython-users] Does Jython Function's always print the return
value?
Does Jython function's always print the return value if the return value
is not assigned to any variable. For example I have a function 'set'
that returns 1 if successful and 0 if not. When I call this function as
shown:
>>>set('Name','Foo')
1
>>>
The function definition is shown:
def set(attrName, value):
return myBean.set(Name,value)
where myBean is a java bean that returns 'true' if set is succesful and
'false' if not.
Is there a way to stop Jython to print the return value?
Thanks for any help,
-satya
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users
|