Bootstrap FreeKB - Python (Scripting) - Resolve "dictionary update sequence element"
Python (Scripting) - Resolve "dictionary update sequence element"

Updated:   |  Python (Scripting) articles

Let's say something like this is being returned.

dictionary update sequence element #0 has length 1; 2 is required

 

I got this when attempting to create a dictionary using dict.

#!/usr/bin/python3
my_dictionary = dict("foo=bar")

 

Basically, this was just a syntax error. I had to update my Python script so that the key in the dictionary was not wrapped in quotes and the value was wrapped in quotes.

#!/usr/bin/python3
my_dictionary = dict(foo="bar")

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter f2baeb in the box below so that we can be sure you are a human.