zoukankan      html  css  js  c++  java
  • Python3源码学习-requests

    源码:https://github.com/small99/AutoLink

    本地安装包 version.txt记录版本号。

    通过requests GET最新git上版本号。

    import codecs
    import requests
    
    
    def check_version():
        with codecs.open('version.txt', 'r') as fd:
            version = fd.readline()
    
        s = requests.Session()
        r_version = s.get("https://gitee.com/lym51/AutoLink/raw/master/version.txt").text
        if version != r_version:
            print("*" * 25)
            print("本地版本:v%s" % version)
            print("github版本: v%s" % r_version)
            print("AutoLinK开源平台代码已有更新,请到下面的地址更新代码:")
            print("下载最新代码,直接覆盖本地即可")
            print("https://github.com/small99/AutoLink")
            print("*" * 25)
            exit(0)
    
    
    check_version()
    

      

  • 相关阅读:
    POJ 1045
    POJ 1051
    POJ 1047
    POJ 1050
    POJ 1046
    POJ 1036
    POJ 1035
    POJ 1032
    【洛谷P1412】经营与开发
    【洛谷P3377】【模板】左偏树(可并堆)
  • 原文地址:https://www.cnblogs.com/zhangwei22/p/10161445.html
Copyright © 2011-2022 走看看