码迷,mamicode.com
首页 >  
搜索关键字:__time__    ( 52982个结果
进程间数据传递
code import time from multiprocessing import Queue, Process def f(q): q.put([time.asctime(), 'from Eva', 'hello']) # 调用主函数中p进程传递过来的进程参数,puy函数为向队列中添加一条 ...
分类:系统相关   时间:2020-12-31 12:04:34    阅读次数:0
多进程抢票加锁
code # 文件db的内容为:{"count":5} # 注意一定要用双引号,不然json无法识别 # 并发运行,效率高,但竞争写同一文件,数据写入错乱 from multiprocessing import Process,Lock import time,json,random def sea ...
分类:系统相关   时间:2020-12-31 12:02:45    阅读次数:0
获取线程的执行结果
code import threading from queue import Queue import time def timeit(f): def wrapper(*args, **kwargs): start_time = time.time() res = f(*args, **kwarg ...
分类:编程语言   时间:2020-12-31 11:57:23    阅读次数: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
Spring整合Mybatis
整合流程 导入相关的包 mybatis;mybatis-spring;spring-webmvc;spring-jdbc;aspectjweaver(AOP面向切面);mysql;lombok;junit 可以参考mybitis-spring的文档进行学习:http://mybatis.org/sp ...
分类:编程语言   时间:2020-12-30 11:30:58    阅读次数:0
go 剖析异常
panic支持抛出任意类型的异常(而不仅仅是error类型的错误),recover函数调用的返回值和panic函数的输入参数类型一致,它们的函数签名如下: func panic(interface{}) func recover() interface{} Go语言函数调用的正常流程是函数执行返回语 ...
分类:其他好文   时间:2020-12-30 11:17:15    阅读次数:0
go 并发
占位... from https://gobyexample.com/worker-pools package main import ( "fmt" "time" ) func worker(id int, jobs <-chan int, results chan<- int) { for j ...
分类:其他好文   时间:2020-12-30 10:49:19    阅读次数:0
JWT原理
JWT(即json web token),大家先看下面这张图 大家可以观察到,jwt String就是生成后的jwt字符集,其中有两个 "."(注意:jwt校验会对"."个数校验,多或少都会校验失败),被"."分割的就是jwt的三个构成部分,即:header、payload、sign。 接下来,给大 ...
分类:其他好文   时间:2020-12-30 10:48:44    阅读次数:0
java实现文件移动
import java.io.*; public class TIME { public static void main(String[] args) { File oldName = new File("路径/test.png"); File newName = new File(System. ...
分类:移动开发   时间:2020-12-30 10:46:56    阅读次数:0
C# 对象、文件与byte数组之间的转换
1.使用Marshal类的StructureToPtr与PtrToStructure函数对object与byte数组进行转换 命名空间:System.Runtime.InteropServices /// <summary> /// 将对象转换为byte数组 /// </summary> /// < ...
分类:编程语言   时间:2020-12-30 10:46:02    阅读次数:0
52982条   上一页 1 ... 52 53 54 55 56 ... 5299 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!