Apr-25-2018, 10:13 AM
Good morning to all!
I'm trying to change a python script to have a slightly different behaviour, but I'm stuck with this.
I have a Class: #pseudo code
I have this to parse the txt file but don't know how to use the info and put inside the exec function, replacing the string1 and string2 data with the data from my txt(is inside the invoke):
Thank you!
I'm trying to change a python script to have a slightly different behaviour, but I'm stuck with this.
I have a Class: #pseudo code
Class pairs: _pairs = {} def append(self, string1, string2)): return self._pairs[string1][string2]And have an Exec function inside an invoke: #pseudo code
self.pairs = pairs() for i in range(max_number): exec((self.pairs.append({0}.string1, {0}.string2).format('prefs', i))I'm trying to get the info of string1 and string2 from a txt file, using each line as number (max_number).
I have this to parse the txt file but don't know how to use the info and put inside the exec function, replacing the string1 and string2 data with the data from my txt(is inside the invoke):
with open(alias_path, "r") as alias: line_count = 0 for line in alias: if not line.startswith("#"): line_count += 1 parameters =[] for elements in line.split(", "): parameters.append(elements)Can you help me, please?
Thank you!