Oct-07-2019, 04:47 PM
hello,
I am extremely new to python so bare with me. I am using a product that requires the use of python for custom functionality.
I have an automation tool that is ingesting and reading an email. I need this email to "split" at a specified string. That string is 'Classification:' however, Classification may not always be in the email to be split at, sometimes the string may be 'Sent with BlackBerry Work'. The string I am working with now is:
, line 37, in splitresponse
AttributeError: 'list' object has no attribute 'strip'
any help would be appreciated, I basically need the email to split at either "Classification:" or "Sent with BlackBerry Work" it will always be one or the other present, never both.
Thank you,
I am extremely new to python so bare with me. I am using a product that requires the use of python for custom functionality.
I have an automation tool that is ingesting and reading an email. I need this email to "split" at a specified string. That string is 'Classification:' however, Classification may not always be in the email to be split at, sometimes the string may be 'Sent with BlackBerry Work'. The string I am working with now is:
splitresponse__response_value = filtered_artifacts_item_1_0[0].split('Classification:') if "Classification:" in filtered_artifacts_item_1_0 else (filtered_artifacts_item_1_0, "Sent with BlackBerry Work")[0].strip()When I run this, I receive this:
, line 37, in splitresponse
AttributeError: 'list' object has no attribute 'strip'
any help would be appreciated, I basically need the email to split at either "Classification:" or "Sent with BlackBerry Work" it will always be one or the other present, never both.
Thank you,