code from threading import Thread from multiprocessing import Process import os def work(name): print('{}的pid是'.format(name), os.getpid()) if __name__ ...
分类:
编程语言 时间:
2020-12-31 12:09:31
阅读次数:
0
code import os from multiprocessing import Process def f(x): print('子进程id :',os.getpid(),'父进程id :',os.getppid()) return x*x if __name__ == '__main__': ...
分类:
系统相关 时间:
2020-12-31 12:06:57
阅读次数:
0
import os import time import shutil def del_file(filepath): """ 删除某一目录下的所有文件或文件夹 """ del_list = os.listdir(filepath) for f in del_list: file_path = os ...
分类:
其他好文 时间:
2020-12-31 11:42:16
阅读次数:
0
socketserver 重写处理函数 import http.server import socketserver import os,io import urllib from http import HTTPStatus import email.utils import datetime i ...
分类:
编程语言 时间:
2020-12-29 11:43:36
阅读次数:
0
(1)virtualenv 报错 os 没有 PathLike属性 阿里云ubuntu16.0服务器默认python版本分别是2.7.12,3.5.2,而PathLike是在python 3.6时才被加入的属性,因此需要再装个python3.6,并把3.6版本的作为默认版本。 直接sudo apt- ...
分类:
其他好文 时间:
2020-12-25 12:26:17
阅读次数:
0
对指定目录下的指定类型文件进行遍历,可对文件名关键字进行条件筛选 返回值为文件地址的列表 import os # 定义一个函数,函数名字为get_all_excel,需要传入一个目录 def get_all_excel(dir): file_list = [] for root_dir, sub_d ...
分类:
编程语言 时间:
2020-12-25 12:06:28
阅读次数:
0
参考图 简单说明 metrics以及log是组合监控的核心,log 的处理需要pg 实例配置相关的log 参数可以基于syslog 以及logstash 收集到 graylog,对于metrcis 的处理基于了telegraf(使用各类plugin,db,os。。。) 说明 pmm 也是一个不错的工 ...
分类:
其他好文 时间:
2020-12-25 11:47:16
阅读次数:
0
import os import sys import codecs import string def batch_rename(cfgname): # 获得目录下的所有文件 src_list = os.listdir("D:/picsample/picsample") print(src_lis ...
分类:
其他好文 时间:
2020-12-24 11:59:13
阅读次数:
0
import numpy as np import os os 模块提供了非常丰富的方法用来处理文件和目录 import warnings warnings模块可以去除警告信息 import scipy.sparse as sp 稀疏矩阵库 from time import time from sk ...
分类:
其他好文 时间:
2020-12-24 11:41:51
阅读次数:
0
os模块是与操作系统交互的一个接口 os.getcwd() # 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir('dirname') # 改变当前脚本工作目录,相当于shell下cd os.curdir # 返回当前目录:('.') os.pardir # 获取当前目录父目 ...
分类:
其他好文 时间:
2020-12-22 12:19:34
阅读次数:
0