代码改变世界

阅读排行榜

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

2017-09-22 14:21 by hdwen, 2300 阅读, 收藏,
摘要: # 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' ... 阅读全文

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

2017-08-19 16:13 by hdwen, 1967 阅读, 收藏,
摘要: 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, 阅读全文

对数组去重排序

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

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

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

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

2017-06-02 09:00 by hdwen, 391 阅读, 收藏,
摘要: #一、# 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 阅读全文