随笔分类 -  文件操作

摘要:HDF Hierarchical Data Format的简称, hdf5是一种高级的适合大数据存储及层次逻辑数据的存储文件类型,而list及dict是数据类型. 层次结构数据,满足层次存储及索引包括: group 像字典 dataset 像numpy数组 安装后使用报错:通过pip install 阅读全文
posted @ 2020-10-28 18:19 Parallax 阅读(1495) 评论(0) 推荐(0) 编辑
摘要:from os import listdir import os #为什么这样导入都起作用??因为__init__.py作了导入 import random # a = listdir('E:\smoking\smoking\data\img') # with open("E:/smoking/sm 阅读全文
posted @ 2020-09-18 09:48 Parallax 阅读(106) 评论(0) 推荐(0) 编辑
摘要:Character Meaning 'r' open for reading (default) 'w' open for writing, truncating the file first 'x' open for exclusive creation, failing if the file 阅读全文
posted @ 2020-09-15 10:14 Parallax 阅读(185) 评论(0) 推荐(0) 编辑
摘要:相对路径就是相对当前所在目录来说的路径,绝对路径就是相对/(根)目录来说的路径。 和斜杠还是反斜杠没有关系。 相对路径不以/开头,绝对路径必须以/开头(根目录,比如在windows中 c:/user/ 就相当于/ ). ./abc是相对路径(./ 表示当前路径),/abc是绝对路径。 但是:/abc 阅读全文
posted @ 2020-09-14 18:27 Parallax 阅读(781) 评论(0) 推荐(0) 编辑
摘要:import cv2 import numpy as np #from PIL import Image def separate_color_red(img): hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) lower_hsv = np.array([0, 阅读全文
posted @ 2020-07-08 18:36 Parallax 阅读(231) 评论(0) 推荐(0) 编辑
摘要:# -*- coding:utf8 -*- import os class BatchRename(): """ 批量重命名文件夹中的图片文件 """ def __init__(self): self.path = 'D:\MyData\zhaohz4\Desktop\MIdea_logo\data 阅读全文
posted @ 2020-05-25 09:05 Parallax 阅读(167) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/tgyf/p/3839894.html #include "io.h" #include <fstream> #include <string> void getFilesAll(string path, vector<string>& files) 阅读全文
posted @ 2020-01-04 18:46 Parallax 阅读(314) 评论(0) 推荐(0) 编辑
摘要:/*#include <iostream> #include <stdio.h> #include <string> #include <vector> #include <io.h> #include <string.h> #include <opencv2/opencv.hpp> using n 阅读全文
posted @ 2020-01-04 17:03 Parallax 阅读(212) 评论(0) 推荐(0) 编辑
摘要:type "2.txt" | findstr /bevlig:"1.txt">>不同内容.txt //输出2中与1不同的到新的txt文件 type "1.txt" | findstr /bevlig:"2.txt">>不同内容.txt //输出1中与2不同的到新的txt文件 type "1.txt" 阅读全文
posted @ 2019-12-18 14:15 Parallax 阅读(335) 评论(0) 推荐(0) 编辑
摘要:#include <opencv2/opencv.hpp> #include <iostream> #include <vector> #include <string> #include <fstream> using namespace cv; using namespace std; int 阅读全文
posted @ 2019-12-16 14:42 Parallax 阅读(684) 评论(0) 推荐(0) 编辑
摘要:1 #coding:utf-8 2 3 import random 4 import time 5 """ 6 注意盘符小写 7 8 """ 9 f = open("d:\\MyData\\zhaohz4\\Desktop\\train.txt","r") #源文件 10 fw = open("d: 阅读全文
posted @ 2019-11-26 08:38 Parallax 阅读(767) 评论(0) 推荐(0) 编辑
摘要:PIL批量更改 1 # coding:utf-8 2 import os 3 4 """ 5 安装时装pillow,引用时还是PIL 6 """ 7 from PIL import Image 8 9 10 # bmp 转换为jpg 11 def bmpToJpg(file_path): 12 fo 阅读全文
posted @ 2019-11-15 14:54 Parallax 阅读(342) 评论(0) 推荐(0) 编辑
摘要:""" 目录地址引用用单引号! """ from os import listdir listdir('C:/Users/Administrator/Desktop/data/Ch02/digits/trainingDigits') print(trainingFileList[:5]) #Outp 阅读全文
posted @ 2018-11-23 04:34 Parallax 阅读(86) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示