redis.zadd('language', 'C', 1)
Add an element to the sorted set and report an error ‘STR’ object has no attribute ‘items’
Error source
for pair in iteritems(mapping):
pieces.append(pair[1])
pieces.append(pair[0])
We need a dictionary here
Modification
redis.zadd('language', {'C': 1})
Done!
Similar Posts:
- [Solved] Python error: attributeerror: type object ‘STR’ has no attribute ‘_name_’ (machine learning practice treeplotter code)
- Selected Style Not Working”>[Solved] React Issue:
Selected Style Not Working - CentOS8 Install redis-6.0.6 make test:“ You need tcl 8.5 or newer in order to run the Redis test“
- event.srcElement And event.target The difference between
- InvalidSelectorError: Compound class names not permitted [How to Solve]
- [Solved] Open quote is expected for attribute “name” associ
- The solution of ‘STR’ object has no attribute ‘get’ error
- Error reported in the celery log of the project: redis.exceptions.connectionerror failed to connect with redis
- [Solved] Redis MISCONF ERROR: Redis is configured to save RDB snapshots
- Python: `if not x:` VS `if x is not None:` VS `if not x is None:`