首页 > 编程语言
Python基础-递归练习
# os模块:计算一个文件下所有的文件的大小,这个文件下面还有文件夹,不能用 import os def dir_size(path): size = 0 name_list = os.listdir(path) for name in name_list: abs_path = os.path.j ...
分类:编程语言   时间:2020-05-07 22:15:38    收藏:0  评论:0  赞:0  阅读:57
Python书籍推荐:《Python编程快速上手——让繁琐工作自动化》(高清PDF+书签)
下载地址: 链接:https://pan.baidu.com/s/1Fa0ZOj0oxKoqPlWrbcHqjg 提取码:n9ne 目录 · · · · · · 第一部分Python编程基础第1章 Python基础 31.1 在交互式环境中输入表达式 31.2 整型、浮点型和字符串数据类型 61.3 ...
分类:编程语言   时间:2020-05-07 22:12:59    收藏:0  评论:0  赞:0  阅读:51
线程_GIL最简单的例子
#解决多进程死循环 import multiprocessing def deadLoop(): while True: print("Hello") pass if __name__ == '__main__': # 子进程死循环 p1 = multiprocessing.Process(targ ...
分类:编程语言   时间:2020-05-07 22:11:11    收藏:0  评论:0  赞:0  阅读:55
线程_gevent实现多个视频下载及并发下载
from gevent import monkey import gevent import urllib.request #有IO操作时,使用patch_all自动切换 monkey.patch_all() def my_downLoad(file_name, url): print('GET: ...
分类:编程语言   时间:2020-05-07 22:10:32    收藏:0  评论:0  赞:0  阅读:50
Groovy 语言尝鲜
环境搭建 1. 下载 apache Groovy 解释器 2. windows上增加环境变量, GROOVY_HOME 环境变量指向 bin 目录的父目录 ; 将 bin 目录加到 PATH 环境变量中. 3. VS Code 安装 code runner 插件, 方便脚本的调试工作. 该插件安装后 ...
分类:编程语言   时间:2020-05-07 22:09:36    收藏:0  评论:0  赞:0  阅读:55
python-django-查询详解
倒数第二条性质可以实现链式的调用,通过第一次的过滤还可以再过滤倒数第一条就是结果集从数据库中查询出来之后不会再进行数据库的查询的我们使用的object就是模型管理器manager的一个对象 obj = User.objects.get_or_create(username='zhangsan',pa ...
分类:编程语言   时间:2020-05-07 22:09:13    收藏:0  评论:0  赞:0  阅读:48
c语言值关于注释学习
1.注释的两种方式:// 和 /* */ 2.编译器在预处理剔除注释时,会将注释剔除掉,然后然后空格替换掉; 如:以下三种注释方法都是正确的 1. int /**/i = 22; 2. char* s = "weiyouqing// hiii"; 3. //Ist it a \ valid comm ...
分类:编程语言   时间:2020-05-07 22:06:26    收藏:0  评论:0  赞:0  阅读:47
算法学习之DWA局部路径规划算法
DWA算法是近日工作中常用到的算法,在此分享一下。 DWA算法又名动态窗口法,其原理较为简单,属于局部路径规划算法,常用于局部避障. 简单介绍一下算法流程: 根据车体模型不同,DWA对于预测点的方式有所不同,对于前轮前驱模型,DWA预测方式为对前轮角度和速度的预测. 对于两轮差速模型,DWA预测方式 ...
分类:编程语言   时间:2020-05-07 22:05:42    收藏:0  评论:0  赞:0  阅读:746
线程_Process基础语法
""" Process([group[,target[,name[,args[,kwargs]]]]]) group:大多数情况下用不到 target:表示这个进程实例所调用的对象 target=函数名 name:为当前进程实例的别名 args:表示调用对象的位置参数元组 args=(参数,) kw ...
分类:编程语言   时间:2020-05-07 22:04:34    收藏:0  评论:0  赞:0  阅读:49
线程_threading合集
# 主线程等待所有子线程结束才结束 import threading from time import sleep,ctime def sing(): for i in range(3): print("正在唱歌 %d"%(i)) sleep(2) def dance(): for i in ran ...
分类:编程语言   时间:2020-05-07 22:02:46    收藏:0  评论:0  赞:0  阅读:54
【SpringMVC】12 文件上传和下载
编写一个请求上传和下载的JSP页面 <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Title</title> </head> <body> <h3>上传 和 下载</h3> ...
分类:编程语言   时间:2020-05-07 22:01:14    收藏:0  评论:0  赞:0  阅读:60
线程_进程池
from multiprocessing import Pool import os,time,random def worker(msg): start_time = time.time() print("(%s)开始执行,进程号为(%s)"%(msg,os.getpid())) time.sle ...
分类:编程语言   时间:2020-05-07 21:59:48    收藏:0  评论:0  赞:0  阅读:46
Java注解@Cacheable的工作原理
In order to avoid unnecessary query on database it is a common pattern to define a cache in application layer to cache the query result from database. ...
分类:编程语言   时间:2020-05-07 21:57:49    收藏:0  评论:0  赞:0  阅读:48
3.无重复字符的最长子串Java版,每日一题系列(此题来自力扣网)
3.无重复字符的最长子串Java版,每日一题系列(此题来自力扣网) 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: "bbbbb" 输出: ...
分类:编程语言   时间:2020-05-07 21:55:33    收藏:0  评论:0  赞:0  阅读:41
Spring的依赖注入之多数据结构注入
配置文件中的bean代码 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSc ...
分类:编程语言   时间:2020-05-07 21:55:11    收藏:0  评论:0  赞:0  阅读:52
线程_multiprocessing异步
from multiprocessing import Pool import time import os def test(): print(" 进程池中的进程 pid=%d,ppid=%d--"%(os.getpid(),os.getppid())) for i in range(3): pr ...
分类:编程语言   时间:2020-05-07 21:52:13    收藏:0  评论:0  赞:0  阅读:48
线程_multiprocessing实现文件夹copy器
import multiprocessing import os import time import random def copy_file(queue,file_name,source_folder_name,dest_folder_name): f_read = open(source_fo ...
分类:编程语言   时间:2020-05-07 21:51:36    收藏:0  评论:0  赞:0  阅读:43
线程_使用multiprocessing启动一个子进程及创建Process 的子类
from multiprocessing import Process import os # 子进程执行的函数 def run_proc(name): print("子进程运行中,名称:%s,pid:%d..."%(name,os.getpid())) if __name__ == "__main ...
分类:编程语言   时间:2020-05-07 21:49:59    收藏:0  评论:0  赞:0  阅读:64
springboot 实现文件下载功能
文件存在在data目录下 @GetMapping(value = "/file/download") public ResponseEntity<FileSystemResource> getFile(@RequestParam String fileName) throws FileNotFoun ...
分类:编程语言   时间:2020-05-07 21:47:47    收藏:0  评论:0  赞:0  阅读:1539
线程_FIFO队列实现生产者消费者
import threading # 导入线程库 import time from queue import Queue # 队列 class Producer(threading.Thread): # 线程的继承类,修改 run 方法 def run(self): global queue cou ...
分类:编程语言   时间:2020-05-07 21:45:32    收藏:0  评论:0  赞:0  阅读:64
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!