Link to home
Start Free TrialLog in
Avatar of Pradeep0308
Pradeep0308Flag for India

asked on

Python Assistance

Hi Guys,

I have the below python script:

data = siWfc.getWFContent("processString")
node = siWfc.getWFContent("processNode")
try:
        if len(data) > 0:
                parms = data.split('&')
                for p in parms:
                        nv = p.split('=',1)
                        siWfc.setWFContent(node + "/" + nv[0],nv[1],1)
except AttributeError:
        siWfc.setBasicStatus(siWfc.SUCCESS)
except TypeError:
        siWfc.setBasicStatus(siWfc.SUCCESS)

If below is passed to it as input:

1st Input:
 <processNode>NOTIFY_PARMS</processNode>
  <processString>ADDRESS</processString>

2nd Input:
<processNode>NOTIFY_PARMS</processNode>
  <processString>NotificationRule/ADDRESS</processString>

Both fail with the error:

exception from Jython: Traceback (innermost last): File "<string>", line 8, in ? IndexError: index out of range: 1

Can someone assist and tell me what the issue is?

Regards
Pradeep
Avatar of Pradeep0308
Pradeep0308
Flag of India image

ASKER

Also this script at times is causing General Protection Fault. Can someone tell me what is wrong with the above code?
ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. Do you know why the above code is causing General Protection Fault.?
What does this have to do with Java exactly?
Avatar of pepr
pepr

@CEHJ: Jython is Python implementation in Java. This way, and assuming that Pradeep may be a beginner in Python, and possibly the used library is written in Java, the Java tag is reasonable.

@Pradeep:
Do you know why the above code is causing General Protection Fault?

I do not know. But this is not usual bug in Python. It seems to be the bug in the library you use.
Is it Jython  Pradeep0308?
@CEHJ: See the error message.