自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 酥糖码构想

python实现电子二维码文本存储压缩,解决因摄像头分辨率不足导致二维码无法读取的问题。编码:(将二维码压缩为酥糖码的过程)每统计至128+n字节分一层(即16个汉字或128个字母数字与标点)记录二维码最大层数至位置文本文件增加n个空字节防止因强行分割而出错。生成第一层二维码,记录第一层二维码色块位置信息至临时数据文本文件,黑色块标记为1,白色块标记为0。则第一层标有1的色块...

2020-04-05 17:37:25 213

原创 汉字简易加密解密小程序

最近在上密码学,随便写着玩玩。import linecacheimport msvcrtdef chineseToUnic(ch): #汉转U return ch.encode('unicode_escape')def UnicTochinese(ch): #U转汉 ch1 = ch.decode('unicode_escape') return ch1def charToUnic(ch): #二次加密 keycreate = [] s

2021-03-11 20:45:07 874

原创 包含小数的二进制十进制转换

import mathnum = input("请输入要转换的数")judge = int(input("次数为二进制数请输1,此数为十进制数请输2:"))DEC = 0BIN = float(0)if judge == 1: location = num.find(".") for i in range(0, len(num)): if i < location: # 整数运算 DEC += int(num[location-(i.

2021-03-09 14:17:59 480

原创 python爬虫及语言处理练习

家里长辈想要一款定制的月份工作表制作软件,试着稍微编一编,目前完成度如下(至八月份)。进度节点清单:目前进度:目前时间显示: 时间表生成:周末时间分析:政府政策爬取及处理:政府政策节日分析:政府政策调休分析:人员信息录入:特殊节假日录入:人员信息及特殊节假日查询:目前代码总览:def now(): #当前时间 import time todayyear = time.localt...

2020-08-19 01:17:22 252

原创 用于汉诺塔的输出简化方式

def simple(list1, a1=0,type='A'): a = 0 if a == len(list1): if a == 0: print("{}:[ ]".format(type)) else: print(']') return a = a1 for ...

2020-04-24 18:58:57 214

原创 蒙蒂霍尔悖论小程序

import tkinter as tkimport randomimport tkinter as tkimport randomdef start(): print(l2[0]) print(l1) global win global win1 win.destroy() win1.destroy() for i in r...

2020-04-20 15:12:09 582 1

原创 当输入字符或字符串时终止程序的方法

def zz(i12): i13 = 0 if type(i12)!=str: i13 = 0 else: if len(i12) == 0: i13 = 1 else: for i11 in range(0,len(i12)): if str(...

2020-04-02 15:26:34 2991

原创 尼姆游戏

def rob(y): import random import math y1 = y//2 for i in range(1,y1+1): if isinstance(((y-i+1)**0.5/0.5), int) is True: return i else: return(random.ra...

2020-04-02 15:20:51 874

原创 用列表取每位数字不同的随机数

def Cola(I1,I2): import random c1 = [] c = [] b = 0 I3 = I1 I4 = I2-1 print('取', I1, sep='', end='') print('位数') print('取', I2, sep='', end='') print('个数:', en...

2020-03-27 15:50:53 212

原创 随机抽样判断6174猜想是否成立

def fs(): import random l1 = 0 l2 = 1 n = random.randint(1000, 9999) while l1 != l2: n = random.randint(1000,9999) n1 = list(map(int,str(n))) l1 = len(n1)...

2020-03-26 16:17:10 267

原创 计算组合数C(n,i)时避免浮点数精度影响结果的解决方法

def c1 (n,i): minNI = min(i,n-1) result = 1 for j in range (0,minNI): result = result * (n-j)/(minNI-j) return resultprint ('更改前C(5,3)数值为:',c1(5,3))print ('更改前C(100,97)数值为:'...

2020-03-19 12:42:42 1535

原创 海龟可视化投点求Π法

学习时发现网上没有相关的,就玩了会海龟import randomimport turtleturtle.delay(1)turtle.hideturtle()hits = 0turtle.speed(0)turtle.setup(width=1000,height=1000)turtle.penup()times = int(input('请输入掷飞镖的次数'))a ="投...

2020-03-17 16:52:17 385

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除