Note: this project is only for entertainment practice, girlfriend or serious intentions to contact oh ~

01 abstract

Off single dog benefits! Every day different time period to girlfriend regular girlfriend message, good early get up, lunch, dinner, good night time!
Sometimes, you really want to care about her, but you are so busy that she always complains that you don’t care about her enough. You resolve to text her on time next time, even if it’s just a few words, but you forget. You feel oneself very grievance 😭, but she feels you are not responsible again.
Now, don’t worry, ** use Python to send prompt messages to your girlfriend **, and won’t miss every critical moment, every morning, lunch, dinner, sleep at night, will be on time to send her a message, but also let her learn English words oh!
When your birthday comes, send your best wishes automatically. When festivals come, such as Women’s Day, Goddess Day, Valentine’s Day, Spring Festival, Christmas, automatically send greetings oh, no need to worry about him saying that you have no sense of ceremony ~
The most important time, real-time can know the girlfriend’s emotional index oh, no longer need to worry about the girlfriend inexplicable angry.

02 Writing Ideas

In order to facilitate rapid development, the wXpy module in Python is generally used to complete the basic operations of wechat.
1. Set up a config.ini configuration file and start reading information from this configuration file. These parameters are easy to read, so no need to say more.

# 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

Finally, enter the following code to start guarding girlfriend mode
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