如果要保存为.png/.jpeg:
decode_heic_to_im('somefile.heic').save('somefile.png')
就可以了
或者用在线工具 http://heic2jpg.online/
windows 打不开 heic 图片可以试试这个 https://www.copytrans.net/copytransheic/
// ==UserScript== | |
// @name Download YouTube subtitles | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Now you can download YouTube subtitles | |
// @author André Kugland | |
// @match http*://*.youtube.com/* | |
// @grant none | |
// @require https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js#sha256=bbf27552b76b9379c260579fa68793320239be2535ba3083bb67d75e84898e18 | |
// ==/UserScript== |
如果要保存为.png/.jpeg:
decode_heic_to_im('somefile.heic').save('somefile.png')
就可以了
或者用在线工具 http://heic2jpg.online/
windows 打不开 heic 图片可以试试这个 https://www.copytrans.net/copytransheic/
下面是一个可以满足你需求的Python工具类代码示例。该工具类使用了json
库来处理JSON格式,可以加载严格的JSON和Python代码中的单引号格式的JSON。在处理最后一行的逗号问题上,它会自动处理,不会引发错误。
import json
class FlexibleJSONLoader:
@staticmethod
def load(file_path):
with open(file_path, 'r') as file:
content = file.read()
import os | |
class ConfigTool: | |
def __init__(self): | |
# Load configurations from environment variables into the global dictionary. | |
self._config_dict = {key: os.environ[key] for key in os.environ} | |
def get(self, key, default=None): | |
"""Retrieve value by key from the configuration dictionary.""" | |
return self._config_dict.get(key, default) |
// ==UserScript== | |
// @name One click to mute the twitter user - twitter.com | |
// @namespace Violentmonkey Scripts | |
// @match https://twitter.com/* | |
// @grant none | |
// @version 1.0 | |
// @author weijarz | |
// @description 6/28/2023, 12:46:22 PM | |
// ==/UserScript== |
import subprocess, os | |
class NotesExporter: | |
@staticmethod | |
def export_notes_to_md(output_directory): | |
applescript = """ | |
on clean_filename(filename) | |
set cleaned_filename to "" | |
repeat with c in filename | |
set targetUnicodeArray to {47, 92, 124, 63, 58, 42, 34, 60, 62} |
你可以使用 sed
和 awk
来从 pip list
的结果中提取包名和版本号,然后将其转换为 requirements.txt
格式。以下是一个示例命令:
pip list | grep -E 'keyword1|keyword2|keyword3' | awk '{print $1"=="$2}' > requirements.txt
这个命令将 pip list
结果中的包名和版本号提取出来,使用 ==
连接,然后将结果输出到 requirements.txt
文件中。你可以将 keyword1|keyword2|keyword3
替换为实际的关键词。
在执行这个命令之前,确保你已经在命令行中切换到你想要保存 requirements.txt
文件的目录。执行命令后,你会在当前目录下生成一个包含你筛选出的包名和版本号的 requirements.txt
文件。
// 便签元素在 frame 里,不能直接用 artoo 处理,得先得到内部的 dom 元素,然后传给 artoo。 | |
const iframe = 'iframe#js_note_mod_ctn.js_sandbox.business-mod-ctn.note-mod-ctn'; | |
let get_container = (str)=>{return $(iframe)[0].contentDocument.body.querySelector(str)}; | |
let notes_container = get_container('.home-bd .briefs-ctn.js_home_briefs_ctn'); | |
// 开始抓取 | |
let is_in_box = (this_)=>{ | |
return (this_.attr('class')=='js_folder_brief folder-brief js_normal_folder js_lock') || | |
(this_.attr('class')=='js_folder_brief folder-brief js_normal_folder') | |
}; |
#!/usr/bin/python | |
#-*- coding: utf-8 -*- | |
from __future__ import print_function, unicode_literals | |
import sys | |
import json | |
import os | |
import shutil | |
import re | |
import subprocess | |
import platform |