最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python生成可執(zhí)行exe控制Microsip自動填寫號碼并撥打功能

 更新時間:2021年06月21日 15:58:11   作者:我不喜歡這個世界  
這篇文章主要介紹了python生成可執(zhí)行exe控制Microsip自動填寫號碼并撥打,在這需要注意一個問題,必須是已經(jīng)運行Microsip.exe文件,具體實現(xiàn)代碼跟隨小編一起看看吧

控制的前提是已經(jīng)運行Microsip.exe

  

首先選擇文件,

選擇txt格式文件,一行一個手機號格式;如下

點擊撥打下一個,就會自動輸入自動撥打

代碼:

import tkinter
import win32gui
import win32con
from tkinter import filedialog
import tkinter.messagebox
import os
import time
def next_phone(phone):
    win = win32gui.FindWindow('MicroSIP',None)
    tid = win32gui.FindWindowEx(win,None,'#32770',None)
    tid = win32gui.FindWindowEx(tid,None,'ComboBox',None)
    tid = win32gui.FindWindowEx(tid,None,'Edit',None)
    win32gui.SendMessage(tid, win32con.WM_SETTEXT, None, phone)
    win32gui.PostMessage(tid,win32con.WM_KEYDOWN,win32con.VK_RETURN,0)
def openfile():
    sfname = filedialog.askopenfilename(title='選擇txt文件', filetypes=[ ('All Files', '*')])
    return sfname
class MicroSIP:
    def __init__(self):
        self.c_window()
 
    def c_window(self):
        self.win = tkinter.Tk()
        self.win.geometry("300x280")
        self.win.resizable(width=False, height=False)
        self.win.protocol('WM_DELETE_WINDOW', self.customized_function)
        self.total = 0
        self.used = 0
        self.res = []
        self.Button1 = tkinter.Button(self.win, text="選擇文件", command=self.helloCallBack)
        self.Button_next = tkinter.Button(self.win, text="撥打下一個", command=self.next)
        self.label1 = tkinter.Label(self.win, text="",)
        self.label2 = tkinter.Label(self.win, text="總量:", bg="yellow")
        self.label3 = tkinter.Label(self.win, text="撥打:", bg="red")
        self.label2_2 = tkinter.Label(self.win, text=self.total, )
        self.label3_3 = tkinter.Label(self.win, text=self.used, )
        # label4 = tkinter.Label(win, text="小豬佩奇", bg="green")
        self.Button1.grid(row=0, column=0)
        self.label1.grid(row=0, column=1)
        self.label2.grid(row=2, column=0)
        self.label2_2.grid(row=2, column=1)
        self.label3.grid(row=3, column=0)
        self.label3_3.grid(row=3, column=1)
        self.Button_next.grid(row=5, column=2)
        col_count, row_count = self.win.grid_size()
        for col in range(col_count):
            self.win.grid_columnconfigure(col, minsize=40)
        for row in range(row_count):
            self.win.grid_rowconfigure(row, minsize=40)
        self.win.mainloop()
    def next(self):
        if self.res:
            phone = self.res.pop()
 
            self.used+=1
            self.label3_3['text'] = self.used
            next_phone(phone.strip())
        else:
            res = tkinter.messagebox.showerror(title='文件!', message='選擇文件?。〔蝗淮螂u毛!')
    def helloCallBack(self):
        # print("Hello Python", "Hello Runoob")
        file_name = openfile()
        if file_name:
            print(file_name)
            self.label1['text']=file_name.split('/')[-1]
            with open(file_name, 'r', encoding='utf-8')as f:
                self.res = [x.replace('\n', '') for x in f.readlines()]
                self.total = len(self.res)
                self.label2_2['text']=str(len(self.res))
        else:
            res = tkinter.messagebox.showerror(title='文件!', message='選擇文件?。〔蝗淮螂u毛!')
    def customized_function(self):
 
        result = tkinter.messagebox.askyesno(title = '離開',message='確定要離開了嗎?如沒有打完,會把沒打完的生成新文件,下次選擇新文件就行了!')
        if result:
            if self.total==self.used:
                pass
            else:
                name = time.strftime("%Y_%m_%d_%H_%M_%S_", time.localtime())+"剩余_"+str(self.total-self.used)
                with open(name+'.txt','w',encoding='utf-8')as f:
                    for i in self.res:
                        f.write(i+'\n')
        self.win.destroy()
 
if __name__ == '__main__':
    MicroSIP()

