Exemplo n.º 1
0
 def typora():
     print("downloading typora...")
     #ad="https://www.typora.io/windows/typora-setup-x64.exe"
     #download.downld(ad)
     #color.printYellow("完成!")
     color.printYellow("Sorry,该网站禁止爬虫...")
     return 0;
Exemplo n.º 2
0
def requestApi(api):
    data = parse.urlencode(api['data'])
    req = request.Request(api['url'])
    try:
        begin = datetime.datetime.now()
        printYellow(u'%s 【start】\n' % (api['url']))
        printYellow(u'%s [params]\n' % (api['data']))
        response = request.urlopen(req, data=data.encode('utf-8'))
        result = response.read()
        end = datetime.datetime.now()
        logger(result, api['url'], end - begin)
    except Exception as e:
        printRed(u'【error】: %s \n' % (e))
Exemplo n.º 3
0
def installSoftware():
    # os.system(clear) #错了姐姐 #我没有!  #好好好
    inCtrl=0
    while inCtrl==0:
        def steam():
            print("downloading steam...")
            ad="https://media.st.dl.bscstorage.net/client/installer/SteamSetup.exe"
            download.downld(ad)
            color.printYellow("完成!")
            return 0;
            #name="SteamSetup.exe"    #想不到从ad上直接截下来的方法 好像能用split 害
            #download.install(name)    #失败
        def vscode():
            print("downloading vscode for win32-x64...")
            ad="https://vscode.cdn.azure.cn/stable/86405ea23e3937316009fc27c9361deee66ffbf5/VSCodeUserSetup-x64-1.40.0.exe"
            download.downld(ad)
            color.printYellow("完成!")
            return 0;
        def Github_Desktop():
            print("downloading Github_Desktop...")
            ad="https://desktop.githubusercontent.com/releases/2.2.3-3e4755f1/GitHubDesktopSetup.exe"
            download.downld(ad)
            color.printYellow("完成!")
            return 0;
        def typora():
            print("downloading typora...")
            #ad="https://www.typora.io/windows/typora-setup-x64.exe"
            #download.downld(ad)
            #color.printYellow("完成!")
            color.printYellow("Sorry,该网站禁止爬虫...")
            return 0;
        color.printBlue("请选择你要安装的软件")
        color.printGreen("a steam\nb vscode \nc Github Desktop \nd typora\n\nq finish")
        option2 = {
        'a': steam,
        'b': vscode,
        'c': Github_Desktop,
        'd': typora,
        'q': finish   
        }
        optionInput = input("")
        if optionInput != 'a'and optionInput != 'b'and optionInput != 'c'and optionInput != 'd'and optionInput != 'q' :
            color.printYellow("你是猪ma?")
        else:
            exe2=option2[optionInput]
            inCtrl=exe2()
     
    return 0
Exemplo n.º 4
0
 def Github_Desktop():
     print("downloading Github_Desktop...")
     ad="https://desktop.githubusercontent.com/releases/2.2.3-3e4755f1/GitHubDesktopSetup.exe"
     download.downld(ad)
     color.printYellow("完成!")
     return 0;
Exemplo n.º 5
0
 def vscode():
     print("downloading vscode for win32-x64...")
     ad="https://vscode.cdn.azure.cn/stable/86405ea23e3937316009fc27c9361deee66ffbf5/VSCodeUserSetup-x64-1.40.0.exe"
     download.downld(ad)
     color.printYellow("完成!")
     return 0;
Exemplo n.º 6
0
 def steam():
     print("downloading steam...")
     ad="https://media.st.dl.bscstorage.net/client/installer/SteamSetup.exe"
     download.downld(ad)
     color.printYellow("完成!")
     return 0;
Exemplo n.º 7
0
def finish():
    color.printYellow("完成")     #应该在这个后面加,输回车后清屏
    if input("输入回车")=="":
        os.system('cls')
    return 1
Exemplo n.º 8
0
def backgroundPicture():
    color.printYellow("对不起……我还没学会~")
    return 0