Dear autoprogram team,
If I have a code like this:
if __name__ == "__main__":
logger.setLevel("DEBUG")
parser = argparse.ArgumentParser(
description="""random"""
)
then the autoprogram is unable to see the parser object for that specific file. Moving parser up before the if works, but require all the add_argument to be above the if __name__ == "__main__".
I usually declare the parser only if this is executed as a script or with the -m option of python, and tend to avoid global objects otherwise.
Is there a way to make it work like this?
Thank you,
Dear
autoprogramteam,If I have a code like this:
then the
autoprogramis unable to see theparserobject for that specific file. Movingparserup before theifworks, but require all theadd_argumentto be above theif __name__ == "__main__".I usually declare the
parseronly if this is executed as a script or with the-moption of python, and tend to avoid global objects otherwise.Is there a way to make it work like this?
Thank you,