Python String Custom Functions
Brian Element
Forums
I just put together a package of python scripts for the IDEA Equation Editor. There are 18 functions that add on what you can do to a character string. You can find the package here:
http://ideascripting.com/IDEA_Lab/python-string-custom-functions
Hi Humphrey,
Hi Humphrey,
The pages have been taken down as it is now part of the IDEA Lab which is part of IDEA.
The problem with your return is that it has to return a string, so you have to cast your return value to string before IDEA will read it.
Here is an example:
#
# Usage example: appending a virtual character field to the Sample-Detailed Sales database.
# Equation example: @Python("GetPercent", SALES_TAX, SALES_BEF_TAX)
#
def GetPercent(numerator, denominator):
if(denominator == 0):
return "N/A"
return "{0:.2f} %".format(numerator/denominator*100)
User defined function. In
User defined function. In Python, a user-defined function's declaration begins with the keyword def and followed by the function name. The function may take arguments(s) as input within the opening and closing parentheses, just after the function name followed by a colon.</p>
<p>If you want to enahnce your learning on Python then you <a href="http://pythonandmltrainingcourses.com/courses/best-python-training-in-n…">best python training classes in Noida</a>