-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
stdin input #6
Comments
I coullldddd create a command for input and call that from the preview: https://code.visualstudio.com/docs/extensionAPI/vscode-api-commands But at this point it might be better to wait for the new preview API |
a user on discord just asked about this - that's a sign that i maybe i should bump this up the priority list |
This would be great to see added. Just started using the add-on today and it is very helpful. |
@itsbennett I'll start work on this today. One reason I've been avoiding this is stdin along with real time evaluation is problematic - you have to enter in new stdin each time you make a change, which can quickly get annoying. But I just had a idea for that - there could be a stdin textarea that would send the text to stdin each execution. In the meantime while you are waiting for this feature I suggest overloading stdin. If you look at the wiki I have a guide here: https://github.com/Almenon/AREPL-vscode/wiki/Using-AREPL-with-coding-challenges dependency upon #146 |
another user asked for this so bumping it up in priority. Hopefully will get this done by end of year |
The textarea idea ran into some complications - it's still doable but will take longer than I thought. But this morning I had idea for a even simpler approach. input() could tell the user to hardcode the stdin, like so: input() # prints AREPL requires stdin to be hardcoded, like so: standardInput = 'hello world'; print(input())
standardInput = "hello world"
print(input()) # prints hello world Stdin() would check for the existance of a standardInput variable and if it exists it would return it line-by-line. The only major problem with this approach is that if other libraries or files that use stdin will still cause arepl up. So it can't be a permenant solution - eventually I will have to move to a textarea in the preview window. Does the temporary fix look good @itsbennett ? |
rasied Almenon/AREPL-backend#60 |
No response from bennett. I should probably just go ahead with the temporary fix to be able to get a release out for the new year. |
@itsbennett I released the temporary fix with 1.0.5 You can hardcode stdin in three ways: def standard_input():
yield 'hello'
yield 'world'
standard_input = ["hello", "world"]
standard_input = "hello\nworld" |
a input box for stdin.
Please comment below or like if you want this feature.
The text was updated successfully, but these errors were encountered: