pyttsx3 winsound win32api.MessageBox使用案例
import requests,time
from lxml import etree
import win32api,win32con
import winsound
import pyttsx3 cookies = str(input('请输入cookies:')) def ring():
engine = pyttsx3.init()
engine.say('傻逼,有户了,赶紧去抢')
engine.runAndWait() def check_account():
today = time.strftime('%Y-%m-%d',time.localtime())
url1 = 'http://cm.admin.weibo.com/customer_base/customer_base.php?hiddenuid=2&exportuid=&uid=&nickname=&start_storage_time={}&end_storage_time=+{}+&type_status=2&source=&start_open_time=&end_open_time=&filed=0&industry=0&one_industry=0®ion=0&one_region=0'
headers ={'Cookie': cookies,
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
'Host': 'cm.admin.weibo.com',
}
time.sleep(3)
res = requests.get(url1.format(today,today),headers=headers)
html = etree.HTML(res.text)
html_data = html.xpath('//*[@id="listTable"]/tbody/tr/td[3]/text()')
if len(html_data) >0:
print('哈哈傻逼,出来' + str(len(html_data)) + '个户,赶紧抢,他们是:'+ ','.join(html_data))
win32api.MessageBox(win32con.NULL,'哈哈傻逼,出来' + str(len(html_data)) + '个户,赶紧抢,他们是:'+ ','.join(html_data) , '有户了,快特么领去', win32con.MB_OK)
winsound.Beep(600,500)
ring()
return True
else:
print('没有户')
return False if __name__ == '__main__':
count = 1
while True:
todayHS = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())
print('时间:%s 第 %s 次查询-----> '% (todayHS,str(count)),end='')
flag=check_account()
if flag is True:
break
count +=1
pyttsx3 winsound win32api.MessageBox使用案例的更多相关文章
- scrapy 报错 no module named win32api 的解决方案
解决方案: 原因是缺少win32,到 http://sourceforge.net/projects/pywin32/files/ 找到对应的版本进行下载,直接安装即可 =============== ...
- Python -- Gui编程 -- Win32API的使用
消息框 messageBox.py import win32api, win32con win32api.MessageBox(0, 'Hello World!', 'Come Here', win3 ...
- python3下调用系统massagebox对话框
#python3下调用系统massagebox对话框#先安装pwin32插件https://github.com/mhammond/pywin32/releases import win32apiim ...
- python爬虫之scrapy框架
Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 其可以应用在数据挖掘,信息处理或存储历史数据等一系列的程序中.其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的, 也可以 ...
- Windows平台Python编程必会模块之pywin32
在Windows平台上,从原来使用C/C++编写原生EXE程序,到使用Python编写一些常用脚本程序,成熟的模块的使用使得编程效率大大提高了. 不过,python模块虽多,也不可能满足开发者的所有需 ...
- python 系统定时关机
#coding=utf-8 "shutdown at 23:00" from datetime import * import os import win32api import ...
- 2019-02-02 Python学习之多线程
1.主线程和次线程 若主线程结束则次线程也会结束 如何避免主线程先结束: 结尾处加上 while True: pass e.g. import win32api #引用系统函数 import _thr ...
- py 使用win32 api
http://timgolden.me.uk/pywin32-docs/contents.html https://docs.python.org/3/library/ctypes.html#ctyp ...
- Python 每日提醒写博客小程序,使用pywin32、bs4库
死循环延迟调用方法,使用bs4库检索博客首页文章的日期是否与今天日期匹配,不匹配则说明今天没写文章,调用pywin32库进行弹窗提醒我写博客.
随机推荐
- puppet学习笔记
puppet优势:容易理解.用户较多.门槛低.简单.安装配置文件较少 puppet使用Ruby语言开发,安装puppet需要安装Ruby puppet运行环境:Redhat.Centos.Window ...
- Python运行的方式
Python的运行方式多种多样,下面列举几种: 交互式 在命令行中输入python,然后在>>>提示符后面输入Python语句,这里需要注意: 1 语句前面不能有空格,否则会报错 2 ...
- oracle数据库之PL/SQL 块结构和组成元素
一.PL/SQL 块 (一)PL/SQL 程序由三个块组成,即声明部分.执行部分.异常处理部分 PL/SQL 块的结构如下: 1.DECLARE /* 声明部分: 在此声明 PL/SQL 用到的变量, ...
- 计算器软件实现系列(六)windowform窗体+SQL+策略模式
一 整体概述 这个计算器软件的功能和以前的功能基本上一样,只不过是数据的保存形式发生了变化,,以前用的是txt文件保存,现在更正用SQL数据库,现在更改了以前的文件保存形式,是三层架构中数据层的更换, ...
- lintcode-196-寻找缺失的数
196-寻找缺失的数 给出一个包含 0 .. N 中 N 个数的序列,找出0 .. N 中没有出现在序列中的那个数. 样例 N = 4 且序列为 [0, 1, 3] 时,缺失的数为2. 挑战 在数组上 ...
- Access Denied for user root @localhost 解决方案
问题描述: C:\Users\bo.wang> mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for us ...
- C# 面向对象——多态
多态分三种:1.虚方法 2.抽象类 3.接口 1.虚方法1.将父类的方法标记为虚方法 ,使用关键字 virtual,这个函数可以被子类重新写一个遍. 如: class Program { static ...
- [BZOJ2961] 共点圆 [cdq分治+凸包]
题面 BZOJ传送门 思路 首先考虑一个点$(x_0,y_0)$什么时候在一个圆$(x_1,y_1,\sqrt{x_1^2+y_1^2})$内 显然有:$x_1^2+y_1^2\geq (x_0-x_ ...
- CF724E Goods transportation 最小割 DP
照惯例CF的题不放原题链接... 题意:一个序列上有n个点,每个点有权值pi和si.表示这个点一开始有pi个物品,最多可以卖出si个物品,每个点都可以把物品向编号更大的点运输,但是对于i < j ...
- BZOJ3930:[CQOI2015]选数——题解
http://www.lydsy.com/JudgeOnline/problem.php?id=3930 https://www.luogu.org/problemnew/show/P3172#sub ...