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库进行弹窗提醒我写博客.
随机推荐
- Thunder团队第六周 - Scrum会7
Scrum会议7 小组名称:Thunder 项目名称:i阅app Scrum Master:杨梓瑞 工作照片: 参会成员: 王航:http://www.cnblogs.com/wangh013/ 李传 ...
- 找bug——加分作业
bug1:while循环中的*des++ =*src++; 不能这么写吧... bug2:maxSize没有定义 暂时看到这么多
- php 生成短网址 代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- C#中的unsafe
为了保持类型安全性,默认情况下,C# 不支持指针算法. 但是,通过使用 unsafe 关键字,可以定义可在其中使用指针的不安全上下文. 有关指针的详细信息,请参阅主题指针类型. 备注 在公共语言运行时 ...
- [OS] 操作系统-进程线程-经典面试笔试题
题目转自:http://blog.csdn.net/morewindows/article/details/7392749 ·线程的基本概念.线程的基本状态及状态之间的关系? 线程,有时称为轻量级进程 ...
- 几种常见web 容器比较
1:产品介绍 WebLogic是美国bea公司出品的一个application server确切的说是一个基于j2ee架构的中间件.BEA WebLogic是用于开发.集成.部署和管理大型分布式We ...
- 【转载】用C#编写一个简单的记事本
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Django+haystack实现全文搜索出现错误 ImportError: cannot import name signals
原因是在你的settings.py或者其他地方使用了 "import haystack" 当我们使用django-haysatck库时,表面上会有haystack库,但实际上并不 ...
- CentOS 装hadoop3.0.3 版本踩坑
1.but there is no HDFS_NAMENODE_USER defined. Aborting operation. [root@xcff sbin]# ./start-dfs.sh S ...
- 【CSU1911】Card Game(FWT)
[CSU1911]Card Game(FWT) 题面 vjudge 题目大意: 给定两个含有\(n\)个数的数组 每次询问一个数\(x\),回答在每个数组中各选一个数,或起来之后的结果恰好为\(x\) ...