Python Little Note

Source: Internet
Author: User

I am angry that a pig has been harassing me recently.

Teach yourself a wave of scripts:

Learning Purpose: Use a script to return back, through the py write a script, one-time to others to send n messages;

Learn Python on Mac;

Brew Install Python3 (automatically installs PIP3)

You can view brew info python3 by command

Installation Library

PIP3 install-u wxpy

All ready, write a script below:

VI a.py

#!/usr/bin/python#Coding=utf-8 fromWxpyImport*Bot=Bot () tuling= Tuling (api_key='8c02ae3f727a48669c52ca6ed5db2c48') @bot. Register ()defprint_others (msg):Print(msg) My_friend= Bot.friends (). Search (U'Zeyong', sex=MALE,) [0]#group = bot.groups (). Search (U ' debug ') [0]#@bot. Register (Group)#def reply_gua_pi (msg):#Print (msg)#Print (tuling.do_reply (msg)) forIinchRange (0,100): My_friend.send (U' I'm so banged.')#For member in group:#Print (Member)#Print (group)#print (my_friend)Embed ()

Enter the command to run:

Python3 a.py

Over ...

Python Little Note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.