Bonjours j'ai un probleme car vu j'aimerai créer un bloc note qui quand on fait un saut a la ligne marque dans le fichiers \n et je ne c pas commen fair car dans mon code source j'ai carrement rajouter une fonction qui rajoute \n dans mon widget text met il et directement convertit en saut a la ligne alors aider moi svp

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# -*- coding: Latin-1 -*-
 
 
# **** DEVELOPED BY HUGUES (STUFFY-92)  [  FRENCH ]  **** #
 
 
# ###################################
#									          #
# Version : Betâ 1.0                                                                        #
# Auteur : H.Pascault 2008                                                           #
# Licence : GPL                                                                               #
#									          #
# ###################################
 
 
#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
 
# IMPORTATION DES BIBLIOTEQUES #
 
from Tkinter import*
import tkFont
import tkMessageBox
 
#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
 
# DEBUT DU SCRIPT PRINCIPAL #
 
 
 
def afficher():
	obFichier = open('Monfichier.txt','a')
	obFichier.write(str(txt.get(1.0, END)))
	obFichier.close()
 
def entree():
	txt.insert(END, "\n")
 
def About(): 
	tkMessageBox.showinfo("A propos", " Version : Alpha 1.0 \n Programmeur : Hugues (stuffy-92) \n Contact : stuffy-92@live.fr")
 
#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
 
 
# DEBUT DU SCRIPT VISUEL #
 
 
# ----- Création de la fenêtre ----- # 
 
fenetre=Tk()
fenetre.iconbitmap("Images\Icon.ico")
fenetre.title('TUTO')
fenetre.resizable(width=False, height=False)
 
 
# ----- Création d'une variable contenant une police d'écriture ----- # 
 
police=tkFont.Font(fenetre)
police.configure(size=10,family="calibri")
 
# ----- Création d'une variable contenant une image ----- # 
 
img1 = PhotoImage(file = "Images\Bouton.gif")
img3 = PhotoImage(file = "Images\Haut.gif")
img4 = PhotoImage(file = "Images\Bas.gif")
 
 
# ----- Mise en place du canvas 1 ----- #
 
canvas_1= Canvas(fenetre, width = 478, height = 45)
item = canvas_1.create_image(239, 25, image = img3)
canvas_1.grid(row=1, columnspan=3)
 
# ----- Mise en place du texte ----- #
 
txt=Text(fenetre, wrap=WORD)
txt.configure(width = 65, relief = FLAT, font = police, insertbackground = "grey")
txt.grid(row = 2, columnspan = 3, pady = 10)
 
txt.get(1.0, END)
 
bouton=Button(fenetre)
bouton.configure(command=afficher,font=police,bd=0,text="Editer")
bouton.grid(row=3, column=1, pady=10)
 
bouton2=Button(fenetre)
bout