Apply json config file using parse_args() in pycharm
I'm running sequence to sequence code in git, but I got error about parse_args().
my code is like this:

parser = argparse.ArgumentParser()
parser.add_argument(
    "--config",
    help="path to json config",
    required=True)
args = parser.parse_args()
config_file_path = args.config
config = read_config(config_file_path)
experiment_name = hyperparam_string(config)


my config file is like this :

{
  "training": {
    "optimizer": "adam",
    "clip_c": 1,
    "lrate": 0.0002,
  },
  "management": {
    "monitor_loss": 1000,
    "print_samples": 20000
  }


When I run 

args = parser.parse_args()


Pycharm raises error

pydevconsole.py: error: argument --config is required


I'd like to know that run this code through pycharm applying json config file.

I have searched in google since yesterday, but I can't find it. 

Please help..

args = parser.parse_args() parses the sys.argv[1:] list, which is provided to the interpreter from the operating system shell - ie. from the commandline.

$:python prog.py --config afilename 


You can also do

args = parser.parse_args(['--config', 'afilename'])


this handy during testing.

It also helps to:

import sys
print(sys.argv)

