For some reason I’m getting an error on these lines of code in Python:
for identity in identities.iterkeys():
if "twitter" in identity:
OUT.write(identity.rsplit('/', 0))
And this is the error that I’m getting:
OUT.write(identity.rsplit('/', 0))
TypeError: must be string or buffer, not list
I’m utterly confused why the if "twitter" line would work but the rsplit would not and I’ve been beating my head against this all night. (The string is a URL, if that makes any difference.)
rsplitreturns a list. You need to retrieve the string again.BTW,
identity.rsplit('/', 0')[0]just returns youridentitystring unchanged. May be you are looking foridentity.rsplit('/', 1)[1].