esptool.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:nodemcu-pyflasher 作者: marcelstoer 项目源码 文件源码
def expand_file_arguments():
    """ Any argument starting with "@" gets replaced with all values read from a text file.
    Text file arguments can be split by newline or by space.
    Values are added "as-is", as if they were specified in this order on the command line.
    """
    new_args = []
    expanded = False
    for arg in sys.argv:
        if arg.startswith("@"):
            expanded = True
            with open(arg[1:],"r") as f:
                for line in f.readlines():
                    new_args += shlex.split(line)
        else:
            new_args.append(arg)
    if expanded:
        print("esptool.py %s" % (" ".join(new_args[1:])))
        sys.argv = new_args
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号