寫的比較簡單,可以自己優(yōu)化一下,需要安裝pywin32庫

打包一下,就可以生成 exe文件  

需要安裝pyinstaller 庫

命令 pyinstaller -F -w xxx.py

我生成好的exe可供下載:

鏈接: https://pan.baidu.com/s/1IAx0pgr4ze2jYusisQBXIA

提取碼: a3s2

以上就是python生成可執(zhí)行exe控制Microsip自動填寫號碼并撥打的詳細(xì)內(nèi)容,更多關(guān)于python生成可執(zhí)行exe的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • Python實現(xiàn)爆破ZIP文件(支持純數(shù)字,數(shù)字+字母,密碼本)

    Python實現(xiàn)爆破ZIP文件(支持純數(shù)字,數(shù)字+字母,密碼本)

    這篇文章主要為大家分享了如何利用Python實現(xiàn)破解zip文件的密碼,能實現(xiàn)破解純數(shù)字、數(shù)字+字母、密碼本等種類的密碼,需要的可以參考一下
    2022-03-03
  • Python使用cx_Oracle模塊操作Oracle數(shù)據(jù)庫詳解

    Python使用cx_Oracle模塊操作Oracle數(shù)據(jù)庫詳解

    這篇文章主要介紹了Python使用cx_Oracle模塊操作Oracle數(shù)據(jù)庫,結(jié)合實例形式較為詳細(xì)的分析了cx_Oracle模塊的下載、安裝及針對Oracle數(shù)據(jù)庫的連接、執(zhí)行SQL語句、存儲過程等相關(guān)操作技巧,需要的朋友可以參考下
    2018-05-05
  • Anaconda超詳細(xì)保姆級安裝配置教程

    Anaconda超詳細(xì)保姆級安裝配置教程

    這篇文章主要介紹了Anaconda超詳細(xì)保姆級安裝配置教程,本篇教程對于新手很友好強烈推薦,看完這篇文章相信你對如何安裝配置Anaconda一定了然于胸,我們一起來看看吧
    2023-03-03
  • Python如何讀取MySQL數(shù)據(jù)庫表數(shù)據(jù)

    Python如何讀取MySQL數(shù)據(jù)庫表數(shù)據(jù)

    這篇文章主要為大家詳細(xì)介紹了Python如何讀取MySQL數(shù)據(jù)庫表數(shù)據(jù),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • 教你用Python創(chuàng)建微信聊天機器人

    教你用Python創(chuàng)建微信聊天機器人

    這篇文章主要手把手教你用Python創(chuàng)建微信聊天機器人,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-03-03
  • python關(guān)閉windows進(jìn)程的方法

    python關(guān)閉windows進(jìn)程的方法

    這篇文章主要介紹了python關(guān)閉windows進(jìn)程的方法,涉及Python調(diào)用系統(tǒng)命令操作windows進(jìn)程的技巧,需要的朋友可以參考下
    2015-04-04
  • python中的decorator的作用詳解

    python中的decorator的作用詳解

    這篇文章主要介紹了python中的decorator的作用詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-07-07
  • tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T

    tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU

    這篇文章主要介紹了tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T的相關(guān)知識,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-06-06
  • Python報錯NameError: name ‘secrets‘ is not defined解決

    Python報錯NameError: name ‘secrets‘ is not

    在使用Python進(jìn)行安全編程時,我們經(jīng)常需要使用secrets模塊來生成安全的隨機數(shù),但是卻遇到這個問題,本文主要介紹了Python報錯NameError: name ‘secrets‘ is not defined解決,感興趣的可以了解一下
    2024-06-06
  • Python類繼承及super()函數(shù)使用說明

    Python類繼承及super()函數(shù)使用說明

    這篇文章主要介紹了Python類繼承及super()函數(shù)使用說明,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-11-11

最新評論

卫辉市| 马关县| 城步| 汉寿县| 牙克石市| 阆中市| 盐边县| 晋城| 福安市| 池州市| 宜章县| 普兰县| 伊吾县| 同仁县| 大厂| 荃湾区| 运城市| 和硕县| 青海省| 拉孜县| 佛山市| 泰和县| 多伦县| 囊谦县| 马鞍山市| 西乌珠穆沁旗| 海丰县| 郯城县| 搜索| 连平县| 河津市| 新余市| 尤溪县| 会东县| 郯城县| 洪江市| 孝义市| 阜阳市| 高邑县| 武山县| 宜宾县|