本文整理汇总了Python中feedback.Feedback.get_response方法的典型用法代码示例。如果您正苦于以下问题:Python Feedback.get_response方法的具体用法?Python Feedback.get_response怎么用?Python Feedback.get_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feedback.Feedback
的用法示例。
在下文中一共展示了Feedback.get_response方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: value
# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import get_response [as 别名]
# Test basic messages
i_back = feedback.info('Testing information message')
s_back = feedback.success('Testing success message')
w_back = feedback.warn('Testing warning message')
e_back = feedback.error('Testing error message')
# Test user input
feedback.input('Ask the user for some data: ', key='key_one')
feedback.input('Ask the user a "y" or "n" question? (y/n): ', key='key_two', yes_no=True)
feedback.input('Ask the user for a password and confirm: ', key='key_three', secure=True, confirm=True)
feedback.input('This input has a default value (123): ', key='key_four', default=123)
# Test block display and response retrieval
feedback.block([
'This is a block of indented text, and here is some stuff to look at:',
'Response 1: {0}'.format(feedback.get_response('key_one')),
'Response 2: {0}'.format(feedback.get_response('key_two')),
'Response 3: {0}'.format(feedback.get_response('key_three')),
'Response 4: {0}'.format(feedback.get_response('key_four')),
'Info Returned: {0}'.format(i_back),
'Success Returned: {0}'.format(s_back),
'Warn Returned: {0}'.format(w_back),
'Error Returned: {0}'.format(e_back),
'And that\'s the end of this block'
], 'ABOUT')
# Create new instance with timestamp
del feedback
feedback = Feedback(use_timestamp=True)
# Test basic messages