Lan's blog
搜索文章
首页
技术文章
Python
Network
Linux
片刻
备忘录
我的旅行相册
海报墙
友链
NonAce 那航寻
wpblog
首页
技术文章
Python
Network
Linux
片刻
备忘录
我的旅行相册
海报墙
友链
NonAce 那航寻
wpblog
Lan
每天都要有点不一样的改变!
CSDN
Bilibili
Github
全部
Linux (16)
Docker (9)
Nginx (3)
Network (2)
HUAWEI (2)
Python (8)
默认分类 (1)
自动化 (1)
2025年12月17日 08:02 (1)
对txt文件的操作
1、逐行读取txt文件 def read_txt_file_by_line(filepath): with open(filepath, 'r', encoding='utf-8') as file: for line in file: print(l
作者:JunLan
发布时间:2024-11-25
分类:
Python
编码(unicode、gbk、utf-8)之间的转换
编码(unicode、gbk、utf-8)之间的转换 #utf-8(世界通用编码)编码的中文字符占用3个字节,gbk编码的中文字符占用2个字节 s="你好,中国!" print(s.encode('unicode-escape')) #unicode转义序列,默认是unicode编码,转换为un
作者:JunLan
发布时间:2024-11-25
分类:
Python
共 32 篇文章
1
2
3
4
页
# 开源软件
(1)
# clippings
(1)
# nginx
(5)
# Docker
(7)
# Linux
(7)
# HUAWEI
(1)
# 友情链接
(0)
# Halo
(0)
友情链接
柳橙睿
逸刻时光