+ 4

How can I mimic SL's input behaviour on my own IDE?

On SL's code playground, if you want to give multiple inputs, you just put them on separate lines. I'd like to find a way of doing the same thing on Pythonista. Is there a way I can create a docstring and get all input() calls to take the next line of the docstring in turn? I find it much easier to code on Pythonista but, if I want to provide lots of inputs for a code, I have to do them individually, whereas I can just paste all inputs into SL's input box and it runs automatically. Currently I need to rework my Pythonista code to read a docstring line by line which is a pain in the neck. I tried flirting with sys.stdin but I couldn't get it to do what I wanted. Is there a way to do this? https://code.sololearn.com/cO4VRjIuduYO/?ref=app

26th Jun 2020, 4:51 PM
Russ
Russ - avatar
2 Respuestas
+ 4
https://code.sololearn.com/c5PbMncr5go8/?ref=app I don't know much about python. Hope this helps 😅
26th Jun 2020, 5:31 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
🇮🇳Omkar🕉 I hadn't considered overwriting the builtin input()! Thanks so much for your time and inspiration!
26th Jun 2020, 5:35 PM
Russ
Russ - avatar