Note: this project is only for entertainment practice, girlfriend or serious intentions to contact oh ~
01 abstract
02 Writing Ideas
# read configuration files cf = configparser. The configparser (cf. Read (". / config. Ini ", encoding = "utf-8") # set girlfriend WeChat name, remember, Not wechat ID, not wechat note # Your girlfriend's wechat name, remember, My_lady_wechat_name = cf. Get ("configuration", "my_lady_wechat_name") # Say_good_morning = cf. Get ("configuration", "say_good_morning") say_good_lunch = cf. Get ("configuration", "say_good_lunch") say_good_dinner = cf.get("configuration", "say_good_dinner") say_good_dream = cf.get("configuration", # say_good_dream # say_good_dream # say_good_dream For example, you must write 06 birthDAY_month = cf. Get ("configuration", "birthday_month") # which is a two-digit number. Get ("configuration", "birthday_day") # birthday_day = cf. Get ("configuration", "birthday_day") # birthday_day = cf. Get ("configuration", "birthday_day") # birthday_day If you need to add prompts, you can open the corresponding file to modify # Get up in the morning greeting list. 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_lung. 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) # if((cf.get("configuration", "flag_learn_english")) == '1'): flag_learn_english = True else: Flag_learn_english = False print(FLAG_learn_English) # set whether to end all greetings with an emoji # False indicates no True indicates yes str_emoj = "(• ‾ ̑ ⌣ ‾ ̑ •) ✧ ˖ ° - (๑ ´ ڡ ` ๑) - (๑ ¯ ิ epsilon ¯ ิ ๑) - (๑ • ́ ₃, ̀ ๑) - (f. ̆. ̯, ̆) - (๑ ˘ ˘ ๑) - (low 'omega ` low) - (low ̆ ⍛ ̆ second-ranking) - ಥ _ ಥ - _ (: q ゝ <) - (´; Omega. `) - (`) 3 ') - Σ (((つ, ̀ omega, ́) つ - ╰ ´ (* ︶ ` *) ╯ - (´ ´ ิ ∀ ´ ิ `) - (´ studying `.) - (ื ▿ ื) - (. ŏ _ ŏ) - (• ิ _ • ิ) - ヽ (* ΄ ◞ ิ ౪ ◟ ิ ‵ *) - (˘ after ˘) - (; ´_ゝ ')----(*ˉ ˉ)----(◍'౪ 'milk) blue rag (. ◝ ‿ ◜). - (ಠ ̫. ̫ ಠ) - (´ ◞ ⊖ ◟ `) - (. ≖ legend ≖.) - (◕ lash ◕) - (` ◕ ‸ ◕ ´ +) - (▼ _ ▼) - (◉ ื ൠ ◉ ื) - well (◑ ‿ ◐) ㄏ - (low low ◡) ノ has - (. ◕ ˇ ∀ ˇ ◕) - (◔ ڼ ◔) - (´ ◔ ‸ ◔ `) - (☍ man ⁰) - (has ◠ ‿ ◠) - ლ (╹ ◡ ╹ ლ) - (๑ ꒪ ◞ ౪ ◟ ꒪ ๑) "str_list_emoj = str_emoj. Split the if (' - ') ((cf.get("configuration", "flag_wx_emoj")) == '1'): flag_wx_emoj = True else: Str_Valentine = cf. Get ("configuration", Str_Women = cf. Get ("configuration", 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)Copy the code
If you want, add something else to the time judgment above to make your girlfriend happier!
2. Start the wechat robot. For the robustness of the program, automatically judge the operating system and execute different instructions according to different operating systems:
How do you teach your girlfriend English every day?
Def get_message(): r = requests.get("http://open.iciba.com/dsapi/") note = r.json()['note'] content = r.json()['content'] return note,contentCopy the code
4. Only daily greetings and festival greetings are not enough. We must always know her mood index. The code is as follows:
5. After teaching our girlfriend English, we start sending her our concerns. Here are the operations related to wXPY module:
6. How to send caring messages regularly every day, first do a while loop, 365 days unlimited care
T = Thread(target=start_care, name='start_care'). Tart ()Copy the code
** 03 Use tutorial **
PIP installs the following packages:
-
**[x] pip install wxpy**
-
**[x] pip install requests**
Ps: The article comes from CSDN blogger Wang_AI