IES-VE Python API / Use navigator or gui to enter data
We're working on a script and want to accept a single-line of text from a user. For example.. proj_name = [insert code] # user to enter project name
Ideally, I'd like this to be in a new navigator just for the script, but a mini gui (using tkinter) could also work.
There are a bunch of example scripts that install with VE that are helpful, but none I've found show how to take text from a user prompt. I'm hoping somebody here can provide an example of how to do this from within VE.
Comments
I have been looking into this and cannot find anything useful. There is an option to import win32gui but I can't find a away to create an input box for that.
I tried using readline and that also failed :(. Try suggesting this a a feature to ies ;)
I found a way to do it using the tkinter libary (look for room_data.py example script) but my answer post here hasn't appeared yet.
I'll keep an eye out for your answer. Thanks for replying back to this though. This post was a while ago and we've done quite a bit of Python development since this question.. We actually removed the "project name" from our script, as it seemed silly to use Python to automate something that requires a manual user input. However, if you did want to do something like this, I'd recommend writing the entered value to a file (temp.txt or something) so that you can read it as the default value in the tkinter dialogue.. I haven't used win32gui but tkinter would certainly do what was needed here.