fork download
  1. #!/opt/csw/bin/python
  2. # -*- coding: latin1 -*-
  3.  
  4. import sys
  5.  
  6. # En entree, on peut mettre autant de numero de glyphes que l'on veut
  7. numArgs = len(sys.argv) - 1
  8. if numArgs < 1:
  9. print 'Usage: orientationEpaisseur numeros_Glyphe'
  10. sys.exit(1)
  11. else:
  12. numeros = sys.argv[1:]
  13.  
  14. effetDict = {}
  15. effetDict[1320] = ['ATT','ATT']
  16. effetDict[2344] = ['ATT','ESQ']
  17. effetDict[3368] = ['ATT','DEG']
  18. effetDict[4392] = ['ATT','ARM']
  19. effetDict[5416] = ['ATT','REG']
  20. effetDict[6440] = ['ATT','VUE']
  21. effetDict[7464] = ['ATT','PV']
  22. effetDict[8456] = ['ATT','TOUR']
  23. effetDict[9512] = ['ATT','Duree']
  24. effetDict[10536] = ['ATT','EffZone']
  25.  
  26. effetDict[11560] = ['ESQ','ATT']
  27. effetDict[12584] = ['ESQ','ESQ']
  28. effetDict[13608] = ['ESQ','DEG']
  29. effetDict[14632] = ['ESQ','ARM']
  30. effetDict[15656] = ['ESQ','REG']
  31. effetDict[16680] = ['ESQ','VUE']
  32. effetDict[17704] = ['ESQ','PV']
  33. effetDict[18728] = ['ESQ','TOUR']
  34. effetDict[19752] = ['ESQ','Duree']
  35. effetDict[20776] = ['ESQ','EffZone']
  36.  
  37. effetDict[21800] = ['DEG','ATT']
  38. effetDict[22824] = ['DEG','ESQ']
  39. effetDict[23848] = ['DEG','DEG']
  40. effetDict[24872] = ['DEG','ARM']
  41. effetDict[25896] = ['DEG','REG']
  42. effetDict[26920] = ['DEG','VUE']
  43. effetDict[27944] = ['DEG','PV']
  44. effetDict[28968] = ['DEG','TOUR']
  45. effetDict[29992] = ['DEG','Duree']
  46. effetDict[31016] = ['DEG','EffZone']
  47.  
  48. effetDict[32040] = ['ARM','ATT']
  49. effetDict[33064] = ['ARM','ESQ']
  50. effetDict[34088] = ['ARM','DEG']
  51. effetDict[35112] = ['ARM','ARM']
  52. effetDict[36136] = ['ARM','REG']
  53. effetDict[37160] = ['ARM','VUE']
  54. effetDict[38184] = ['ARM','PV']
  55. effetDict[39208] = ['ARM','TOUR']
  56. effetDict[40232] = ['ARM','Duree']
  57. effetDict[41256] = ['ARM','EffZone']
  58.  
  59. effetDict[42280] = ['REG','ATT']
  60. effetDict[43304] = ['REG','ESQ']
  61. effetDict[44328] = ['REG','DEG']
  62. effetDict[45352] = ['REG','ARM']
  63. effetDict[46376] = ['REG','REG']
  64. effetDict[47400] = ['REG','VUE']
  65. effetDict[48424] = ['REG','PV']
  66. effetDict[49448] = ['REG','TOUR']
  67. effetDict[50472] = ['REG','Duree']
  68. effetDict[51496] = ['REG','EffZone']
  69.  
  70. effetDict[52520] = ['VUE','ATT']
  71. effetDict[53544] = ['VUE','ESQ']
  72. effetDict[54568] = ['VUE','DEG']
  73. effetDict[55592] = ['VUE','ARM']
  74. effetDict[56616] = ['VUE','REG']
  75. effetDict[57640] = ['VUE','VUE']
  76. effetDict[58664] = ['VUE','PV']
  77. effetDict[59688] = ['VUE','TOUR']
  78. effetDict[60712] = ['VUE','Duree']
  79. effetDict[61736] = ['VUE','EffZone']
  80.  
  81. effetDict[62760] = ['PV','ATT']
  82. effetDict[63784] = ['PV','ESQ']
  83. effetDict[64808] = ['PV','DEG']
  84. effetDict[65832] = ['PV','ARM']
  85. effetDict[66856] = ['PV','REG']
  86. effetDict[67880] = ['PV','VUE']
  87. effetDict[68904] = ['PV','PV']
  88. effetDict[69928] = ['PV','TOUR']
  89. effetDict[70952] = ['PV','Duree']
  90. effetDict[71976] = ['PV','EffZone']
  91.  
  92. effetDict[73000] = ['TOUR','ATT']
  93. effetDict[74024] = ['TOUR','ESQ']
  94. effetDict[75048] = ['TOUR','DEG']
  95. effetDict[76072] = ['TOUR','ARM']
  96. effetDict[77096] = ['TOUR','REG']
  97. effetDict[78120] = ['TOUR','VUE']
  98. effetDict[79144] = ['TOUR','PV']
  99. effetDict[80168] = ['TOUR','TOUR']
  100. effetDict[81192] = ['TOUR','Duree']
  101. effetDict[82216] = ['TOUR','EffZone']
  102.  
  103. effetDict[83240] = ['Duree','ATT']
  104. effetDict[84264] = ['Duree','ESQ']
  105. effetDict[85288] = ['Duree','DEG']
  106. effetDict[86312] = ['Duree','ARM']
  107. effetDict[87336] = ['Duree','REG']
  108. effetDict[88360] = ['Duree','VUE']
  109. effetDict[89384] = ['Duree','PV']
  110. effetDict[90408] = ['Duree','TOUR']
  111. effetDict[91432] = ['Duree','Duree']
  112. effetDict[92456] = ['Duree','EffZone']
  113.  
  114. effetDict[93480] = ['EffZone','ATT']
  115. effetDict[94504] = ['EffZone','ESQ']
  116. effetDict[95528] = ['EffZone','DEG']
  117. effetDict[96552] = ['EffZone','ARM']
  118. effetDict[97576] = ['EffZone','REG']
  119. effetDict[98600] = ['EffZone','VUE']
  120. effetDict[99624] = ['EffZone','PV']
  121. effetDict[100648] = ['EffZone','TOUR']
  122. effetDict[101672] = ['EffZone','Duree']
  123. effetDict[102696] = ['EffZone','EffZone']
  124.  
  125. epaisseurDict = {}
  126. epaisseurDict[0] = 'T.gras'
  127. epaisseurDict[1] = 'Gras'
  128. epaisseurDict[2] = 'Moyen'
  129. epaisseurDict[3] = 'Fin'
  130. epaisseurDict[4] = 'T.fin'
  131. epaisseurDict[5] = 'T.fin'
  132. epaisseurDict[6] = 'T.fin'
  133.  
  134. orientationDict = {}
  135. orientationDict[0] = 'Initiale'
  136. orientationDict[1] = 'Sym. Hor.'
  137. orientationDict[2] = 'Sym. Vert.'
  138. orientationDict[3] = 'Sym. Cent.'
  139.  
  140. #Si le numero est impair, on utilise le numero pair le precedant
  141. for i in range(len(numeros)):
  142. numeros[i] = int(numeros[i] )
  143. if numeros[i]%2==1:
  144. numeros[i] -=1
  145.  
  146. numeroDeb = 1288
  147. intervalle = 1024
  148.  
  149. print
  150. print 'Numero Glyphe \tEpais.\tOrientation\tCaracterist.1\tCaracterist.2\tRepere Tableau'
  151.  
  152. # boucle sur les numeros donnes en entree
  153. for num in numeros:
  154. debFamille = int((num-numeroDeb)/intervalle)*intervalle+numeroDeb
  155. repereTableau = debFamille+32
  156. epaisseur = int((num-debFamille)/
  157. orientation = (num-debFamille)/2%4
  158.  
  159. strOut = 'Numero '+str(num) + '\t' + epaisseurDict[epaisseur] + '\t'+orientationDict[orientation]+ '\t'
  160.  
  161. if epaisseur == 0:
  162. if orientation==0 or orientation==1:
  163. strOut += effetDict[repereTableau][0] + ' Bonus\t---------\t'
  164. else:
  165. strOut += effetDict[repereTableau][0] + ' Malus\t---------\t'
  166. else:
  167. if orientation==0:
  168. strOut += effetDict[repereTableau][0] + ' Bonus\t' + effetDict[repereTableau][1] + ' Malus\t'
  169. if orientation==1:
  170. strOut += effetDict[repereTableau][0] + ' Bonus\t' + effetDict[repereTableau][1] + ' Bonus\t'
  171. if orientation==2:
  172. strOut += effetDict[repereTableau][0] + ' Malus\t' + effetDict[repereTableau][1] + ' Bonus\t'
  173. if orientation==3:
  174. strOut += effetDict[repereTableau][0] + ' Malus\t' + effetDict[repereTableau][1] + ' Malus\t'
  175.  
  176. strOut += str(repereTableau)
  177. print strOut
  178. print '\n'
Runtime error #stdin #stdout 0.08s 8832KB
stdin
63832
stdout
Standard output is empty