Jump to content

Is there a way to include Python code into Python SOPs as a block of c


magneto

Recommended Posts

I am looking for a way to insert the contents of a python file into a Python SOP, so I can have the actual SOP code in an external file while the SOP code only loads it. For instance something like this:

include "$OperatorTypeName.py"

This is more of a compile-time thing where it literally copy/pastes the contents of the file.

Is this possible? :)

Link to comment
Share on other sites

Thanks Graham, that would work too. Although the less code I have in the SOP, the better :)

Also in the include method, I wouldn't have to look at the internal SOP code or change it ever again, hence me also using the $HDA_NAME.

Edited by magneto
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...