Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. import pyperclip
  2. dec_box = [[127.46659851074219, 697.761474609375, 592.3056030273438, 969.1796264648438], [145.38204956054688, 241.7072296142578, 552.0755615234375, 409.4161376953125], [709.1004638671875, 240.0570831298828, 1254.04150390625, 516.4016723632812], [1489.12451171875, 341.7560119628906, 2032.9217529296875, 631.8690185546875], [932.1668090820312, 742.7733764648438, 1454.72119140625, 1049.021484375]]
  3. num = ['three', 'one', 'five', 'zero', 'nine']
  4. ary2 = []
  5. for x in range(len(dec_box)):
  6. ary2.append(dec_box[x][1])
  7.  
  8. dict1 = {}
  9. for x in range(len(dec_box)):
  10. dict1[ary2[x]] = num[x]
  11.  
  12. ary2.sort()
  13. # print(ary2)
  14. dict2 = {}
  15. for x in range(len(dec_box)):
  16. dict2[dict1[ary2[x]]] = ary2[x]
  17. dict3 = []
  18. for x in dict2:
  19. if x == "one":
  20. dict3.append(1)
  21. elif x == "two":
  22. dict3.append(2)
  23. elif x == "three":
  24. dict3.append(3)
  25. elif x == "four":
  26. dict3.append(4)
  27. elif x == "five":
  28. dict3.append(5)
  29. elif x == "siz":
  30. dict3.append(6)
  31. elif x == "seven":
  32. dict3.append(7)
  33. elif x == "eight":
  34. dict3.append(8)
  35. elif x == "nine":
  36. dict3.append(9)
  37. elif x == "ten":
  38. dict3.append(10)
  39. strval = ""
  40. for x in dict3:
  41. strval = strval + str(x)
  42. print(strval)
  43. pyperclip.copy(strval)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement