国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

傻瓜讀書軟件升級(txt, word都可以)

2020-03-03 15:13 作者:一心想當(dāng)網(wǎng)紅的李老師  | 我要投稿

版本是python3.7

#! /usr/bin/env python

# -*- coding: utf-8 -*-

import importlib,sys

importlib.reload(sys)


import tkinter

from tkinter.filedialog import askopenfilename

from docx import Document

from docx.shared import Inches

import pyttsx3


l=[]

def openfilewd():

? ? file_path=askopenfilename()

? ? f=Document(file_path)

? ? for para in f.paragraphs:

? ? ? ? l.append(para.text)

? ? engine=pyttsx3.init()

? ? engine.say(str(l))

? ? engine.runAndWait()


def openfiletxt():

? ? file_path=askopenfilename()

? ? f=open(file_path,encoding='utf-8')

? ? fread=f.read()

? ? f=str(fread)

? ? engine=pyttsx3.init()

? ? engine.say(f)

? ? engine.runAndWait()


top=tkinter.Tk()

Button1=tkinter.Button(top, text ="選擇txt文件", command = openfiletxt)

Button2=tkinter.Button(top, text ="選擇word文件", command = openfilewd)

Button1.pack()

Button2.pack()

top.mainloop()


其實(shí)就是把兩個(gè)程序并在了一起。做了兩個(gè)選擇圖標(biāo)的界面。

后面可以在程序內(nèi)部分析文件的格式,然后選擇處理方式。

傻瓜讀書軟件升級(txt, word都可以)的評論 (共 條)

分享到微博請遵守國家法律
澄迈县| 安泽县| 合川市| 天镇县| 大悟县| 青田县| 探索| 马公市| 武城县| 海安县| 娱乐| 福海县| 互助| 桃园县| 横山县| 新丰县| 阿巴嘎旗| 乌兰察布市| 海安县| 潮州市| 沈阳市| 吕梁市| 云林县| 麻栗坡县| 开封市| 西安市| 新昌县| 当雄县| 灌南县| 揭东县| 德庆县| 黄大仙区| 托里县| 洛南县| 灵璧县| 思南县| 邯郸县| 天等县| 江西省| 阳朔县| 泸水县|