摘要:
vscode 配置 c/c++ [!CAUTION] 使用本文的配置需要预装cmake,msvc,拥有cmake、CMake Tools插件 工程目录 D:. │ CMakeLists.txt │ ├─.vscode │ CMakePresets.json │ c_cpp_properties.js 阅读全文
摘要:
def binary_to_decimal(binary_str): return int(binary_str, 2) def octal_to_decimal(octal_str): return int(octal_str, 8) def decimal_to_decimal(decimal_ 阅读全文
摘要:
python 使用 pyinstaller 打包 1、下载pyinstaller pip install pyinstaller 2、在当前目录下生成 .spec 文件 注意,这行命令在生成文件的时候,也打包了输出物 pyinstaller --name=pytasker main.py --one 阅读全文
摘要:
Windows 使用 tree 命令 基本语法 tree [drive:][path] [/F] [/A] 参数说明 [drive:][path]:指定要显示树结构的驱动器和目录。如果未指定路径,则使用当前目录。 /F:显示每个文件夹中的文件名。 /A:使用ASCII字符而不是扩展字符来显示链接子目 阅读全文
摘要:
读取文本十六进制,保存为图片 目录结构 D:\SFW\PY_TOOLS\PNGPY main.py mhex.txt output.png main.py def hex_to_png(hex_file, output_file): # 从文件中读取十六进制数据 with open(hex_file 阅读全文
摘要:
在 Python 中,json.dumps() 函数会将 Python 对象序列化为 JSON 字符串,并默认使用 UTF-8 编码来处理非 ASCII 字符。虽然在 Python 3 中,字符串是默认以 Unicode 形式存储的,但是当 json.dumps() 将 Python 字符串转换为 阅读全文
摘要:
 阅读全文
摘要:
配置GOPATH环境变量 project文件夹 在project文件夹新建3个文件夹 src 存放go语言源码 pkg 存放编译好的包对象文件 bin 存放链接好的可执行文件 新建项目 在src文件夹下新建项目\golearn\ch2\main.go 将源码编译成可执行文件 在project路径下打 阅读全文
摘要:
新建函数接口 Operation @FunctionalInterface public interface Operation<R, T> { R operator (T t1, T t2); } 在测试类中实现 public class TestDemo { @Test public void 阅读全文
摘要:
default关键字 定义一个Animal接口 其中breath用default修饰。 public interface Animal { void run(); void eat(); default void breath(){ System.out.println("呼吸"); } } 定义一 阅读全文