catchyid Posted March 16, 2021 Share Posted March 16, 2021 hi, houdini 17.5, linux, python 2.7 (the version that ships with houdini :)) i want to launch a hython script in a shell (e.g. xterm) and show its progress to end user (basically, I need to show to artist the progress of this script, also, I want this xterm to be independent of houdini, meaning, if the user shuts down houdini, i want xterm to be running and finishe the job). I am new to python, so I checked quickly and found a way to use subprocess.Popen(['xterm'],stdout=PIPE,stderr=PIPE) which starts a shell, but could not find anyway to send the command (e.g. my hython script) to the shell (tried process.communicate, ...but nothing worked!) I am thinking, maybe there is another ready to use gui/API in houdini to allow that? note: i don't want to use "run in the background" in file cache node because I need to run a script, plus i might run multiple instances of the same script (each one is doing processing different part of the hip file, it's all done on the fly, so I don't even know how many file cache node I need) Thx Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 16, 2021 Share Posted March 16, 2021 # myscript.py import os import time for f in os.listdir("."): time.sleep(0.1) print(f) From Houdini: import subprocess # Note the -u flag for unbuffered output cmd = "xterm -hold -e 'hython -u myscript.py'" proc = subprocess.Popen(cmd, shell=True) 1 Quote Link to comment Share on other sites More sharing options...
catchyid Posted March 16, 2021 Author Share Posted March 16, 2021 what can I say , thank you is not enough , really appreciate your help thx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.