I am using the argparse module in Python3. The result of the parsed arguments are given back as a Namespace object. But I want to have them in the current namespace and not a different one.
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(description='desc')
parser.add_argument('--profile', dest='profile_name', help='help')
# I need the magic here
print( parser.parse_args(namespace=self) )
print(profile_name)
Is there a way to handle this? Or do I have to make it myself manually like this:
args = parser.parse_args()
profile_name = args.profile_name