win32api pas python 3.10.2 essais startfile
Liste des Groupes
Revenir à fcl python
Sujet :
win32api pas python 3.10.2 essais startfile
De :
nospam_jackymichaud3 (at) *nospam* orange.fr.invalid (kirob17)
Groupes :
fr.comp.lang.python
Date :
26. Feb 2022, 17:04:28
Autres entêtes
Organisation :
!No_Organization!
Message-ID :
<2v-dnVwhge4R0of_nZ2dnUU7_8zNnZ2d@giganews.com>
Bonjour,
je joint mon script :
--------------------------
# -*- coding : utf-8 -*-
# Python 3.10.2
from tkinter import *
from os import startfile
from tkinter import filedialog
import tkinter as tk
root = Tk()
root.title('Imprimer des copies papier')
root.geometry("350x150")
def print_file():
file_to_print = filedialog.askopenfilename(
initialdir="/", title="Select file",
filetypes=(("Text files", "*.txt"), ("all files", "*.*")))
if file_to_print:
startfile.ShellExecute(0, "print", file_to_print, None, ".", 0)
Button(root, text="Imprimer le fichier", command=print_file).pack()
button = tk.Button(text = "Click et Quitter", command = root.quit)
button.pack(side=BOTTOM)
root.mainloop()
----------------------------
pouvez-vous m'aider a résoudre mon problème.
merci d'avance
cordialement
kyrob17
Date
Sujet
#
Auteur
26 Feb 22
win32api pas python 3.10.2 essais startfile
3
kirob17
26 Feb 22
Re: win32api pas python 3.10.2 essais startfile
1
Olivier Miakinen
27 Feb 22
Re: win32api pas python 3.10.2 essais startfile
1
kirob17
Haut de la page
Les messages affichés proviennent d'
usenet
.
NewsPortal