代码改变世界

对数组去重排序

2017-12-14 20:19 by hdwen, 896 阅读, 0 推荐, 收藏, 编辑
摘要:/** * FileName: TestPractiseDuplicateArray * Author: HDWEN * Date: 2017/12/14 15:49 * Description: 将数组中重复元素删除,并按照一定顺序排序 * Desc: */ package cn.hdwen.java.testarray; import java.util.Array... 阅读全文

遍历本地文件个数及创建、修改时间

2017-10-11 23:18 by hdwen, 300 阅读, 0 推荐, 收藏, 编辑
摘要:1 # @Author: Hdwen 2 # @Date : 2017/10/11 19:53 3 # @Desc :遍历文件或者文件夹中文件创建时间和修改时间,能够将隐藏的文件也遍历出来,如果只是遍历文件个数,则去除print()语句会节省很多时间 4 """ 5 可以根据这个来写一个遍历文件最近七天使用过的的文件 6 只需要判断时间:将目前的时间减去七天的时间,如果True则... 阅读全文

PDF_下载,下载进度条

2017-09-26 20:06 by hdwen, 363 阅读, 0 推荐, 收藏, 编辑
摘要:from __future__ import division import requests,re,os,math,sys,time from contextlib import closing from multiprocessing import Pool start_time=time.time() headers={'User-Agent':'Mozilla/5.0 (Windows... 阅读全文

爬取网易热评做成网易云热门截图形式(给自己看的很乱有待更改+)

2017-09-22 14:21 by hdwen, 2233 阅读, 0 推荐, 收藏, 编辑
摘要:# coding: utf-8 import requests, json, os, time, math, re from PIL import Image, ImageDraw, ImageFont # 字体区 nor_font = 'C:/windows/fonts/simsun.ttc' micro_font = 'C:/windows/fonts/msyhbd.ttc' ... 阅读全文

爬取网易热评做成评论截图形式(给自己看的很乱有待更改)

2017-09-19 21:15 by hdwen, 777 阅读, 0 推荐, 收藏, 编辑
摘要:# coding: utf-8import requests, json, os, datetime, math, refrom PIL import Image, ImageDraw, ImageFont# 字体区nor_font = 'C:/windows/fonts/simsun.ttc'mi 阅读全文

去除多层list中嵌套的list,形成新的列表

2017-08-19 16:13 by hdwen, 1931 阅读, 0 推荐, 收藏, 编辑
摘要:D = []def move_list(a): for i in a : if type(i) != list: D.append(i) else: move_list(i)s=[1,[12,[1,[1,23,4,[1,2,[3]]]]],[3,[1,[2,645,[3,5,[456,[4,[45, 阅读全文

把一个骰子扔n次, n次朝上一面的点数和为s。 输入n, 打印出s的所有可能的值出现的概率。

2017-06-02 09:00 by hdwen, 357 阅读, 0 推荐, 收藏, 编辑
摘要:#一、# 1.计算所有数之和import datetimestart=datetime.datetime.now()n=10c=[]a = [1,2,3,4,5,6]b = [1,2,3,4,5,6]total=len(a)**(n)while n>1: for i in a: for j in b 阅读全文