Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.lang.python > #3765

Re: win32api pas python 3.10.2 essais startfile

Newsgroups fr.comp.lang.python
Subject Re: win32api pas python 3.10.2 essais startfile
From kirob17 <nospam_jackymichaud3@orange.fr.invalid>
References <2v-dnVwhge4R0of_nZ2dnUU7_8zNnZ2d@giganews.com>
Organization !No_Organization!
Message-ID <44qdnZLtRtPI5ob_nZ2dnUU7_8zNnZ2d@giganews.com> (permalink)
Date 2022-02-27 07:23 -0600

Show all headers | View raw


Le samedi 26 Février 2022 à 17:04 par kirob17 :
> 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
bonjour, 
le problème se résulte a cette ligne :
 
("startfile.ShellExecute(0, "print", file_to_print, None, ".", 0) ")

tous le script se déroule bien choix des fichiers txt mais n'imprime pas.
je doit avouer que je me suis mis au python depuis deux mois.

je ne peut pas  installer win32api la version du python que j' est le 3.10.2
merci, cordialement
kyrob17

Back to fr.comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

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