Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3763
| Newsgroups | fr.comp.lang.python |
|---|---|
| Subject | win32api pas python 3.10.2 essais startfile |
| From | kirob17 <nospam_jackymichaud3@orange.fr.invalid> |
| Organization | !No_Organization! |
| Message-ID | <2v-dnVwhge4R0of_nZ2dnUU7_8zNnZ2d@giganews.com> (permalink) |
| Date | 2022-02-26 10:04 -0600 |
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
Back to fr.comp.lang.python | Previous | Next — Next in thread | Find similar
win32api pas python 3.10.2 essais startfile kirob17 <nospam_jackymichaud3@orange.fr.invalid> - 2022-02-26 10:04 -0600 Re: win32api pas python 3.10.2 essais startfile Olivier Miakinen <om+news@miakinen.net> - 2022-02-26 23:40 +0100 Re: win32api pas python 3.10.2 essais startfile kirob17 <nospam_jackymichaud3@orange.fr.invalid> - 2022-02-27 07:23 -0600
csiph-web