PierreC 1 Posted December 13, 2021 Hello everyone, I have another question: is there a way to get the prompt argument of the python input() function? For example if the python code is input("Please, give me a number") I would like to get this string when dealing with the OnReceiveData or OnReceiveUniData events. Share this post Link to post
pyscripter 464 Posted December 14, 2021 (edited) You cant't, at least not easily. The input function writes to stdout the message and then reads from stdin the input. The two operations are separate. You may be able to guess from what was written to sys.stdout last. But what you can do is overwrite builtins.input with your own function. Edited December 14, 2021 by pyscripter Share this post Link to post
PierreC 1 Posted December 15, 2021 Ok, thank you. I will have a look at this possibility. Share this post Link to post