2020-06-23 04:05:30 +02:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
2017-09-20 10:15:56 +02:00
|
|
|
import sys
|
|
|
|
|
2019-06-26 03:39:41 +02:00
|
|
|
try:
|
|
|
|
input_function = raw_input
|
|
|
|
except NameError:
|
|
|
|
input_function = input
|
2017-09-20 10:15:56 +02:00
|
|
|
|
|
|
|
prompts = sys.argv[1:] or ['foo']
|
|
|
|
|
2021-02-23 18:57:25 +01: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 10:15:56 +02:00
|
|
|
for prompt in prompts:
|
2019-06-26 03:39:41 +02:00
|
|
|
user_input = input_function(prompt)
|
2017-09-20 10:15:56 +02:00
|
|
|
print(user_input)
|