- Posts: 6
- Joined: Mon Dec 27, 2021 12:23 am
- Real Name: Raja Ranjan Senapati
It appears the Resolve console window does not support stdin, since it is GUI-based. As a workaround, I wrote a wrapper on top of turtle as well as system stdin. This works seamlessly in a terminal as well as Resolve console GUI window
Here's my implementation, in case someone encounters the same issue:
- Code: Select all
import sys
import turtle
def safe_input(input_message):
if not sys.stdin:
sc = turtle.Screen(); #access turtle screen
sc.setup(0, 0); # change the screen size to zero
return turtle.textinput("Your App Title", input_message); #prompt the user with an input dialog
return input(str);
# Now switch call to input() with safe_input()
#this will use system.stdin where available, or else will switch to turtle.
some_var = safe_input('enter your input value');
The other workaround is to use Fusion UI manager and move away from the console altogether.