Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw an ERROR when the Python file includes "input()" command #96

Open
FHYQ-Dong opened this issue Dec 13, 2022 · 4 comments · May be fixed by #451
Open

Throw an ERROR when the Python file includes "input()" command #96

FHYQ-Dong opened this issue Dec 13, 2022 · 4 comments · May be fixed by #451
Labels
enhancement New feature or request

Comments

@FHYQ-Dong
Copy link

FHYQ-Dong commented Dec 13, 2022

Environment:

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
@inumanag inumanag added the enhancement New feature or request label Dec 18, 2022
@inumanag
Copy link
Contributor

input is not yet implemented by Codon.

@twelveand0
Copy link

input is not yet implemented by Codon.

Hello, is there a plan to add support for input()?

@SwiftWinds
Copy link

Any alternatives to input()?

@elisbyberi
Copy link

elisbyberi commented Mar 24, 2023

@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)

@knogu knogu linked a pull request Sep 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants