This file contains hidden or 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
| import json | |
| def xpath2Dict(xpaths, nested:bool=True, sep:str='/')->Dict: | |
| ''' | |
| xpaths: String | Iterable,前者按 splitlines 拆分为后者\n | |
| 可以包含或不包含枝节点,例如:\n | |
| topnode/node\n | |
| topnode/node/leaf\n | |
| 两条同时存在,或者仅有第二条,都能构建树状 dict。\n | |
| 分隔符在开头或结尾都会舍弃,相应的首节点、末节点按照处理后的 xpath 计算\n |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # -*-coding:utf-8 -*- | |
| ''' | |
| A picture slideshow viewer widget | |
| ''' | |
| import os | |
| import natsort |
This file contains hidden or 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
| def groupedSimilarFilenames(filenames): | |
| ''' | |
| 将相似文件名分组\n | |
| 输出类似格式\n | |
| filenames preffix suffix size \n | |
| 0 cover.jpg NaN NaN 0 \n | |
| 1 top.png NaN NaN 0 \n | |
| 2 9.jpg NaN .jpg 0 \n | |
| 3 015a.jpg 0 a.jpg 1 \n |
This file contains hidden or 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
| // ==UserScript== | |
| // @name URL Tagger | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.5 | |
| // @description Tag URLs based on predefined patterns and data | |
| // @author Your Name | |
| // @match *://*/* | |
| // @grant GM_xmlhttpRequest | |
| // @grant GM_addStyle | |
| // @connect 192.168.x.x |