YOUR-LIFE


温馨提示:本文可能已经过时

简介

您的生命还有多少天?

文件

YOUR-LIFE.zip
     | - YOU-LIFE.py # 主程序
     | - ui_life.py 

依赖

  1. Python 3
  2. PySide 6

源代码

/YOU-LIFE.py

from PySide6.QtWidgets import *
from ui_life import *
import sys
import time

class Life(QMainWindow,Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.pushButton.clicked.connect(self.start)
        self.show()
    def start(self):
        _b = (self.lineEdit.text(),self.lineEdit_2.text(),self.lineEdit_3.text())
        print(_b)
        b_str = f"{_b[0]}-{_b[1]}-{_b[2]} 0:0:0"
        if self.comboBox.currentText() == "男":
            o_str = f"{int(_b[0])+70}-{_b[1]}-{_b[2]} 0:0:0"
            y = 70
        else: 
            o_str = f"{int(_b[0])+73}-{_b[1]}-{_b[2]} 0:0:0"
            y=73
        birthday = time.mktime(time.strptime(b_str, '%Y-%m-%d %H:%M:%S'))
        over = time.mktime(time.strptime(o_str, '%Y-%m-%d %H:%M:%S'))
        print(birthday,over)

        self.progressBar.setValue(int((time.time() - birthday) / y * 100))
        self.progressBar_2.setValue(100 - int((time.time() - birthday) / y * 100))
        
        b = time.time() - birthday - 28800
        b1 = time.localtime(b)
        self.lcdNumber.display(b1[0]-1970)
        self.lcdNumber_2.display(b1[1])
        self.lcdNumber_3.display(b1[2])

        t = time.time()
        b = over - t - 28800
        b2 = time.localtime(b)
        self.lcdNumber_4.display(b2[0] - 1969)
        self.lcdNumber_5.display(b2[1])
        self.lcdNumber_6.display(b2[2])

        self.lcdNumber_7.display((b2[0]-1969)*12+b2[1])
        self.label_15.setText("天。")
        self.lcdNumber_8.display((b2[0]-1969)*12*4+b2[1]*4)
        self.lcdNumber_9.display((b2[0]-1969)*365+b2[1]*30+b2[2])

        

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = Life()
    sys.exit(app.exec())

MC服务器已经迁移到简幻欢平台


为了给您带来更好的游戏体验,MC服务器已经迁移到简幻欢平台。迁移后您可以享受24h+无服务器卡顿的游戏体验。

进入方法

一、(更快)

  1. 进入IP为 10087.s.imc.re 的服务器
  2. 按提示登录/注册
  3. 畅玩

二、(更稳)

  1. 进入IP为 play.imc.re 的服务器
  2. 按提示注册/登录
  3. 右键单击出生点右前方向村民(头上有红色的「分享服务器列表」)
  4. 选择名为「SH10087」的命名牌
  5. 畅玩

元旦快乐


祝各位读到这篇小记的人,元旦快乐!在新的一年里万事如意,身体健康,学业有成!祝祖国繁荣昌盛,祝新冠疫情早日过去!

「Is today Friday?」 V 1.0


警告:本文可能已经过时

介绍

「Is todat Friday?」是一个用来看今天是不是周五以及还有多少天到周五的程序。

构建与使用

依赖列表

  1. Python3
  2. PySide6

构建步骤

Linux

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

Windows

  1. 安装Python3
  2. 安装PIP(详见:https://www.thisisxd.tk/?p=81
  3. 处理PATH(详见百度)
  4. 安装依赖库
pip install pyside6

5. 双击运行(Friday.py)

源代码

./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())

./ui_Friday.py

# -*- 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

./Friday.ui

<?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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:22pt;&quot;&gt;天&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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 &amp; 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>

源码(附件):

Python3 PIP 安装


pip is the package installer for Python. You can use it to install packages from the Python Package Index and other indexes.

——pip.pypa.io

鲁迅先生曾经说过这样一句话:“没有pip的Python是没有灵魂的(是不是有点过了)。”

但是,很多人在使用pip的时候,或多或少会遇到这种情况:

[xiaodeng@xd-pc ~]$ python3 -m pip
/usr/bin/python3: No module named pip

如果你遇到了这个提示,那么恭喜你,你 的 Python 没 装 pip!

其实,这种情况很好解决,但是我曾经也被整的晕头转向,话不多说,上解决方案!

解决方案

通用

  1. 下载https://bootstrap.pypa.io/get-pip.py;
  2. 执行

Linux

可以吧这一段代码复制到终端执行:

wget https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py
rm ./get-pip.py

输出(因人而异):

[xiaodeng@xd-pc ~]$ wget https://bootstrap.pypa.io/get-pip.py
--2021-12-11 15:07:06--  https://bootstrap.pypa.io/get-pip.py
SSL_INIT
已载入 CA 证书“/etc/ssl/certs/ca-certificates.crt”
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.76.175, 2a04:4e42:12::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.76.175|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2159352 (2.1M) [text/x-python]
正在保存至: “get-pip.py”

get-pip.py          100%[===================>]   2.06M  3.34MB/s  用时 0.6s    

2021-12-11 15:07:07 (3.34 MB/s) - 已保存 “get-pip.py” [2159352/2159352])

[xiaodeng@xd-pc ~]$ python3 ./get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 1.7 MB/s            
Collecting wheel
  Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
Successfully installed pip-21.3.1 wheel-0.37.0
[xiaodeng@xd-pc ~]$ rm ./get-pip.py
[xiaodeng@xd-pc ~]$ 

验证安装

[xiaodeng@xd-pc ~]$ python3 -m pip

Usage:   
  /usr/bin/python3 -m pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  cache                       Inspect and manage pip's wheel cache.
  index                       Inspect information available from package indexes.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  debug                       Show information useful for debugging.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --debug                     Let unhandled exceptions propagate outside the
                              main subroutine, instead of logging them to
                              stderr.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host or host:port pair as trusted,
                              even though it does not have valid or any HTTPS.
  --cert <path>               Path to PEM-encoded CA certificate bundle. If
                              provided, overrides the default. See 'SSL
                              Certificate Verification' in pip documentation
                              for more information.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output.
  --no-python-version-warning
                              Silence deprecation warnings for upcoming
                              unsupported Pythons.
  --use-feature <feature>     Enable new functionality, that may be backward
                              incompatible.
  --use-deprecated <feature>  Enable deprecated functionality, that will be
                              removed in the future.
[xiaodeng@xd-pc ~]$ 

KeyCode Beta 1


  • 程序名称:KeyCode
  • 版本:Beta 1
  • 作者:This is XD

简介

KeyCode 是一个轻便的键盘按键码查询工具,TA拥有瘦小的体积,强大(是不是有点过了)的功能,值得您的尝试。

使用方法

启动后使用键盘操作,按下一个按键则会显示该按键的KEYCODE和其他一些信息

使用截图

依赖

  1. Python3
  2. PyGame (>= 2.0)

构建步骤

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请在评论区反馈或直接联系作者,感谢支持!

INFORMATION 栏 Text 项目显示方框怎么解决?

字体问题,将源代码 09 行 None 改为自己喜欢的字体的TTF路径即可(如字体文件在 /home/xxx/demo.ttf 则将源代码第九行改为 font = "/home/xxx/demo.ttf" 即可)

KEY NAME 栏为什么会显示NULL?

时间比较紧,KEYNAME字典没写完,所以……

INFORMATION 栏 ASCII 项目为什么会 ERROR -1?

你按下的这个键没有对应的ASCII码

【接单日志 01】txtx解析工具


温馨提示:程序接单目前已经不再开放,但您仍然可以在issue中为新项目提供想法

详细信息

  • 单号:PYLIB-ORD-20211101
  • 委托人(QQ):3627035438
  • 项目:TXTX解析工具
  • 类型:Python库-ORD
  • 收费:1.0/1.0 CNY(付款方式:QQ)

代码:

./txtx.py

# Powered By XD(www.thisisxd.tk)
import os

def delzhushi(l,start = 0):
    s = l[start].find("#")
    li = l
    if s != -1:
        li[start] = li[start][0:s]
    if start == l.__len__()-1:
        return li
    else:
        return delzhushi(li,start+1)

def run(txt):
    t = txt
    le = 0
    for tx in t:
        where_w = tx.find("[Run_Windows]")
        where_u = tx.find("[Run_Unix](")
        if os.name == "nt":
            if where_w != -1:
                t.pop(le)
                #print(tx[where_w+14:tx.find(")",where_w)])
                os.popen(tx[where_w+14:tx.find(")",where_w)])
        else:
            if where_u != -1:
                t.pep(le)
                os.popen(tx[where_u+14:tx.find(")",where_u)])
        le += 1
    return t

def get_home(txtx):
    tx = txtx
    l = 0
    for t in tx:
        w = t.find("<[")
        if w != -1:
            home = t[w+2:t.find("]",w)]
            for i in range(l):
                tx.pop(0)
            if  home == "":
                raise TypeError("跟声明不能为空")
            else:
                return tx,home

def load(t):
    txtx = {}
    # 逐行分割
    t1 = t.split("\n")
    # 删除注释
    t1 = delzhushi(t1)
    # 跑命令
    t1 = run(t1)
    # 获取跟声明
    temp = get_home(t1)
    t1 = temp[0]
    home = temp[1]
    # 解析
    f = 1
    s = 0
    tw = [False]
    tg = False
    txtx[home] = {}
    y = 0
    for t in t1:
        s += 1
        temp = {}
        k_start = t.find("[")
        if k_start != -1 and tg == False and t.find("<[") == -1:
            k_end = t.find("]",k_start)
            if k_end != -1:
                v_start = t.find("(",k_end)
                if v_start != -1:
                    v_end = t.find(")",v_start)
                    if v_end == -1:
                        raise KeyError(f"行0{s}:这个值没有结尾")
                else:
                     raise KeyError(f"行0{s}:一个没有意义的键")
            else:
                raise KeyError(f"行0{s}:这个键没有结尾")
            # 能执行到这里这行基本就是有效的了
            print(1,t.find("<["),tg,home)
            # 分析键
            key = t[k_start+1:k_end]
            value = t[v_start+1:v_end]
            # 储存
            txtx[home][key] = value
        else:
            tmp = t.find("<[")
            if tmp != -1 and t[tmp+2:t.find("]",tmp)] != home:
                tg = True
                tw[0] = True
                if y != 1:
                    tw  += [[s,t[tmp+2:t.find("]",tmp)]]]
                y += 1
            elif t.find(">") != -1:
                tg = False
                if y == 1:
                    try:
                        tw[tw.__len__()-1] += [s]
                    except:
                        pass
                    y -= 1
                else:
                    y -= 1
                print(t[tmp:t.find("]",tmp)],tw)
            print("y",y)
    if tw[0] == True:
        for tn in tw:
            print("tn",tn,t1)
            if tn != True:
                cs = ""
                for i in t1[tn[0]-1:tn[2]]:
                    cs += str(i)
                    cs += "\n"
                print("cs",cs)
                print("递归后输出:")
                # txtx[home][t[2]] = load(cs)
                tmp114514  =  load(cs)
                print(tmp114514)
                txtx[home][tmp114514[1]] = tmp114514[0][tn[1]]#[[tmp114514[1]]]   #[tmp114514[1]]
    else:
        print("ELSE")
                
        
    # 返回
    return [txtx,home]

def loads(txtx):
    return load(txtx)[0]

def open(path,encoding = "utf-8"):
    with open(path,encoding = encoding) as f:
        return loads(f.read())

用法

import txtx
函数参数函数描述返回说明
txtx.open(path,ecoding="utf-8")[path] txtx文件路径 (String)
[encoding] 文件编码(默认=utf-8)(string)
打开txtx文件返回解析结果(dictionary)
txtx.loads(txtx)[txtx] txtx内容 (String)解析txtx字符串返回解析结果(dictionary)
txtx解析器主要函数说明

世界,您好!


警告:本文可能已经过时

欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!