欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

使用python tkinter實(shí)現(xiàn)各種個(gè)樣的撩妹鼠標(biāo)拖尾效果

 更新時(shí)間:2021年09月07日 10:28:29   作者:大家一起學(xué)編程(python)  
這篇文章主要介紹了使用python tkinter實(shí)現(xiàn)各種個(gè)樣的撩妹鼠標(biāo)拖尾效果,本文通過(guò)實(shí)例代碼,給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

python-tkinter 實(shí)現(xiàn)各種個(gè)樣的撩妹鼠標(biāo)拖尾,效果圖展示:

系統(tǒng)的拖尾已經(jīng)無(wú)法滿足我們了,女朋友叫你把鼠標(biāo)拖尾換成她的照片,讓你時(shí)時(shí)刻刻都可以看見(jiàn)她,這個(gè)要求你答不答應(yīng)。

當(dāng)然,這個(gè)要求還是可以滿足一下的,我們來(lái)具體看一看吧。

要制作拖尾,首先,我們需要知道鼠標(biāo)的位置,那有沒(méi)有獲取鼠標(biāo)位置的方法呢?答案當(dāng)然是有的。因此,我們引用到pyautogui模塊

pip install pyautogui

一、系統(tǒng)拖尾

第一種是最簡(jiǎn)單的一種,通過(guò)設(shè)置就可以輕松設(shè)置鼠標(biāo)拖尾,在這里就不詳解了。

二、文藝型拖尾

這個(gè)拖尾殺傷力不大,侮辱性極強(qiáng),給自己增加工作buff。

代碼如下:

import tkinter,time
from tkinter import *
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk["background"] = "white"
tk.wm_attributes('-transparentcolor', 'white')
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
​
cn = Canvas(tk, height=w, width=h, bg="white")
cn.pack()
def update_test(e):
    time.sleep(0.1)
    cn.delete(tkinter.ALL)
    tk.update()
    global a
    x,y=pyautogui.position()#獲取鼠標(biāo)位置
    tk.geometry("180x35+%s+%s" % (x+10, y+10))
    cn.create_text(85, 0, text='我的40米大刀')
tk.bind("<Configure>", update_test)
tk.mainloop()

三、實(shí)用型拖尾

這個(gè)拖尾,可以幫助你找到你容易忘記的東西,比如一些快捷鍵,一些工作的事,讓它隨鼠標(biāo)移動(dòng),隨時(shí)提醒你。

代碼如下:

import tkinter,time
from tkinter import *
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk["background"] = "white"
tk.wm_attributes('-transparentcolor', 'white')
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
​
cn = Canvas(tk, height=w, width=h, bg="white")
cn.pack()
def update_test(e):
    time.sleep(0.1)
    cn.delete(tkinter.ALL)
    tk.update()
    global a
    x,y=pyautogui.position()
    tk.geometry("180x35+%s+%s" % (x+10, y+10))
    cn.create_text(85, 0, text='ctrl+c 復(fù)制 \n ctrl+v 粘貼', anchor='n')
tk.bind("<Configure>", update_test)
tk.mainloop()

四、愛(ài)心拖尾

這個(gè)拖尾對(duì)于單身人士來(lái)說(shuō)傷害性極大,這滿滿的愛(ài)意,想要找一個(gè)人快點(diǎn)脫單。哈哈

import tkinter,time
from tkinter import *
from PIL import ImageTk, Image
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk["background"] = "white"
tk.wm_attributes('-transparentcolor', 'white')
​
image1 = Image.open("愛(ài)心.jpg")  # 打開(kāi)圖片
image = image1.resize((50,60))  # 設(shè)置圖片大小
photo = ImageTk.PhotoImage(image)  # 引入圖片
​
image2 = Image.open("愛(ài)心.jpg")
image3 = image2.resize((101, 121))  # 設(shè)置圖片大小
photo1 = ImageTk.PhotoImage(image3)  # 引入圖片
​
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
​
cn = Canvas(tk, height=w, width=h, bg="white")
cn.pack()
a=2
def update_test(e):
    time.sleep(0.1)
    cn.delete(tkinter.ALL)
    tk.update()
    global a
    x,y=pyautogui.position()
    tk.geometry("100x120+%s+%s" % (x+10, y+10))
    if a==2:
        cn.create_image(50, 50, image=photo1)
        cn.pack()
        a=1
    else:
        cn.create_image(50, 50, image=photo)
        cn.pack()
        a=2
tk.bind("<Configure>", update_test)
tk.mainloop()

五、奔跑的火柴人型拖尾

