We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--- update_chunzhen.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/update_chunzhen.py b/update_chunzhen.py index 54e3939..064843e 100644 --- a/update_chunzhen.py +++ b/update_chunzhen.py @@ -103,14 +103,18 @@ def updateQQwry(filename): return -6 if __name__ == '__main__': - import sys - if len(sys.argv) > 1: - ret = updateQQwry(sys.argv[1]) + import argparse + argumentParser = argparse.ArgumentParser("download cz IP data") + + argumentParser.add_argument("--file",help="download file of name",type=str) + + args = argumentParser.parse_args() + print('args',args) + if(args.file != None): + ret = updateQQwry(f'{args.file}.dat') if ret > 0: print('成功更新到%s,%s字节' % - (sys.argv[1], format(ret, ',')) + (args.file, format(ret, ',')) ) else: - print('更新失败,错误代码:%d' % ret) - else: - print('用法:以想要保存的文件名作参数。') + print('更新失败,错误代码:%d' % ret) \ No newline at end of file --
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: