正文
)
# 几号,注意补全数字,为两位数,比如6号必须写成08
birthday_day = cf.get(
"configuration"
,
"birthday_day"
)
# 读取早上起床时间,中午吃饭时间,下午吃饭时间,晚上睡觉时间的随机提示语
# 一般这里的代码不要改动,需要增加提示语可以自己打开对应的文件修改
#早上起床问候语列表,数据来源于新浪微博
str_list_good_morning = ''
with open(
"./remind_sentence/sentence_good_morning.txt"
,
"r"
,encoding='UTF-8') as f:
str_list_good_morning = f.readlines()
print(str_list_good_morning)
#中午吃饭问候语列表,数据来源于新浪微博
str_list_good_lunch = ''
with open(
"./remind_sentence/sentence_good_lunch.txt"
,
"r"
,encoding='UTF-8') as f:
str_list_good_lunch = f.readlines()
print(str_list_good_lunch)
#晚上吃饭问候语列表,数据来源于新浪微博
str_list_good_dinner = ''
with open(
"./remind_sentence/sentence_good_dinner.txt"
,
"r"
,encoding='UTF-8') as f:
str_list_good_dinner = f.readlines()
print(str_list_good_dinner)
#晚上睡觉问候语列表,数据来源于新浪微博
str_list_good_dream = ''
with open(
"./remind_sentence/sentence_good_dream.txt"
,
"r"
,encoding='UTF-8') as f:
str_list_good_dream = f.readlines()
print(str_list_good_dream)
# 设置晚上睡觉问候语是否在原来的基础上再加上每日学英语精句
# False表示否 True表示是
if((cf.get(
"configuration"
,
"flag_learn_english"
)) == '1'):
flag_learn_english = True
else:
flag_learn_english = False
print(flag_learn_english)
# 设置所有问候语结束是否加上表情符号
# False表示否 True表示是
str_emoj =
"(•‾̑⌣‾̑•)✧˖°----(๑´ڡ`๑)----(๑¯ิε ¯ิ๑)----(๑•́ ₃ •̀๑)----( ∙̆ .̯ ∙̆ )----(๑˘ ˘๑)----(●′ω`●)----(●・̆⍛・̆●)----ಥ_ಥ----_(:qゝ∠)----(´;ω;`)----( `)3')----Σ((( つ•̀ω•́)つ----╰(*´︶`*)╯----( ´´ิ∀´ิ` )----(´∩`。)----( ื▿ ื)----(。ŏ_ŏ)----( •ิ _ •ิ )----ヽ(*΄◞ิ౪◟ิ‵ *)----( ˘ ³˘)----(; ´_ゝ`)----(*ˉ﹃ˉ)----(◍'౪`◍)ノ゙----(。◝‿◜。)----(ಠ .̫.̫ ಠ)----(´◞⊖◟`)----(。≖ˇェˇ≖。)----(◕ܫ◕)----(`◕‸◕´+)----(▼ _ ▼)----( ◉ืൠ◉ื)----ㄟ(◑‿◐ )ㄏ----(●'◡'●)ノ♥----(。◕ˇ∀ˇ◕)----( ◔ ڼ ◔ )----( ´◔ ‸◔`)----(☍﹏⁰)----(♥◠‿◠)----ლ(╹◡╹ლ )----(๑꒪◞౪◟꒪๑)"
str_list_emoj = str_emoj.split('----')
if ((cf.get(
"configuration"
,
"flag_wx_emoj"
)) == '1'):
flag_wx_emoj = True
else:
flag_wx_emoj = False
print(str_list_emoj)
# 设置节日祝福语
# 情人节祝福语
str_Valentine = cf.get(
"configuration"
,
"str_Valentine"
)
print(str_Valentine)
# 三八妇女节祝福语
str_Women = cf.get(
"configuration"
,
"str_Women"
)
print(str_Women)
# 平安夜祝福语
str_Christmas_Eve = cf.get(
"configuration"
,
"str_Christmas_Eve"
)
print(str_Christmas_Eve)
# 圣诞节祝福语
str_Christmas = cf.get(
"configuration"
,
"str_Christmas"
)
print(str_Christmas)
# 她生日的时候的祝福语
str_birthday = cf.get(
"configuration"
,
"str_birthday"
)
print(str_birthday)
如果你愿意,可以在上面对时间的判断中,加入一些其他你想要的,这样你女友就更开心啦!
2. 开启微信机器人
,为了程序的健壮性,自动判断一下操作系统,根据不同操作系统执行不同指令:
# 启动微信机器人,自动根据操作系统执行不同的指令
# windows系统或macOS Sierra系统使用bot = Bot()
# linux系统或macOS Terminal系统使用bot = Bot(console_qr=2)
if('Windows' in platform.system()):
# Windows
bot = Bot()
elif('Darwin' in platform.system()):
# MacOSX
bot = Bot()
elif('Linux' in platform.system()):
# Linux
bot = Bot(console_qr=2,cache_path=True