Advertisement
jcgru

SkycadeImportPlayerCountData

Jul 9th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. from mcstatus import MinecraftServer
  2. import datetime
  3. import random
  4. import matplotlib.pyplot as plt
  5. import time
  6.  
  7. time_array = []
  8. player_count_array = []
  9. def main():
  10.     with open('data.txt', 'r') as file:
  11.         for line in file:
  12.             line = file.readline()
  13.             data = line.strip().split(" ")
  14.             time = data[0]
  15.             count = data[1].replace("\n", "")
  16.             time_array.append(time)
  17.             player_count_array.append(count)
  18.     # plot
  19.     plt.plot(time_array, player_count_array)
  20.     plt.gcf().autofmt_xdate()
  21.     plt.show()
  22. if __name__ == '__main__':
  23.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement