You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
Some examples in mypy-primer uses input and that doesn't work currently.
Proposal
Make it possible to specify stdin and run the program with that as stdin.
Suggested format is:
<span id="data-greet" data-stdin='"foo\n45"'></span>
```{.python .example .hijack-input #greet}
def greet(name):
print(f"Hello, {name}!")
if __name__ == '__main__':
name = input("Enter your name: ")
age = input("Enter your age: ")
greet(name)
print(f"You will be {age + 1} years old next year.")
```
Please not that the input is specified as JSON.
PoC
inputs = iter(["foo", "45"])
def new_input(prompt):
print(prompt, end="")
x = next(inputs)
print(x)
return x
input = new_input
def greet(name):
print(f"Hello, {name}!")
if __name__ == '__main__':
name = input("Enter your name: ")
age = input("Enter your age: ")
greet(name)
print(f"You will be {age + 1} years old next year.")
The text was updated successfully, but these errors were encountered:
Some examples in mypy-primer uses
input
and that doesn't work currently.Proposal
Make it possible to specify stdin and run the program with that as stdin.
Suggested format is:
Please not that the input is specified as JSON.
PoC
The text was updated successfully, but these errors were encountered: