Guest User

Untitled

a guest
Jun 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #Maynier Mathurin
  4. #px21-2
  5.  
  6. print 'DEBUT DE TEST'
  7.  
  8. from Tkinter import *
  9.  
  10. ail = 'bail corail émail fermail soupirail travail vantail vitrail'.split()
  11. al = 'final cheval journal canal'.split()
  12. au = 'landau sarrau'.split()
  13. eau = 'seau cadeau rideau beau oiseau corbeau'.split()
  14. eu = 'pneu bleu emeu'.split()
  15. ou = 'bijou hibou chou genou caillou pou ripou '.split()
  16. def pluriel(mot):
  17. if mot[-1] is 's' : return mot
  18. if mot == 'ail': return 'aulx'
  19. if mot in ail : return mot[:-2] + 'ux'
  20. if mot in al : return mot[:-1] + 'ux'
  21. if mot in ou : return mot + 'x'
  22. if mot[-1] is 'x' : return mot
  23. if mot[-1] is 'z' : return mot
  24. if mot in eau : return mot + 'x'
  25. if mot == 'oeil' : return 'yeux'
  26. if mot == 'ciel' : return 'cieux'
  27. return mot + 's'
  28.  
  29. def valeur(event) : val.configure(text=eval(express.get()))
  30.  
  31.  
  32. top = Tk()
  33.  
  34. express = Entry(top)
  35. express.bind("<Return>", valeur)
  36. express.pack()
  37.  
  38. val = Label(top)
  39. val.pack()
  40.  
  41. top.mainloop()
  42.  
  43. print 'FIN DE TEST'
Add Comment
Please, Sign In to add comment