Skip to content

Commit

Permalink
Modified the msg_callback in demo.py to work with py2 and py3
Browse files Browse the repository at this point in the history
  • Loading branch information
barometz committed Sep 20, 2012
1 parent d38febe commit 11a3f2b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@

import interro as inter

c = inter.Interro(msg_callback=print)
def output(value):
"""A little wrapper to print things.
Necessary to have the msg_callback work in Python 2.7, where print isn't a
function.
"""
print(value)

c = inter.Interro(msg_callback=output)

c.add(inter.YesNoQ('TOS',
question='Do you agree to the TOS?',
Expand Down

0 comments on commit 11a3f2b

Please sign in to comment.