网站首页 站内搜索

搜索结果

查询Tags标签: decode,共有 100条记录
  • Django框架 python3.7+django2.2 报错:AttributeError: ‘str’ object has no attribute ‘decode’解决办法

    转载于:https://blog.csdn.net/qq_41630218/article/details/89631835?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.highlightwordscore&depth_1-utm_source=distribute.pc_relevant.none-…

    2021/12/17 22:20:33 人评论 次浏览
  • Django框架 python3.7+django2.2 报错:AttributeError: ‘str’ object has no attribute ‘decode’解决办法

    转载于:https://blog.csdn.net/qq_41630218/article/details/89631835?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.highlightwordscore&depth_1-utm_source=distribute.pc_relevant.none-…

    2021/12/17 22:20:33 人评论 次浏览
  • python批量还原数据库

    # -*- coding: utf-8 -*- import shutil,os# 根据指定路径下的数据库备份文件生成还原脚本 def getFilesAndBuildSql(path,restorePath):for root,dirs,files in os.walk(path):for nfile in files:if os.path.splitext(nfile)[1] == ".bak": # 筛选bak文…

    2021/12/14 2:17:22 人评论 次浏览
  • python批量还原数据库

    # -*- coding: utf-8 -*- import shutil,os# 根据指定路径下的数据库备份文件生成还原脚本 def getFilesAndBuildSql(path,restorePath):for root,dirs,files in os.walk(path):for nfile in files:if os.path.splitext(nfile)[1] == ".bak": # 筛选bak文…

    2021/12/14 2:17:22 人评论 次浏览
  • sql语句decode和传参#{}

    sql语句: sql调用:

    2021/12/8 19:19:15 人评论 次浏览
  • sql语句decode和传参#{}

    sql语句: sql调用:

    2021/12/8 19:19:15 人评论 次浏览
  • python-bytes-str转换

    来源:python之bytes和string - skiler - 博客园 1、bytes主要是给计算机看的,string主要是给人看的 2、中间有个桥梁就是编码规则,现在大趋势是utf8 3、bytes对象是二进制,很容易转换成16进制,例如\x64 4、string就是我们看到的内容,例如abc 5、string经过编码encod…

    2021/12/5 9:16:54 人评论 次浏览
  • python-bytes-str转换

    来源:python之bytes和string - skiler - 博客园 1、bytes主要是给计算机看的,string主要是给人看的 2、中间有个桥梁就是编码规则,现在大趋势是utf8 3、bytes对象是二进制,很容易转换成16进制,例如\x64 4、string就是我们看到的内容,例如abc 5、string经过编码encod…

    2021/12/5 9:16:54 人评论 次浏览
  • Python报错 “UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte

    一、报错场景 使用python遇到报错:“UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence”一般有如下两种场景: 1.爬取中文网站内容html = requests.get(url).decode("gb2312")2.读取gbk编码的文件resu…

    2021/11/20 22:10:47 人评论 次浏览
  • Python报错 “UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte

    一、报错场景 使用python遇到报错:“UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence”一般有如下两种场景: 1.爬取中文网站内容html = requests.get(url).decode("gb2312")2.读取gbk编码的文件resu…

    2021/11/20 22:10:47 人评论 次浏览
  • python2中的unicode和str 与 python3中的str和bytes

    转载于 https://www.cnblogs.com/yangmingxianshen/p/7990102.html,感谢! python3有两种表示字符序列的类型:bytes和str。前者的实例包含原始的8位值;后者的实例包含Unicode字符。 python2中也有两种表示字符序列的类型,分别叫做str和unicode。与python3不同的是,st…

    2021/11/8 17:14:05 人评论 次浏览
  • python2中的unicode和str 与 python3中的str和bytes

    转载于 https://www.cnblogs.com/yangmingxianshen/p/7990102.html,感谢! python3有两种表示字符序列的类型:bytes和str。前者的实例包含原始的8位值;后者的实例包含Unicode字符。 python2中也有两种表示字符序列的类型,分别叫做str和unicode。与python3不同的是,st…

    2021/11/8 17:14:05 人评论 次浏览
  • 【python】python 读取pdf文件时,通过string.decode("utf-16")解析字符串时,因缺少字节导致程序崩溃的问题

    参考:https://blog.csdn.net/roymno2/article/details/71628128ou(感谢大佬) 【问题背景】最近有一个任务,需要使用python2.7去读取pdf文件内容。使用的模块是pypdf。当我获取到pdf其中的一页page时,调用page.mergeScaledTranslatedPage()这个函数处理时,报了下面的…

    2021/11/2 17:12:29 人评论 次浏览
  • 【python】python 读取pdf文件时,通过string.decode("utf-16")解析字符串时,因缺少字节导致程序崩溃的问题

    参考:https://blog.csdn.net/roymno2/article/details/71628128ou(感谢大佬) 【问题背景】最近有一个任务,需要使用python2.7去读取pdf文件内容。使用的模块是pypdf。当我获取到pdf其中的一页page时,调用page.mergeScaledTranslatedPage()这个函数处理时,报了下面的…

    2021/11/2 17:12:29 人评论 次浏览
  • Python_unicode转中文

    在接口测试中,有些响应类似 "\u9875\u9762\u4e0d\u5b58\u5728"在测试中不明白响应的什么,实际上这是unicode的中文编码。可用以下方法转换:# coding:utf-8# 直接在 unicode 字符串前加u ===> 应用于静态转码,比如:已获取到字符串,只想查看中文意思 us…

    2021/10/25 17:10:11 人评论 次浏览
扫一扫关注最新编程教程