温馨提示:文本可能已经过时
URL | https://www.thisisxd.tk/files/cave.ini |
请求方式 | GET |
返回格式 | TEXT/INI |
同步时间 | 每15分钟 |
温馨提示:文本可能已经过时
URL | https://www.thisisxd.tk/files/cave.ini |
请求方式 | GET |
返回格式 | TEXT/INI |
同步时间 | 每15分钟 |
温馨提示:文本可能已经过时
cave echo.py
import urllib.request
import configparser
import os
#r = requests.get('https://www.12306.cn', )
if __name__ == "__main__":
print("TICRAFT CAVE SEARCH V1.0")
print("By This is XiaoDeng")
print("正在加载配置文件,请稍后\n")
try:
reqs = request=urllib.request.Request("http://www.thisisxd.tk/files/cave.ini",headers={"User-Agent" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 QIHU 360SE"})
req = urllib.request.urlopen(reqs)
text = req.read().decode("utf-8")
with open("config.ini","w",encoding = "utf-8") as f:
f.write(text)
except Exception as e:
print(e)
proDir = os.path.split(os.path.realpath(__file__))[0]
configPath = os.path.join(proDir, "config.ini")
conf = configparser.RawConfigParser(allow_no_value=True)
conf.read(configPath,encoding = "utf-8")
#print(open("config.ini",encoding="gbk").read())
while True:
text = input("请输入搜索内容:")
l = int(conf.get("配置","回声洞数量"))
print(f"正在从{l}条回声洞投稿中查找{text}:")
out = ""
for i in range(l-1):
if (text in conf.get(str(i+1),"内容")):
out += "["+ str(i+1) +"] "+conf.get(str(i+1),"内容")+" ——"+conf.get(str(i+1),"投稿人")
out += "\n\n"
out = out.replace("§","\n")
print(out,end = "\n\n")
By 这里是小邓
XPyLogger 是提供了一个开箱即用的日志库,较好的解决了Python 自带 logging 库使用繁琐,函数玄学的问题,支持 rich 库彩色输出。
项目原名 XLogger,后因重名,故改名为 XPyLogger
rich
:pip install rich
from XPyLogger import *
pip install XPyLogger
输出一条日志
关闭日志本地记录文件
日志等级-信息
日至等级-警告
日志等级-错误
自定义初始化log对象
import XPyLogger as log
log.init(file_enable = False)
log.log("This is a information!",log.INFO)
log.log("This is a warning!",log.WARN)
log.log("This is a error!",log.ERR)
log.close()
TBOX是由这里是小邓编写有高度DIV性工具箱,您可以在这做一个自己的工具箱插件
1、安装Python3
2、安装RICH、PYGAME
pip install rich pygame
3、下载,解压源代码
4、运行
python3 ./launch.py
如果您在使用过程中遇到了bug,那么请发送log、截图和bug说明到1744793737@qq.com.
此项目已一定程度上停止功能更新,再更新基本上是修bug了;document已经在写了,稍安勿躁,有不懂的的直接email作者;更多信息详见程序内关于
PyFinder是由 这里是小邓 编写的一个 Python 本地文件查找解决方案。此库支持传统递归查找和多线程查找,是Python文件查找较好的解决方案之一。
https://gitee.com/This-is-XiaoDeng/py-finder
PS:有条件的建议直接去仓库看,毕竟下文是我从README.md照搬的
主要文件结构:
py-finder
|-README.md 自述文件
|- pyfinder.py 主库文件
git clone https://gitee.com/This-is-XiaoDeng/py-finder.git
pyfinder.py
复制到(您要使用这个库的程序)的目录下import pyfinder
or
from pyfinder import *
我之后会上传几个Demo,到时候问题就不大了
函数 | 参数列表 | 支持最大文件夹深度 | 说明 | 返回值 |
---|---|---|---|---|
find() | name = 文件名关键字 start=起始目录 wait=防死机等级(默认0.1) | 无限 | 传统单线程递归查找法(不受递归次数约束) | 符合筛选条件的文件路径列表(list) |
find_threads() | name = 文件名关键字 start=起始目录 wait=防死机等级(默认0.01) | 约800层 | 多线程查找法(受threading 最大线程影响) | 符合筛选条件的文件路径列表(list) |
import pyfinder f = pyfinder.find_threads(name="exe",start="C:\\") print(f)
千万表像上面那么做,相信我,查找的时候永远也不要让符合筛选的文件过多,会内存溢出的(我就这么做过)
此程序采用 MIT 许可证
代码
这里是小邓
调试
这里是小邓 熊熊糖果
警告:本文可能已经过时
「Is todat Friday?」是一个用来看今天是不是周五以及还有多少天到周五的程序。
1、安装Python3
Manjaro / Arch
$ sudo pacman -S python3
Deepin / Debian
$ sudo apt install python3
2、安装PIP(详见:https://www.thisisxd.tk/?p=81)
3、安装依赖库
$ python3 -m pip install pyside6
4、运行文件
$ python3 ./Friday.py
pip install pyside6
5. 双击运行(Friday.py)
from PySide6.QtWidgets import *
from ui_Friday import *
import sys
import time
print(time.strftime("%a",time.localtime()))
t = time.strftime("%a",time.localtime())
if t != "Fri":
Fri = False
else:
Fri = True
if t == "Mon":
d = 4
elif "Tue" in t:
d = 3
elif t == "Wed":
d = 2
elif "Thu" in t:
d = 1
else:
d = 0
class Friday(Ui_MainWindow,QMainWindow):
def __init__(self) -> None:
super().__init__()
self.setupUi(self)
self.lcdNumber.display(d)
self.IsFri.setText("<center><h1>"+str(Fri)+"</h1></center>")
if Fri:
self.groupBox_2.setEnabled(False)
self.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
window = Friday()
sys.exit(app.exec())
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Friday.ui'
##
## Created by: Qt User Interface Compiler version 6.2.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QGroupBox, QHBoxLayout,
QLCDNumber, QLabel, QMainWindow, QSizePolicy,
QVBoxLayout, QWidget)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(324, 169)
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.gridLayout = QGridLayout(self.centralwidget)
self.gridLayout.setObjectName(u"gridLayout")
self.groupBox = QGroupBox(self.centralwidget)
self.groupBox.setObjectName(u"groupBox")
self.groupBox.setAlignment(Qt.AlignCenter)
self.verticalLayout_2 = QVBoxLayout(self.groupBox)
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.IsFri = QLabel(self.groupBox)
self.IsFri.setObjectName(u"IsFri")
self.verticalLayout_2.addWidget(self.IsFri)
self.gridLayout.addWidget(self.groupBox, 1, 0, 1, 1)
self.groupBox_2 = QGroupBox(self.centralwidget)
self.groupBox_2.setObjectName(u"groupBox_2")
self.horizontalLayout = QHBoxLayout(self.groupBox_2)
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.lcdNumber = QLCDNumber(self.groupBox_2)
self.lcdNumber.setObjectName(u"lcdNumber")
self.lcdNumber.setDigitCount(1)
self.horizontalLayout.addWidget(self.lcdNumber)
self.label_2 = QLabel(self.groupBox_2)
self.label_2.setObjectName(u"label_2")
self.horizontalLayout.addWidget(self.label_2)
self.gridLayout.addWidget(self.groupBox_2, 1, 1, 1, 1)
self.label_3 = QLabel(self.centralwidget)
self.label_3.setObjectName(u"label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.label = QLabel(self.centralwidget)
self.label.setObjectName(u"label")
self.label.setMaximumSize(QSize(16777215, 30))
self.gridLayout.addWidget(self.label, 2, 1, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QMetaObject.connectSlotsByName(MainWindow)
# setupUi
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u4eca\u5929\u662f\u5468\u4e94\u5417\uff1f\uff08By XD\uff09", None))
self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"\u4eca\u5929\u662f\u5468\u4e94\u5417\uff1f", None))
self.IsFri.setText("")
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"\u8ddd\u79bb\u5468\u4e94\u8fd8\u6709", None))
self.label_2.setText(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><span style=\" font-size:22pt;\">\u5929</span></p></body></html>", None))
self.label_3.setText(QCoreApplication.translate("MainWindow", u"By thisisx.tk & itcraft.tk", None))
self.label.setText(QCoreApplication.translate("MainWindow", u"Version: 1.0", None))
# retranslateUi
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>169</height>
</rect>
</property>
<property name="windowTitle">
<string>今天是周五吗?(By XD)</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>今天是周五吗?</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="IsFri">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>距离周五还有</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLCDNumber" name="lcdNumber">
<property name="digitCount">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string><html><head/><body><p><span style=" font-size:22pt;">天</span></p></body></html></string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>By thisisx.tk & itcraft.tk</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Version: 1.0</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
KeyCode 是一个轻便的键盘按键码查询工具,TA拥有瘦小的体积,强大(是不是有点过了)的功能,值得您的尝试。
启动后使用键盘操作,按下一个按键则会显示该按键的KEYCODE和其他一些信息
1、安装Python3(Windows请自行下载安装包安装)
# Debian
sudo apt install python3
# Arch/Manjaro
sudo pacman -S python3
# CentOS
sudo yum install python3
2、安装PyGame
python3 -m pip install pygame
3、运行程序(请不要隔空运行)
python3 ./main.py
./main.py
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((400,340))
pygame.display.set_caption("KeyBoard - KeyCode (By: This is XiaoDeng)")
bg = (200,255,255)
font = None
keycode_show = pygame.font.Font(font,200)
msg = pygame.font.Font(font,45)
key_name_show = pygame.font.Font(font,90)
p = pygame.font.Font(font,40)
uc = pygame.font.Font(font,35)
keycode = {
97: 'A', 98: 'B', 99: 'C', 100: 'D', 101: 'E', 102: 'F', 103: 'G', 104: 'H', 105: 'I', 106: 'J', 107: 'K', 108: 'L', 109: 'M', 110: 'N', 111: 'O', 112: 'P', 113: 'Q', 114: 'R', 115: 'S', 116: 'T', 117: 'U', 118: 'V', 119: 'W', 120: 'X', 121: 'Y', 122: 'Z',
1073741882: 'F1', 1073741883: 'F2', 1073741884: 'F3', 1073741885: 'F4', 1073741886: 'F5', 1073741887: 'F6', 1073741888: 'F7', 1073741889: 'F8', 1073741890: 'F9', 1073741891: 'F10', 1073741892: 'F11', 1073741893: 'F12',
27:'ESC',1073741894:'PrintScreen',1073741895:"SrollLock",1073741896:"Pause & Break",
1073741897:"Inserent",127:"Delete",107374189:"Home",1073741901:"End",1073741899:"Page Up",1073741902:"Page Down",
1073741906:"Side::Up",1073741905:"Side::Down",1073741904:"Side::Left",1073741903:"Side::Right",
1073741913: 'Number::1', 1073741914: 'Number::2', 1073741915: 'Number::3', 1073741916: 'Number::4', 1073741917: 'Number::5', 1073741918: 'Number::6', 1073741919: 'Number::7', 1073741920: 'Number::8', 1073741921: 'Number::9',
32:"Space"
}
key = "NAN"
key_name= "NULL"
k_x = 79
plus = False
unic = "NULL"
# 107374
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.KEYUP:
print(event)
key = event.key
if key > 1000:
plus = True
key = int(str(key)[7:])
else:
plus = False
if 10 < key < 100:
key = "0" + str(key)
elif key < 10:
key = "00" + str(key)
else:
key = str(key)
try:
key_name = keycode[event.key]
except:
key_name = "NULL"
try:
unic = f"Text:{event.unicode} ASCII:{ord(event.unicode)}"
except:unic = f"Text:{event.unicode} ASCII:ERROR -1"
screen.blit(keycode_show.render(key,True,(0,0,0),bg),(k_x,20))
if plus:
screen.blit(p.render("1073741",0,(0,0,0)),(5,5))
screen.blit(msg.render("KEY NAME",True,(0,0,0),bg),(15,170))
screen.blit(key_name_show.render(key_name,True,(0,0,0),bg),(30,210))
screen.blit(msg.render("INFORMATION",True,(0,0,0),bg),(15,270))
screen.blit(uc.render(unic,True,(0,0,0),bg),(30,305))
pygame.display.update()
screen.fill(bg)
此程序还处于公测状态,可能会有多种不稳定因素,如发现bug请在评论区反馈或直接联系作者,感谢支持!
字体问题,将源代码 09 行 None
改为自己喜欢的字体的TTF路径即可(如字体文件在 /home/xxx/demo.ttf
则将源代码第九行改为 font = "/home/xxx/demo.ttf"
即可)
时间比较紧,KEYNAME字典没写完,所以……
你按下的这个键没有对应的ASCII码