This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::: hljs-center | |
**PT自动签到** | |
::: | |
已比较棘手的天空为例,脚本python写的,自行搭建环境,下面代码。 | |
```#coding=utf-8 | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
# coding:utf-8 | |
import shutil | |
a=0 | |
readDir = "F:\\ipt.txt" #old | |
writeDir = "F:\\ipt1.txt" #new | |
# txtDir = "/home/fuxueping/Desktop/1" | |
lines_seen = set() | |
outfile = open(writeDir, "w", encoding='UTF-8') | |
f = open(readDir, "r", encoding='UTF-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
import re | |
import requests | |
from requests import RequestException | |
import time | |
import random | |
def get_page(url): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
''' | |
第一个 | |
''' | |
import os | |
import re | |
import time | |
import json | |
import argparse | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
命令很简单,新建个bat文件,将之前三条命令copy过来就完事,关键是怎么保证每条命令都执行,在网上查了下,说可以用&&连接,试了下,还是只执行了第一条命令,后来组长调了下,将bat文件改为 start 命令1 start 命令2......的格式 就成功了。 | |
据了解,是因为我此次执行的命令是三个没有关联的命令,直接start就行了,网上查的用&,&&,||连接的情况适用于多条有关联的命令一起执行的情况,如下: | |
命令1 & 命令2 & 命令3 ... (无论前面命令是否故障,照样执行后面) | |
命令1 && 命令2 && 命令3....(仅当前面命令成功时,才执行后面) | |
命令1 || 命令2 || 命令3.... (仅当前面命令失败时.才执行后面) | |
&& 和 || 属于逻辑运算符号 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在各种浏览器打开的任意页面上使用F12功能键,即可使用开发者工具,在窗口console标签下,键入 "document.charset" 即可查看网页的编码方式。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[一:100行Python代码快速获得一个代理池,两分钟获得数千个有效代理](https://github.com/0xHJK/Proxies) | |
[二:小说下载|小说爬取|起点|笔趣阁|导出Markdown|导出txt|转换epub|广告过滤|自动校对](https://github.com/ma6254/FictionDown) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[使用天翼家庭云来提速家用宽带, 以及反编译天翼家庭云apk获得Signature算法](http://blog.ruterfu.com/2019/02/09/faster-upload-using-tianyicloud/) | |
[2019-4-1 天翼云盘(家庭云)模拟提速设置方法分享](http://koolshare.cn/thread-158372-1-1.html) | |
[天翼家庭云 APP 提速 Python 脚本](https://www.v2ex.com/t/555226#reply23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
安装 | |
pip3 install pyinstaller 即可 | |
注意:别用pip3.6 install | |
打包 | |
进入你要打包的python目录 | |
按照你脚本程序中文件需求把python用到的文件放在一起 | |
进入cmd程序丑陋的黑窗口 | |
在光标后面键入pyinstaller yourfilename.py ,回车即可 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在利用python解决各种实际问题的过程中,经常会遇到从某个对象中抽取部分值的情况,切片操作正是专门用于完成这一操作的有力武器。理论上而言,只要条件表达式得当,可以通过单次或多次切片操作实现任意切取目标值。切片操作的基本语法比较简单,但如果不彻底搞清楚内在逻辑,也极容易产生错误,而且这种错误有时隐蔽得比较深,难以察觉。本文通过详细例子总结归纳了切片操作的各种情况。若有错误和不足之处请大牛指正! | |
一、 Python可切片对象的索引方式 | |
包括:正索引和负索引两部分,如下图所示,以a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]为例: | |
python索引方式.jpg |
OlderNewer