script sop broken?

   1078   3   2
User Avatar
Member
81 posts
Joined: Aug. 2006
Offline
this sop:
https://www.sidefx.com/docs/houdini/nodes/sop/script [www.sidefx.com]

I made a simple python script (print “hello” saved as a .py file) and added it with the file picker, it errors out every time.
Python error: SyntaxError: ('invalid syntax', etc…

if i type the code directly into the script section it works. i dont think this is how it was intended to function, why have a file picker if it doesn't work?
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
You have to wrap the path to your script like this:
execfile('$HIP/Desktop/test.py')

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
81 posts
Joined: Aug. 2006
Offline
bonsak
Hi
You have to wrap the path to your script like this:
execfile('$HIP/Desktop/test.py')

-b

thanks, but I still think this is a bug. why give a file selector if it just gives you an invalid result?
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Yes it is a little weird But i think it is because you can point to an hscript file and it will execute but not python.
You can also paste your code directly into the script parm:
Edited by bonsak - April 8, 2019 13:11:50
http://www.racecar.no [www.racecar.no]
  • Quick Links