![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 63
你的橙子
一个安静的美女子
展开
-
HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/saved_model
起因:本来在sort_change_nlp和sort_nlp两个文件夹下,分别有一个saved_model文件夹,但是名字不一样,一个是saved_model一个是saved_model_copy,在http_sever钟使用saved_model,发生了如下错误:model = YesOrNoModel.from_pretrained(model_name)def is_model_answer(query): for rule in base_data....原创 2021-09-13 09:52:40 · 3079 阅读 · 0 评论 -
更改lunix的默认python版本
在安装了安装anaconda之后 原来的Python自动变为了anaconda中的Python的版本进行命令python --version出现的是【Python 3.6.5 :: Anaconda, Inc.】解决:/usr/local/python3/bin/python3.6 是自己在anaconda安装之前的安装的python地址alias python3="/usr/local/python3/bin/python3.6"alias python="/usr/bin/p..原创 2021-08-20 17:32:47 · 195 阅读 · 0 评论 -
Python处理JSON时的值报错及编码报错的两则解决实录
这篇文章主要介绍了Python处理JSON时的值报错及编码报错的两则解决实录,在这里还是想建议一下使用Python 3.x版本,Python 3默认的Unicode编码能在实际使用中为我们省去不少问题,需要的朋友可以参考下1、ValueError: Invalid control character at: line 1 column 8363 (char 8362)使用json.loads(json_data)时,出现:ValueError: Invalid control charac转载 2021-08-11 17:44:47 · 1545 阅读 · 0 评论 -
Python【三十六】列表list的大小比较< 、> 、==
TypeError:“dict”和“dict”实例之间不支持“<”list的< 、> 、==list1== list2,“==”只有成员、成员位置都相同时才返回True对于,==和!=两个操作符,如果两个列表的大小不想等,则可以直接返回False或者True的结果,无须再进行其他比较。L1 = [2, ('a', 10), 2]L2 = [2, ('a', 10)]print(L1 < L2) # Falseprint(L1 == L2) #..原创 2021-08-10 14:44:28 · 7581 阅读 · 0 评论 -
Python【三十五】关于arrow.get方法拿到的时间戳问题和arrow.now()
一、arrow.now()的调用问题如果将arrow.now()赋给current变量进行调用的话,current就是固定的,而不会随着当前时间的变化而变化,每次调用的时间就是初始化current的时间datetime_format = "YYYY-MM-DD HH:mm:ss"# 当前的时间current = arrow.now()print(f"current1={current.format(datetime_format)}")print(f"current1的timestamp原创 2021-08-06 18:17:56 · 2554 阅读 · 0 评论 -
Python【三十二】sort
参考:Python List sort()方法一、介绍1. 作用:对列表的对象进行排序,没有返回值2. sort()方法语法:list.sort(cmp=None, key=None, reverse=False)cmp -- 可选参数, 如果指定了该参数会使用该参数的方法进行排序。 key -- 主要是用来进行比较的元素,只有一个参数,具体的函数的参数就是取自于可迭代对象中,指定可迭代对象中的一个元素来进行排序。 reverse -- 排序规则,reverse = Tr原创 2021-08-04 12:01:09 · 432 阅读 · 0 评论 -
Python【三十一】正则【二】分组:sre_constants.error: redefinition of group name ‘fir‘ as group 5; was group 2 at
问题:一个正则中不能包含相同的group nameunit_re = "((?P<fir>\\d+.\\d+)(市斤|斤))|((?P<fir>\\d+)(市斤|斤))"m_s = re.search(unit_re, "90KG", flags=re.IGNORECASE)if m_s is not None: print(m_s.group())sre_constants.error: redefinition of group name 'fir' as原创 2021-08-03 14:13:35 · 780 阅读 · 0 评论 -
【python】服务器持续在后台运行脚本
原文链接:https://blog.csdn.net/AXIMI/article/details/105740502实现目标可以在服务器上跑一个脚本,后台执行,且本地退出SSH会话后,该程序要一直执行实现方式使用nohup运行该脚本nohup python /path/to/python/file.py &执行完上面的命令后按任意键退回到shell回到shell之后不能直接关闭自己的终端,必须输入exit来退出SSH才能保证该脚本会...转载 2021-07-29 10:13:54 · 644 阅读 · 0 评论