
python学习笔记
文章平均质量分 52
xiaodingzi127
这个作者很懒,什么都没留下…
展开
-
将macos中conda的某一环境迁移到ubuntu中
由于我们使用macos时配置好了python环境,也进行了深度学习训练的测试,此时,我们想把代码扔到服务器上进行训练,可是有些python包和依赖包,我们并不想一一重新在服务器上训练,那怎么从本地环境前移到ubuntu中呢,如果我们直接用conda env export > environment.yml ,生成文件。通过scp传scp environment.yml dxx@192.168.xx.xx:/home/d/。传到d目录上。再直接用(已经在服务器配置好了anaconda的情况下)con原创 2021-11-19 15:41:42 · 1842 阅读 · 0 评论 -
python从srt文件中只提取歌词
原始文件观察只需去掉时间戳和索引号即可和换行符’\n’。假定对话中不以0123456789等单字符开头new = []with open("Anne.S01E01.Your Will Shall Decide Your Destiny.WEBRip.x264-RARBG.mp4.srt", encoding="utf-8-sig") as f: for ele in f.readlines(): if ele[0] not in list('\n0123456789'):原创 2021-08-24 11:02:02 · 761 阅读 · 0 评论 -
关于sys.path.append(). No module named ‘d2lzh_pytorch’
sys.path的作用是查看已经安装包的路径>>> import sys>>> sys.path['', '/Users/yanyu/anaconda3/envs/gluon/lib/python38.zip', '/Users/yanyu/anaconda3/envs/gluon/lib/python3.8', '/Users/yanyu/anaconda3/envs/gluon/lib/python3.8/lib-dynload', '/Users/yanyu/原创 2021-07-14 22:43:59 · 2918 阅读 · 0 评论 -
windows和Ubuntu系统的安装与调教
为了以后重新安装系统或是安装双系统不再走弯路,浪费一大把时间,我还是决定把安装历程写下来。如果是安装双系统,并且已经有了windows,就先在win启动里搜索 设备管理器,压缩卷,压缩个六七十G出来装ubuntuUbuntu桌面版本的安装为什么是桌面版本,因为你也可以选择不是桌面版本的,无图像界面的ubuntu系统,可以选择去官网下载不同版本,嫌速度慢的话也可以选择清华源看到没,就在这里输入ubuntu点这个,releases是发行版本的意思你想下载哪个,我也不拦你比如我要20.原创 2021-01-05 18:21:21 · 1151 阅读 · 0 评论 -
ubuntu 安装中文输入法, language-pack-gnome-zh-hans: Depends: language-pack-gnome-zh-hans-base (>= 1:12.04+2
ubuntu 安装中文输入法: https://leimao.github.io/blog/Ubuntu-Gaming-Chinese-Input/转载 2021-01-05 00:30:09 · 1382 阅读 · 0 评论 -
snap is bull shit now in our place, so we don‘t need to use it now till it can be more faster , Ther
snap is bull shit now in our place, so we don’t need to use it now till it can be more faster , Therefore, we need to download bed of the package from website instead use snap.we just need to download deb package andsudo dpkg -i packge.deb can help us in原创 2021-01-04 23:44:58 · 139 阅读 · 0 评论 -
ERROR: Could not find a version that satisfies the requirement
ERROR: Could not find a version that satisfies the requirement tensorflow1.14.0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0)ERROR原创 2020-12-29 00:11:00 · 2296 阅读 · 0 评论 -
用Anaconda管理python的库环境
用Anaconda管理python的库环境默认是base环境,基本所有的包都预装好了创建新环境conda create -n testname python==3.7,testname为环境名conda activate testname , 转换到testname这个环境中,新建立的环境装的包很少,如numpy包都没有,需要自己安装conda deactivate 返回到base环境中conda list 查看当前环境的所有的包conda env list 查看所有的原创 2020-12-28 17:29:56 · 639 阅读 · 1 评论 -
判断一个对象是否可迭代
from collections.abc import Iterable,Iteratorisinstance(range(0, 10), Iterator)Out[20]: Falseisinstance(range(0, 10), Iterable)Out[21]: Trueisinstance(iter(range(0, 10)), Iterator)Out[22]: True原创 2020-05-09 10:10:15 · 395 阅读 · 0 评论 -
关于python中赋值以及变量和其他数据结构的引用
PI = 3.14 #开辟了一个地址存储3.14,且PI引用这个地址存的值pi = PI #此时pi引用的也是3.14这个值pi is PI #返回Truep = 3q = 3p is q #返回True,因为-5到256这些值预先存储好了,所以直接定义变量的时候就因为相应地址的值就行#对于字符串类型,调用字符串strA的方法一般不会引起strB的改变,因为strA的方...原创 2020-05-07 17:43:33 · 232 阅读 · 0 评论 -
正则表达式分类
转载 2020-04-29 23:10:30 · 208 阅读 · 0 评论 -
python学习笔记
python笔记1.1 字符串python中定义变量接收字符串,可以用单引号’,双引号“,当字符串中出现单引号,可以在前面加转义字符” \ “,或者字符串用三引号接受>>> message = "Meet me tonight">>> print(message)Meet me tonight>>> message = 'The c...原创 2020-04-26 21:09:53 · 510 阅读 · 0 评论 -
关于pyecharts导入wordcloud、bar包失败等问题
由于作者少写了__init__文件,所以运行如下程序会出现导入不了的情况,即使换了很多个版本的pyecharts包也不行。from pyecharts.charts.wordcloud import WordCloudname =['Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World', 'Charter Communications'...原创 2019-05-21 15:34:09 · 3239 阅读 · 0 评论 -
ubuntu中mysql的安装和简单的使用
一.安装mysql1.sudo apt install mysql-server2ubuntu自带截屏工具,ctrl+shift+print,也可自行在系统设置中的keyboard设置为ctrl+shift+a强度别选strong 一定要选low才可以设置简单的1234.3.sudo apt install mysql-client4.sudo apt install ...原创 2019-02-27 11:19:40 · 496 阅读 · 0 评论