9e2f933387d1aa4e457411f1e1145a4d24b4a6ff
[bottlenecks.git] / vstf / vstf / common / input.py
1 #!/usr/bin/python
2 # -*- coding: utf8 -*-
3 # date: 2015-09-09
4 # see license for license details
5
6 __author__ = 'wly'
7 __version__ = '0.1'
8
9 import os
10
11
12 def raw_choice(title):
13     ret = {'Y': True, 'N': False}
14     while True:
15         os.system("clear")
16         in_str = "\n%s:(y|n)  " % title
17         uin = raw_input(in_str).title()
18         if uin in ['Y', 'N']:
19             break
20     return ret[uin]