I am trying to create a working dictionary, it works, but I have problem.
I have to pack a lot of data, but the problem is that I have variable count of strings.
I want to pack in every step, I was using
struct.pack(polozka.param, polozka.text, 0, polozka.pointer, polozka.size)
where polozka.param are parameters,
.text is english word,
0 is offset, .pointer is pointing to the translation of the word in language, and .size is size required.
I didn’t come up with any other idea so far, and I would be grateful for every advice i can find 🙂
If I start my dictionary I have result for example
Active
-translated word
Active
-translated word
but want to have
Active
-translated word, translated word,etc.
Thanks in advance 🙂
You don’t access the keys of a dictionary using attributes (
.), if you have a dictionary you usedictionary['key'].And not sure if I understood your question correctly, but I assume what you are looking for is a data structure like this:
Here are the keys of the dictionary a string and the values are corresponding lists, which have your translated words in it (also strings).
Also, I’d be good if you could provide some code.