sfyc23 / EverydayWechat

微信助手:1.每日定时给好友(女友)发送定制消息。2.机器人自动回复好友。3.群助手功能(例如:查询垃圾分类、天气、日历、电影实时票房、快递物流、PM2.5等)
MIT License
9.99k stars 2.31k forks source link

NameError: name '女朋友' is not defined!! #31

Open sonack opened 5 years ago

sonack commented 5 years ago

找不到对象,怎么办?

MikoSecSoS commented 5 years ago

new a object.

Kyle-Kyle commented 5 years ago
GF = 女朋友()
while True:
    try:
        GF.dating()
    except GamingInterrupt:
        if GF.is_complaining():
            GF.breakup()
            break
    except CodingInterrupt:
        if not GF.is_complaining():
            continue
        for method in ["sweet words", "hug", "gift"]:
             try:
                  GF.comfort(method)
                  break
             except ComfortError:
                  continue
        else:
            GF.breakup()
            break
del GF #we need to delete GF because she takes too much *memory*
taseikyo commented 5 years ago

没有对象 new 一个嘛(滑稽

zhaoweih commented 5 years ago
GF = 女朋友()
while True:
    try:
        GF.dating()
    except GamingInterrupt:
        if GF.is_complaining():
            GF.breakup()
            break
    except CodingInterrupt:
        if not GF.is_complaining():
            continue
        for method in ["sweet words", "hug", "gift"]:
             try:
                  GF.comfort(method)
                  break
             except ComfortError:
                  continue
        else:
            GF.breakup()
            break
del GF #we need to delete GF because she takes too much *memory*

优秀的代码

Sagx commented 4 years ago

有点东西