Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. yui = xi
  2. data2 = open("data/DP/" + author.id + ".txt", "r")
  3. dpr = data2.read()
  4. data2.close()
  5. data3 = open("data/DCK/" + deck + "/price.txt","r")
  6. dpreco = data3.read()
  7. data3.close()
  8. dp = int(dpr)
  9. precoo = int(dpreco)
  10. type(dp)
  11. preco = precoo * yui
  12. if dp >= preco:
  13. dp = dp - preco
  14. dpr = str (dp)
  15. type(dpr)
  16. data = open ("data/DCK/" + deck + "/cards.txt", "r")
  17. lista = data.readlines()
  18. data.close()
  19. data5 = open("data/DP/" + author.id + ".txt", "w")
  20. data5.write(dpr)
  21. data5.close()
  22. again = 0
  23. aba = 0
  24. lista2 = []
  25. lista3 = []
  26. while again <= yui:
  27. while aba < 5:
  28. slct = random.choice(lista)
  29. lista2.append(slct)
  30. lista3.append(slct)
  31. if aba < 5:
  32. aba += 1
  33. if aba == 5:
  34. lista2.append("----------------n")
  35. again += 1
  36. aba = 0
  37. if yui == again:
  38. break
  39. if again == yui:
  40. data4 = open("data/CT/" + author.id + ".txt", "w")
  41. data4.writelines(lista2)
  42. data4.close()
  43. data6 = open("data/Listct/" + author.id + ".txt", "a")
  44. data6.writelines(lista3)
  45. data6.close()
  46. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement