随笔分类 -  python基础

摘要:str = ('123456') fh = open('666.txt', 'w', encoding='utf-8') fh.write(str) fh.close() 阅读全文
posted @ 2020-02-04 22:45 you-wh 阅读(22764) 评论(1) 推荐(5) 编辑
摘要:for file in os.listdir('yolov3_tiny_car_det/output'): fsize = os.path.getsize(f'yolov3_tiny_car_det/output/{file}') if (fsize<40000): os.remove(f'yolo 阅读全文
posted @ 2020-02-03 18:21 you-wh 阅读(993) 评论(0) 推荐(0) 编辑
摘要:import os for files in os.listdir('output'): if files.endswith(".py"): os.remove(os.path.join('output',files)) 下面是删除所有以及子目录 import os,shutil def del_f 阅读全文
posted @ 2020-01-31 19:43 you-wh 阅读(3200) 评论(0) 推荐(0) 编辑
摘要:plt.cla() plt.close("all") 循环中创建太多plt对象,在每个循环中加入上面两句 阅读全文
posted @ 2020-01-30 19:19 you-wh 阅读(1666) 评论(0) 推荐(0) 编辑
摘要:import glob # path_file_number=glob.glob('D:/case/test/testcase/checkdata/*.py')#或者指定文件下个数 path_file_number=glob.glob(pathname='*.py') #获取当前文件夹下个数 pri 阅读全文
posted @ 2020-01-30 14:46 you-wh 阅读(1085) 评论(0) 推荐(0) 编辑
摘要:在CMD命令行窗口中输入:python -m pydoc -p 1234 接着输入b启动浏览,操作如下图所示: 在浏览器中即可查找搜索函数: 阅读全文
posted @ 2020-01-22 12:14 you-wh 阅读(225) 评论(0) 推荐(0) 编辑
摘要:使用setup.py 例如: 在碰到pyx文件的时候,如果不编译会报错。 ModuleNotFoundError: No module named 'keras_retinanet.utils.compute_overlap', how do I fix this? Most likely you 阅读全文
posted @ 2020-01-20 17:00 you-wh 阅读(1236) 评论(0) 推荐(0) 编辑
摘要:pip install Polygon这样会安装不了 使用pip install Polygon2 或者 pip install Polygon3,必须带版本号 阅读全文
posted @ 2020-01-20 16:58 you-wh 阅读(879) 评论(0) 推荐(0) 编辑
摘要:常用命令以及链接 清华源链接 -i https://pypi.tuna.tsinghua.edu.cn/simple查看显卡占用watch -n 1 nvidia-smi 监听服务器端口tensorboard:ssh -L 12345:127.0.0.1:6006 username@remote_s 阅读全文
posted @ 2020-01-06 15:50 you-wh 阅读(209) 评论(0) 推荐(0) 编辑
摘要:安装pipreqs pip install pipreqs 使用方法: pipreqs 项目路径 会自动导出requirements.txt文件 若出现encoding错误,进入pipreqs.py直接修改对应行为utf-8即可 使用pip install -r requirements.txt 即 阅读全文
posted @ 2020-01-06 10:56 you-wh 阅读(481) 评论(0) 推荐(0) 编辑
摘要:1.设置远程服务器,在这里配置服务器地址等; 要注意下边的这个mappings设置好,跟编译器的path mapping设置为同一个,这里我没设置为同一个,后边就出现了点问题。 2.配置远程的编译器 一定要注意设置好path mapping这里的远程地址,这里的远程地址是绝对路径,没有前面的root 阅读全文
posted @ 2019-09-08 10:14 you-wh 阅读(1356) 评论(0) 推荐(0) 编辑
摘要:多试几次,有时候网络不稳定下载一半会停掉 更改Pip源 pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple 1.首先确认镜像源为稳定镜像源(现在最稳定的是清华镜像源) 查看本机镜像源 conda config --show 还 阅读全文
posted @ 2019-07-20 12:19 you-wh 阅读(20843) 评论(0) 推荐(3) 编辑
摘要:查看conda的py环境conda info -e # 创建一个名为python34的环境,指定Python版本是3.4(创建py27操作一样)conda create -n py34 python=3.4 #删除conda环境 conda remove -n 环境名 # 安装好后,使用activa 阅读全文
posted @ 2019-07-13 21:40 you-wh 阅读(1023) 评论(0) 推荐(0) 编辑
摘要:找到目录下的setup.py文件 cd到工程目录下: 执行 python3 setup.py build_ext --inplace 阅读全文
posted @ 2019-05-11 11:22 you-wh 阅读(360) 评论(0) 推荐(0) 编辑
摘要:yield作用类似于return,其本质是一个迭代器。 当程序执行到yield时,会结束本次循环,返回一个值,然后内置含有next()函数, 下次在执行时,会从yield结束的地方继续执行。 带yield的函数是一个生成器,内置next函数,当本次执行到yield结束时候,下一次next就会从本次停 阅读全文
posted @ 2019-02-28 09:44 you-wh 阅读(228) 评论(0) 推荐(0) 编辑
摘要:1 plt.bar(left =x_label ,height = tuple_val,width = 0.35) 2 3 for a,b in zip(x_label,tuple_val): 4 plt.text(a, b+0.05, '%.2f' % b, ha='center', va= 'bottom',fontsize=11) 5 plt.legend() 6 plt.sho... 阅读全文
posted @ 2018-12-11 15:18 you-wh 阅读(107) 评论(0) 推荐(0) 编辑
摘要:1.class的init功能,初始化class,给出一些初始值 __init__可以理解成初始化class的变量,取自英文中initial 最初的意思.可以在运行时,给初始值附值, 在创建一个class对象的时候 ,可以赋予初始值 2.读写文件,存储在变量中 my_file=open('my fil 阅读全文
posted @ 2018-12-11 15:17 you-wh 阅读(171) 评论(0) 推荐(0) 编辑

Fork me on GitHub
点击右上角即可分享
微信分享提示