2020-06-22 19:05:30 -07:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
2017-09-20 01:15:56 -07:00
|
|
|
import sys
|
|
|
|
|
2019-06-25 18:39:41 -07:00
|
|
|
try:
|
|
|
|
input_function = raw_input
|
|
|
|
except NameError:
|
|
|
|
input_function = input
|
2017-09-20 01:15:56 -07:00
|
|
|
|
|
|
|
prompts = sys.argv[1:] or ['foo']
|
|
|
|
|
2021-02-23 11:57:25 -06:00
|
|
|
# latin1 encoded bytes
|
|
|
|
# to ensure pexpect doesn't have any encoding errors
|
|
|
|
data = b'premi\xe8re is first\npremie?re is slightly different\n????????? is Cyrillic\n? am Deseret\n'
|
|
|
|
|
|
|
|
try:
|
|
|
|
sys.stdout.buffer.write(data)
|
|
|
|
except AttributeError:
|
|
|
|
sys.stdout.write(data)
|
|
|
|
print()
|
|
|
|
|
2017-09-20 01:15:56 -07:00
|
|
|
for prompt in prompts:
|
2019-06-25 18:39:41 -07:00
|
|
|
user_input = input_function(prompt)
|
2017-09-20 01:15:56 -07:00
|
|
|
print(user_input)
|