import tkinter
import webbrowser
import re #本程序是一个中文字符和中文检测工具
#中文字符自己添加,我只添加了一点
#输入字符串,点击检查文本即可判断有没有中文字符
# qianxiao996精心制作
#博客地址:https://blog.csdn.net/qq_36374896 win = tkinter.Tk()
win.title("中文字符检测工具 "+"by qianxiao996"+" -----博客地址:https://blog.csdn.net/qq_36374896 QQ:1919010193-----") #获取全部内容
def showInfo():
returntext.delete(0.0, tkinter.END) #清空returntext中的内容
str=text.get(0.0, tkinter.END) #得到text中的文本
list=[',','。',':','¥',';','“','‘'] #中文字符可以自行添加
endstr="" #存放文本中的特殊字符
zhPattern = re.compile(u'[\u4e00-\u9fa5]+') #匹配中文的正则表达式
for i in str: #遍历整个文本是否含有中文字符
if i in list: #遍历是否含有list中的字符
endstr+=i
elif zhPattern.search(i): #遍历是否是汉字
endstr += i
if endstr !='': #输出中文字符
returntext.insert(tkinter.INSERT, "中文字符:"+endstr)
else:
returntext.insert(tkinter.INSERT, "恭喜您,文本中没有中文字符")
#清空
def clearText():
text.delete(0.0, tkinter.END)
returntext.delete(0.0, tkinter.END)
def click():
webbrowser.open("https://blog.csdn.net/qq_36374896") #创建滚动条
scroll = tkinter.Scrollbar()
#height:显示的行数
str = "请在此输入您的文本(请删除此字符串):"
text = tkinter.Text(win,width =80,height = 50,bg='#F0FFFF',fg="#FF00FF") text.insert(tkinter.INSERT,str)
#side 放到窗体的哪一侧
scroll.pack(side =tkinter.RIGHT,fill = tkinter.Y)
text.pack(side =tkinter.LEFT,fill = tkinter.Y,)
#关联
scroll.config(command =text.yview)
text.config(yscrollcommand =scroll.set)
label = tkinter.Label(win,text= "作者QQ:1919010193",bg='#F0F8FF',fg="green").pack(side="bottom",ipady="8",ipadx="44")
zuozhe=tkinter.Button(win,text= "作者主页",command =click,bg='#F0F8FF',fg="green").pack(side="bottom",ipady="30",ipadx="80")
close = tkinter.Button(win,text= "关闭程序",command =win.quit,bg='#F0F8FF',fg="green").pack(side="bottom",ipady="30",ipadx="80")
clear = tkinter.Button(win,text= "清空文本",command = clearText,bg='#F0F8FF',fg="green").pack(side="bottom",ipady="30",ipadx="80")
button = tkinter.Button(win,text= "检查文本",command = showInfo,bg='#F0F8FF',fg="green").pack(side="bottom",ipady="30",ipadx="80")
returntext = tkinter.Text(win,width = 30,height=30,bg='#F0FFFF',foreground='red')
returntext.pack(side="top",ipadx="3")
win.mainloop()

python 自定义加密与解密的更多相关文章

  1. python RSA加密、解密、签名

    python RSA加密.解密.签名 python中用于RSA加解密的库有好久个,本文主要讲解rsa.M2Crypto.Crypto这三个库对于RSA加密.解密.签名.验签的知识点. 知识基础 加密是 ...

  2. 用python进行加密和解密——我看刑

    加密和解密 密码术意味着更改消息的文本,以便不知道你秘密的人永远不会理解你的消息. 下面就来创建一个GUI应用程序,使用Python进行加密和解密. 在这里,我们需要编写使用无限循环的代码,代码将不断 ...

  3. Python: AES加密与解密

    起源: 视频下载,解析到一个网站时,发现其视频id是用AES加密过的,用的是https://code.google.com/archive/p/crypto-js/这个库.解密很简单的一句js代码: ...

  4. Python pycrypto 加密与解密

    参考: python 使用 pycrypto‎ 实现 AES 加密解密 参考: 分组对称加密模式:ECB/CBC/CFB/OFB 代码示例 : import hashlib from Crypto.C ...

  5. python AES 加密与解密

    #用aes加密,再用base64 encode def aes_encrypt(data): from Crypto.Cipher import AES import base64 key=setti ...

  6. Python Des加密与解密实现软件注册码、机器码

    原理 判断路径下是否存在识别文件,若存在就解密对比,若不存在就进入机器码注册: 获取系统C盘序列号作为识别ID,并添加随机数作为混淆,生成最终机器码. 将机器码发给软件开发者,开发者将机器码解密后,添 ...

  7. php自定义加密和解密

    <?php function _authcode($string, $operation = 'DECODE', $expiry = 0) { $key = 'c5s1t6o';    $cke ...

  8. 使用crypto-js对数据进行AES加密、解密

    前段时间做项目有用到数据加密,前端加密,后端解密(前端也可以解密),话不多说进入正题: 第一步: npm i crypto-js -S 第二步: 在需要加密或解密的地方引入crypto-js: imp ...

  9. Python中的Base64编码的加密与解密

    Base64 可以干些啥? Base64编码的作用: 由于某些系统中只能使用ASCII字符.Base64就是用来将非ASCII字符的数据转换成ASCII字符的一种方法. 图片(and种子)base64 ...

随机推荐

  1. Note -「计算几何」模板

      尚未完整测试,务必留意模板 bug! /* Clearink */ #include <cmath> #include <queue> #include <cstdi ...

  2. suse 12 二进制部署 Kubernetets 1.19.7 - 第00章 - 环境准备

    文章目录 0.环境准备 0.0.修改主机名 0.1.添加hosts解析 0.2.配置ssh免密 0.3.发送hosts解析文件到其他节点,并修改hostname 0.4.更新PATH变量 0.5.安装 ...

  3. Spring MVC 是什么? 核心总结

    SpringMVC是一个基于Java的实现了MVC设计模式的请求驱动类型的轻量级Web框架,通过把Model,View,Controller分离,将web层进行职责解耦,把复杂的web应用分成逻辑清晰 ...

  4. kaptcha验证码参数设置

    Constant 描述 默认值 kaptcha.border 图片边框,合法值:yes , no yes kaptcha.border.color 边框颜色,合法值: r,g,b (and optio ...

  5. vue从后台拿数据渲染页面图片

    <div class="list-content"> <div v-for="goods in goodsList" class=" ...

  6. 容器化 | 在 KubeSphere 中部署 MySQL 集群

    程润科 数据库研发工程师,目前从事 RadonDB MySQL Kubernetes 研发,热衷于研究数据库内核.K8s 相关技术. 张莉梅 高级文档工程师,目前负责数据库产品文档开发.维护和管理工作 ...

  7. HttpClient的使用(get、post请求)

    添加pom依赖 <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> <d ...

  8. [c语言]c语言中的内存分配[转]

    在任何程序设计环境及语言中,内存管理都十分重要.在目前的计算机系统或嵌入式系统中,内存资源仍然是有限的.因此在程序设计中,有效地管理内存资源是程序员首先考虑的问题. 第1节主要介绍内存管理基本概念,重 ...

  9. [数分笔记]问题1.1 T1

    题目:非负整数a,b使得为整数,求证这个整数必是某一整数的平方.(1988年第29届国际数学奥林匹克竞赛试题) 证明:设k=,k为非负整数 1°a=b k=2a²/(1+a²)=2-2/(1+a²) ...

  10. TypeScript初识

    Typescript 英文官网:https://www.typescriptlang.org/ 中文官网:https://www.tslang.cn/ 介绍 TypeScript 是一种强类型的编程语 ...