
Python
redstoneleo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
re.sub escape repl
https://www.google.com/search?q=re.sub+escape+repl&oq=re.sub+escape+repl&aqs=chrome..69i57.7218j0j4&sourceid=chrome&ie=UTF-8is it necessary to add a 'r' before the second argument in re.sub('#\*(.+?)\*#', '<b>\g<1></b>'.原创 2022-04-07 16:31:40 · 227 阅读 · 0 评论 -
Hypothesis标注不显示的解决方案
其中一个主要原因是因为url变化造成的,比如创建标注的时候网址url是:Writing your first Django app, part 2 | Django documentation | Django或Your first Wagtail site — Wagtail Documentation 2.16.1 documentation过了一段时间后网址变成了https://docs.djangoproject.com/en/4.0/intro/tutorial02/或原创 2022-03-29 14:19:38 · 828 阅读 · 0 评论 -
英酷词典 使用方法 必知必会
本文会介绍关于英酷词典的如下三方面内容:怎么获得极致体验?制作单词表并导入Anki词典管理怎么获得极致体验?虽然[英酷词典](https://www.cnblogs.com/iMath/p/EngkuDict.html)释义小窗口出现的速度目前还不够快,但是已经做到了在浏览器(包括360浏览器、谷歌浏览器等)和SumatraPDF阅读器里的极致体验——在这些软件里小窗口可以**秒现**,和你在视频演示里看到的一样快!为了获得这样的体验,你需要下载并安装这两款软件:英酷词典浏览器插件。下载方原创 2022-03-07 15:39:46 · 174 阅读 · 0 评论 -
python lockfile read write
https://docs.python.org/3/library/fcntl.html#fcntl.lockfhttps://stackoverflow.com/questions/32592698/how-to-lock-a-directory-between-python-processes-in-linuxhttps://www.google.com/search?q=Python+with+lock+file&newwindow=1&sxsrf=AOaemvJCtZ_ke5IN原创 2022-01-05 16:47:04 · 327 阅读 · 0 评论 -
Linux版超链接
<span style="text-align: right;"><a href="https://www.cnblogs.com/iMath/p/8461599.html" target="_blank" rel="noopener">Linux版</a></span>原创 2021-12-24 21:32:42 · 1054 阅读 · 0 评论 -
getElementByXpath setInterval常用法
function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;}// getElementByXpath('//*[text()="标准分类"]')var intervalID = setInterval(() => { var element = getElemen..原创 2021-12-16 18:49:20 · 823 阅读 · 0 评论 -
selenium Enabled
3. NavigatingThe first thing you’ll want to do with WebDriver is navigate to a link. The normal way to do this is by callinggetmethod:driver.get("http://www.google.com")WebDriver will wait until the page has fully loaded (that is, theonloadeven...转载 2021-11-03 20:47:20 · 2814 阅读 · 0 评论 -
js QQ音乐歌词显示在浏览器标题
// ==UserScript==// @name New script - qq.com// @namespace Violentmonkey Scripts// @match https://y.qq.com/n/ryqq/player// @grant none// @version 1.0// @author -// @description 2021/10/21 下午3:19:39// ==/UserScript==(...原创 2021-10-22 14:34:04 · 325 阅读 · 0 评论 -
备份 我文章里的分配律证明
(a+b)⋅c=limn→∞((an+bn)⋅cn)=limn→∞(ancn+bncn)(a+b) \cdot c=\lim _{n \rightarrow \infty}\left(\left(a_{n}+b_{n}\right) \cdot c_{n}\right)=\lim _{n \rightarrow \infty}\left(a_{n} c_{n}+b_{n} c_{n}\right)(a+b)⋅c=limn→∞((an+bn)⋅cn)=limn→∞(ancn+bncn)原创 2021-08-21 21:43:17 · 161 阅读 · 0 评论 -
nginx uwsgi部署Django必备命令
后期更改只要这些操作sudo su -cd /home/ubuntu/LYYDownloaderServer/&&source LYYDownloaderServerEnv/bin/activate&&pkill -f uwsgi -9&&uwsgi --ini uwsgi.inisudo chmod 777 .sudo chmod 777 /home/ubuntu/LYYDownloaderServer/files/LYYDownloaderS原创 2021-08-18 23:02:50 · 227 阅读 · 0 评论 -
macrotrends金融数据抓取
def createLIBOR_Rate_CSV(): for LIBOR_Rate_Date_Period, DataId in LIBOR_Rate_Date_Period2DataId.items(): webpageSourceCode = getWebResponseText(f'https://www.macrotrends.net/assets/php/chart_iframe_comp.php?id={DataId}&url=1-month-libor-r..原创 2021-07-17 21:55:09 · 727 阅读 · 2 评论 -
等待图片全部加载然后打印PDF,未成功
已知limn→∞f(x1)+⋯+f(xn)n=L\lim _{n \rightarrow ∞} \frac{f\left(x_{1}\right)+\cdots+f\left(x_{n}\right)}{n}=Ln→∞limnf(x1)+⋯+f(xn)=L其中f(xi)>0(i=0,1,2,...,n)f\left(x_{i}\right)>0 (i=0,1,2,...,n)f(xi)>0(i=0,1,2,...,n),求limn→∞f(x0)+f(x1)+⋯+f(x原创 2021-05-16 19:32:00 · 321 阅读 · 0 评论 -
Enabled
改为其他的值就代表不可用原创 2021-04-30 18:18:14 · 1009 阅读 · 1 评论 -
Python ctypes获取按键名字
改自https://stackoverflow.com/a/53734696/1485853那里的好像不能正常工作import atexit,ctypesimport threading,win32confrom ctypes import *from ctypes import wintypesfrom ctypes import c_short, c_char, c_uint8, c_int32, c_int, c_uint, c_uint32, c_long, Structure, WI原创 2021-04-13 09:56:41 · 509 阅读 · 0 评论 -
无法启动此程序,因为计算机中丢失 api-ms-win-crt-runtime-l1-1-0.dll
摘要我这边碰到的错误是在安装 MySQL Workbench 时出现的,这个文件是 Visual C++ Redistributable 下的一个文件。我按照其官网上标注的安装前提,安装了 Visual C++ 2015 Redistributable for Visual Studio 2015,重新安装 Workbench 仍然报该错误。问题描述解析其主要原因是在安装 Visual C++ 2015 Redistributable for Visual Studio 2015 时,系统中转载 2021-04-05 00:35:23 · 5190 阅读 · 0 评论 -
Lector阅读器折腾笔记
先安装http://djvu.sourceforge.net/然后pip install --upgrade lxml beautifulsoup4 xmltodict pymupdf python-djvulibre把第一步的软件文件C:\Program Files\DjVuLibre 全部copy到这里面C:\Users\Oscar\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\djvu启动C:\Users\Osca原创 2021-03-21 00:58:18 · 329 阅读 · 0 评论 -
js简单鼠标手势
var mousePressedEventList = [];function myFunction(e) { if (e.buttons == 1 || e.buttons == 2) { //按住左键 mousePressedEventList.push(e); } else if (e.buttons == 0) { //释放的时候 if (mousePressedEventList.length > 3) { firstPointY = .原创 2021-03-19 17:19:34 · 929 阅读 · 0 评论 -
实数的基本算术规则
对于任意给定的实数x,y,zx, y, zx,y,z,x≤xx \leq xx≤x.若 x≤yx \leq yx≤y 且 y≤x,y \leq x,y≤x, 则 x=yx=yx=y.若 x≤yx \leq yx≤y 且 y≤z,y \leq z,y≤z, 则 x≤zx \leq zx≤z不是x≤yx \leq yx≤y 就是 y≤xy \leq xy≤x.若 x≤y,x \leq y,x≤y, 则 x+z≤y+zx+z \leq y+zx+z≤y+z.若 x≤yx \leq yx≤y 且 0≤原创 2021-03-05 21:35:19 · 152 阅读 · 0 评论 -
数的连续体 Markdown备份
你也许会想这么证明:假设有一个数能产生这个分割,那么这个数本身可以归为A1A_1A1这部分的最大数或A2A_2A2这部分的最小数。假设aaa是A1A_1A1内最大的有理数,那么aaa必然是正有理数,只要选定足够大的正整数nnn就可以让a+1na+\dfrac {1} {n}a+n1变得比aaa稍大一点点,那么我们很自然就会想:是不是存在正整数nnn使得(a+1n)2<2\left(a +\dfrac {1} {n}\right) ^{2} < 2(a+n1)2<2呢?若存在,那么原创 2021-01-27 17:21:17 · 129 阅读 · 0 评论 -
京东抢购代码
if (window.location.href.indexOf("https://item.jd.com/100012043978.html") != -1) { //去结算 页面 var intervalID3 = window.setInterval(function() { //点击退款理由取消订单 var btn=document.querySelector("#btn-reservation"); if ((btn.innerTe...原创 2021-01-27 10:19:33 · 2146 阅读 · 0 评论 -
KeyLogger hook
# https://stackoverflow.com/questions/53732628/python-using-winapi-setwindowshookexa-on-windows-10import win32conimport ctypesfrom ctypes import *from ctypes.wintypes import DWORDuser32 = windll.user32kernel32 = windll.kernel32class KBDLLHOOKSTRU原创 2020-12-21 14:02:40 · 138 阅读 · 0 评论 -
英语技能长处介绍
Expertise in programming and desktop software since 2004.Web application development with Python/Django/ | PHP/Laravel | GolangFrameworks : Django, Flask, Fsecond prize of a national singingWorking for the UX design of our website and its develop.原创 2020-12-03 20:14:18 · 225 阅读 · 0 评论 -
FinancialChartsWebsite常用命令
pip install django-apschedulercd /home/ubuntu/FinancialChartsWebsitesource /home/ubuntu/FinancialChartsWebsite/FinancialChartsWebsiteEnv/bin/activatesupervisorctl update all原创 2020-09-24 23:01:22 · 149 阅读 · 0 评论 -
反三角函数的积分公式
∫11−u2dudxdx=sin−1u+C\int \frac{1}{\sqrt{1-u^{2}}} \frac{d u}{d x} d x=\sin ^{-1} u+C∫1−u21dxdudx=sin−1u+C∫−11−u2dudxdx=cos−1u+C\int-\frac{1}{\sqrt{1-u^{2}}} \frac{d u}{d x} d x=\cos ^{-1} u+C∫−1−u21dxdudx=cos−1u+C∫11+u2dudxdx=tan−1u+C\int \frac原创 2020-08-30 16:35:48 · 7770 阅读 · 1 评论 -
the trapezoidal rule for approximating Definite Integrals
Approximate ∫012dx1+x2\int_{0}^\frac{1}{2} \frac{d x}{1+x^{2}}∫0211+x2dx by using five subintervals. \quad Ans. 0.463表达式产出:leftPoint = 0rightPoint = 1 / 2subIntervalNum = 5subIntervalLen = '{}/{}'.format(rightPoint - leftPoint, subIntervalNum)exp原创 2020-08-20 12:36:33 · 186 阅读 · 0 评论 -
MathJax 2配置代码
原创 2020-06-30 21:24:12 · 346 阅读 · 0 评论 -
Python下载网页
颜色下载 财政部会计准则委员会 的网页import requestsfrom bs4 import BeautifulSouprequestsSession = requests.Session() # if you’re making several requests to the same host, the underlying TCP connection will be reused, which can result in a significant performance .原创 2020-06-04 10:11:21 · 211 阅读 · 0 评论 -
黎曼积分动图、示意图备份
来自:https://giphy.com/gifs/math-MY1RMBRjfwvxS来自:https://jmahaffy.sdsu.edu/courses/f00/math122/lectures/riemann_sums/riemanns.html转载 2020-05-25 20:25:33 · 628 阅读 · 0 评论 -
乐影音下载器 建议回复
1.强烈希望能支持断点续传,网络错误或用户主动的暂停,再开始需要从头下载(哪怕只隔了几秒),对较大的你视频十分不利。一开始我的软件是支持断点续传的,但是有些网站的视频不支持断点续传,2.软件功能过于简单,虽然照顾了电脑新手,但确实功能单一,不利于使用。如只支持通过剪贴板中的链接下载视频,能选择和操作的空间很有限。3.希望能定向下载指定视频,而不是只能通过剪贴板链接选择视频。如非视频网站的...原创 2020-02-29 21:36:49 · 448 阅读 · 0 评论 -
什么都不能做的代码记录
from ctypes import *from win32gui import *from win32process import *from win32api import *from win32con import *import win32clipboarddef paste(): win32clipboard.OpenClipboard() data =原创 2015-11-07 10:49:24 · 627 阅读 · 0 评论 -
代码碎片记录
print('--------talkShowCNParse')self.talkShowCNParse(QUrl(sourceUrl).adjusted(QUrl.RemoveQuery).toString()) @pyqtSlot() def talkShowCNParse(self, url): if url not in self.sou原创 2016-12-29 12:10:11 · 434 阅读 · 0 评论 -
json里读取电视源
import jsono = json.loads(open(r'C:\Users\i\Documents\Tencent Files\2281570025\FileRecv\1485152268490.json').read())for i in o["ChannelList"]: print('{},{}'.format(i["Name"], i["Media"][0原创 2017-01-24 18:34:07 · 6818 阅读 · 0 评论 -
url match
videoUrlMatch = re.search(r"Real URLs:\s*(?P.*){}".format(os.linesep), parseResult, re.DOTALL | re.IGNORECASE).group('videoUrls').split() # 搜寻链接,因为有了download-url:,所以必须从Real URLs:后面搜寻 # pr原创 2017-04-06 22:01:14 · 1285 阅读 · 0 评论 -
UnboundLocalError: local variable 'pi' referenced
In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a value anywhere within the function’s body(即便没用到), it’s assumed to be a local unless e原创 2017-04-09 14:00:46 · 485 阅读 · 0 评论 -
quick Django
创建project named mysite django-admin startproject mysite命令行进入项目目录运行服务器python manage.py runserver创建APP named polls python manage.py startapp pollsLet’s write the first view. Open the file po...原创 2018-09-08 17:40:44 · 139 阅读 · 0 评论 -
Python class variable、class method
A class variable is a variable associated with a class, not an instance of a class, and is accessible by all instances of the class. A class variable might be used to keep track of some classlevel in...转载 2018-09-08 19:14:13 · 942 阅读 · 0 评论 -
日活统计,代码暂存 activeUserCountPerDay.activeUserCount
if isCreated: activeUserCountPerDay, isCreated = ActiveUserCountPerDay.objects.get_or_create(activeDate = date.today()) activeUsers=ActiveUser.objects.all()#算是昨天的用户集合 if is...原创 2018-09-10 22:54:12 · 265 阅读 · 0 评论 -
https://mathjoy.eu.org
开头只要没有http就不会获取末尾不带 /原创 2018-10-06 10:18:18 · 3338403 阅读 · 0 评论 -
cbDumper.py转换为py3后的出错情况
运行2to3转换成py3的代码D:\py I:\Users\i\AppData\Local\Programs\Python\Python36-32\Tools\scripts\2to3.py -w C:\Users\i\Downloads\cbDumper\cbDumper.py转换后修改了第15行的代码后的cbDumper.py的内容如下#This Python file use...转载 2018-10-10 13:40:17 · 255 阅读 · 0 评论 -
The PyQt5 code porting of Model/View Programming e
the use of the Rows and Columns flagsimport sysfrom PyQt5.QtWidgets import *from PyQt5.QtCore import *from PyQt5.QtGui import *class MyModel(QAbstractTableModel): def __init__(self, pare...原创 2018-12-01 10:32:49 · 194 阅读 · 1 评论