Made a legal query tool in Python, very easy to use
Hello brother, today I will share with you a Python tkinter tool for making legal inquiries.
You can only use reptiles alone, even if you package the exe, it won’t look good, so let’s write it directly as an interface.
When we want to understand the law but don't want to buy books, we can use this small tool to slowly search and understand.
Of course, if you want to make it more interesting, you have to rely on everyone to perfect it.
Show results
Let's see the effect
The writing is relatively simple, so don't pay too much attention to it.
Let’s check again, only the criminal law is added here, we just need to enter the number directly if we want to check the number of articles, for example, I want to check the first one now.
In this way, the first item will come out directly, and so on.
try another
Preparation
First of all, we need to prepare a document that saves the law, or it can be replaced with another one. Here, we can directly write a crawler code in Python and just crawl down.
If not, you can click me to go directly to the code and video explanation, I am ready
material
Then prepare a 700*200 picture material. The picture below is what I used. You can also design a better-looking one by yourself.
main code
Interface part code
root = tk.Tk()
root.title('法律条文查询,源码+VX:Python1018')
root.geometry('690x500+200+200')
# 读取图片
img = tk.PhotoImage(file='img1.png')
tk.Label(root, image=img).pack()
input_frame = tk.Frame(root)
input_frame.pack(pady=20)
input_va = tk.StringVar()
tk.Label(input_frame, text='输入内容:', font=('黑体', 18), fg='#ed1c24').pack(side=tk.LEFT, padx=5)
tk.Entry(input_frame, relief='flat', textvariable=input_va, font=('黑体', 18)).pack(side=tk.LEFT, padx=5)
tk.Button(input_frame, text='查询', font=('黑体', 12), relief='flat', fg='#ffffff', bg='#ed1c24', command=Query).pack(side=tk.LEFT, padx=5)
text = tk.Text(root, width=55, height=9, font=('黑体', 18))
text.pack()
Of course, we can also package it into an exe file, so that it can be sent to friends for use together.
The complete code can be picked up directly from the business card below
Well, that's all for today's sharing, see you next time.