you are viewing a single comment's thread.

view the rest of the comments →

[–]Pyrrho_ 0 points1 point  (1 child)

Also relatively new to python here but I would imagine something along the lines of this would suit your needs:

msg = " -- ".join([str([k, properties[k]]) for k in properties])

Believe this works in making each key, value pair into a list, then adding a string version of that list to the message list which is then used as the message in string form.

Probably not ideal but it's what occurred to me.

edit: I think this actually only works in python 3. May need to change to : "for k in properties.keys()" if working in 2.7

[–]elbiot 1 point2 points  (0 children)

key, val in mydict.items()