這個(gè)拖尾,可以將圖片替換為其他的動(dòng)作,甚至你還可以直接來(lái)上一部動(dòng)畫(huà)片都可以。

代碼如下:

import tkinter,time
from tkinter import *
from PIL import ImageTk, Image
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk.wm_attributes('-transparentcolor', '#E0D9BC')
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
cn = Canvas(tk, height=h, width=w, bg="white")  # bg="pink"
list,list1,a,b=[],[],1,1
for i in range(1,8):
    image1 = Image.open("正向火柴人/123_" + str(i) + ".PNG")  # 打開(kāi)圖片
    image = image1.resize((100, 100))  # 設(shè)置圖片大小
    photo = ImageTk.PhotoImage(image)  # 引入圖片
    list.append(photo)
    image1 = Image.open("反向火柴人/123_" + str(i) + ".PNG")  # 打開(kāi)圖片
    image = image1.resize((100, 100))  # 設(shè)置圖片大小
    photo = ImageTk.PhotoImage(image)  # 引入圖片
    list1.append(photo)
def image(list):
    global a
    for i in range(1, 8):
        if a == 7:
            a = 1
            cn.create_image(50, 50, image=list[0])
            a += 1
        else:
            cn.create_image(50, 50, image=list[a])
            a += 1
        break
​
def update_test(e):
    time.sleep(0.1)
    tk.update()
    x,y=pyautogui.position()
    tk.geometry("100x100+%s+%s"%(x+10,y+10))
    global b
    if x<b:image(list)
    elif x==b:pass
    else:image(list1)
    b=x
    cn.pack()
tk.bind("<Configure>", update_test)
tk.mainloop()

六、胡桃搖錢(qián)拖尾

這款拖尾與奔跑的火柴人相似,但又不完全相似,主要是針對(duì)單一動(dòng)畫(huà)制作??梢宰屇闩笥褳槟銛[一整套動(dòng)作,然后移動(dòng)鼠標(biāo)時(shí),你就可以看見(jiàn)你女朋友調(diào)皮的樣子了。

代碼如下:

import tkinter,time
from tkinter import *
from PIL import ImageTk, Image
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk.wm_attributes('-transparentcolor', '#F7FBFB')
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
cn = Canvas(tk, height=h, width=w, bg="#F7FBFB")
cn.pack()
list,a=[],1
for i in range(1,37):
    image1 = Image.open("胡桃搖錢(qián)/胡桃搖錢(qián)_" + str(i) + ".JPG")  # 打開(kāi)圖片
    image = image1.resize((100, 100))  # 設(shè)置圖片大小
    photo = ImageTk.PhotoImage(image)  # 引入圖片
    list.append(photo)
​
def update_test(e):
    time.sleep(0.05)
    cn.delete(tkinter.ALL)
    tk.update()
    x,y=pyautogui.position()
    tk.geometry("100x100+%s+%s"%(x+10,y+10))
    global a
    cn.create_image(50, 50, image=list[a])
    a=a+1
    if a==36:a=1
tk.bind("<Configure>", update_test)
tk.mainloop()

七、女朋友或者老婆拖尾

這個(gè)就更強(qiáng)了,一定要給你老婆看一看,你要告訴她,你的拖尾都是她。直接占據(jù)了整個(gè)屏幕。

代碼如下:

import tkinter,time
from tkinter import *
from PIL import ImageTk, Image
import pyautogui
​
tk = tkinter.Tk()
tk.overrideredirect(True)
tk.wm_attributes('-transparentcolor', '#F7FBFB')
w = tk.winfo_screenwidth()  # 獲取屏幕寬
h = tk.winfo_screenheight()  # 獲取屏幕高
cn = Canvas(tk, height=h, width=w, bg="#F7FBFB")
cn.pack()
​
image1 = Image.open("老婆.png")  # 打開(kāi)圖片
image = image1.resize((200, 300))  # 設(shè)置圖片大小
photo = ImageTk.PhotoImage(image)  # 引入圖片
​
def update_test(e):
    time.sleep(0.05)
    tk.update()
    x,y=pyautogui.position()
    tk.geometry("200x300+%s+%s"%(x+10,y+10))
    cn.create_image(100, 150, image=photo)
tk.bind("<Configure>", update_test)
tk.mainloop()

如果鼠標(biāo)拖尾有段位,你屬于哪個(gè)段位

到此這篇關(guān)于使用python tkinter實(shí)現(xiàn)各種個(gè)樣的撩妹鼠標(biāo)拖尾效果的文章就介紹到這了,更多相關(guān)python tkinter鼠標(biāo)拖尾內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論