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
| #!/usr/bin/env python
import sys, re, string
from Tkinter import *
from ScrolledText import ScrolledText
class Cadre_gauche():
def __init__(self):
frame1 = Frame(root, bg="green", width=300, height=300, padx=10, pady=10)
frame1.pack(side=RIGHT,fill=Y)
self.choix1 = Radiobutton(frame1, text='Dos vers Unix', variable=texte, value='Dos vers Unix',command=self.selection)
self.choix2 = Radiobutton(frame1, text='Unix vers Dos', variable=texte, value='Unix vers Dos',command=self.selection)
self.choix1.pack()
self.choix2.pack()
self.btnchoixrep = Button(frame1, text='Ouvrir', command = self.choixrep) # boutton choix path
self.btnchoixrep.pack()
def selection(self):
global choix
choix = texte.get()
def choixrep(self):
global Rep_courant
Rep_courant = tkFileDialog.askdirectory(initialdir="/",title='Choisissez un repertoire')
print Rep_courant
Affiche_chemin.set(Rep_courant)
class Cadre_droite():
def __init__(self):
framedroite = Frame(root, bg="white", width=300, height=300, padx=10, pady=10)
framedroite.pack(side=LEFT,fill=Y)
self.txt=Text(framedroite,fg="green",bg="black",width=20,height=50)
self.txt.pack()
self.zone_text("toto")
def zone_text(self,msg):
self.txt.insert(END,msg)
class Application:
def __init__(self):
root.title('Py Dos < == > Unix converter')
def Go(self):
self.cadre_gauche = Cadre_gauche()
self.cadre_droite = Cadre_droite()
root.mainloop()
root = Tk()
if __name__ == '__main__':
app = Application()
app.Go() |
Partager