Jun-23-2023, 07:59 PM
Thanks your very much, that was what I was looking for
Now I have to learn the details you have implemented it
I have tested to loop over the "Steps": Working well
You used embedded in the code:
If I use:
Now I have to learn the details you have implemented it
I have tested to loop over the "Steps": Working well
print(len(root['Step'])) for item in root['Step']: print(item + " ---> " + root['Step'][item]['Progress'].data + " ---> " + root['Step'][item]['Result'].data)
Output:2
1 ---> finished ---> good
2 ---> finished ---> error
One question, I'm struggling to get it really from file.You used embedded in the code:
file = io.StringIO('''\ Step.1 = Tas...How to get it from the separate file "File.txt"?
If I use:
file = open('File.txt')I get:
Output:Traceback (most recent call last):
File "f:\python_test\parse.py", line 30, in <module>
root = parse(file)
File "f:\python_test\parse.py", line 20, in parse
lvalue, rest = line.split('=', maxsplit=1)
ValueError: not enough values to unpack (expected 2, got 1)