Closed Simooo45 closed 2 years ago
What exception? Provide the stack trace or we can't help you
TypeError: ContextDecorator.__call__() missing 1 required positional argument: 'func'
The function is used to read a tree structure: if a node doesn't have children calls bar()
.
The structure is like:
def parse_tree(tree, bar=None):
result = []
if has_children(tree):
for child in tree:
result += parse_tree(child, bar=bar)
else:
result = ...
bar()
return result
bar = alive_bar(0, title="Main")
x = parse_tree(tree, bar=bar)
probably I'm just making a dumb blunder, but maybe you can help me :).
Thank you!
In fact was a dumb blunder... I tried the same thing, but with
with alive_bar(0, title="Main") as bar:
x = parse_tree(tree, bar=bar)
and that works. Thank you for your help and your library!
Thanks @Simooo45! I'm glad you worked that out 👍
Hi @rsalmei, I've seen your beautiful work, I tried to use in a recoursive function (I tried to create the alive-bar object before the recursion and used that as a parameter of the function) and that raised Exception. There is something that I can do in order to avoid it? Thank you soo much, best wishes.