codon
codon copied to clipboard
Throw an ERROR when the Python file includes "input()" command
Environment:
- Ubuntu 22.04.1 LTS on WSL2
- Windows Version: Windows10 19045.2251
- Release v0.15.1 codon-linux-x86_64.tar.gz
ERROR
- Python file:
codon_test.py
a = input()
print(a)
- Command:
codon run ./codon_test.py
- Error:
dcodon_test.py:1:5-10: error: name 'input' is not defined
codon_test.py:2:7-8: error: name 'a' is not defined
input is not yet implemented by Codon.
inputis not yet implemented by Codon.
Hello, is there a plan to add support for input()?
Any alternatives to input()?
@SwiftWinds @FHYQ-Dong @twelveand0
Below is a simple implementation of input().
import sys
def input(string=""):
print(string, file=sys.stdout)
for line in sys.stdin:
return line
a = input("Enter string:")
print(a)
This is finally supported with https://github.com/exaloop/codon/commit/5e2d04188ebadb06a8d2d36822f7d0f414d99571