python calling a module that uses argparser

前端 未结 3 2001
傲寒
傲寒 2021-02-05 07:23

This is probably a silly question, but I have a python script that current takes in a bunch of arguements using argparser and I would like to load this script as a module in ano

3条回答
  •  别跟我提以往
    2021-02-05 07:35

    One of the option is to call it as subprocess call like below:

    import subprocess
    childproc = subprocess.Popen('python childscript.py -file yourjsonfile')
    op, oe = childproc.communicate()
    print op
    

提交回复
热议问题