Créer un éditeur de texte en Python à laide de la bibliothèque GUI Tkinter en Python. Dans ce vidéo tutoriel, nous allons voir comment ajouter la commande Enregistrer sous au menu tkinter de notre éditeur de texte. Nous utilisonspour cela la méthode ask save as file name du module filedialog. Nous utilisons un dictionnaire Python pour sauvegarder le fichier enregistré. Nous ouvrons ensuite le fichier en mode write w pour écraser le contenu existant et dans le but de le remplacer le contenu du fichier par le nouveau contenu. Nous récupérons ensuite le contenu du widget Text Tkinter par la méthod get et nous l'enregisrons sur le fichier via la méthode write, nous fermons ensuite le fichier via la méthode close. Ce tutoriel vidéo .a été crée avec la version de Python 3 Windows 7 et testé sur Python 3 Windows 8 et python 3 windows10. Pour un bon visionnage de qualité optimale, il est souhaitable d'utiliser le navigateur Google Chrome.
Create a text editor in Python using the Tkinter GUI library in Python. In this tutorial video, we will see how to add the Save As command to the tkinter menu of our text editor. For this, we use the ask save as file name method of the filedialog module. We use a Python dictionary to save the saved file. We then open the file in write w mode to overwrite the existing content and in order to replace the content of the file with the new content. We then retrieve the contents of the Text Tkinter widget by the get method and we save it to the file via the write method, we then close the file via the close method. This video tutorial was created with version of Python 3 Windows 7 and tested on Python 3 Windows 8 and python 3 windows 10. For a good viewing of optimal quality, it is advisable to use the Google Chrome browser.