Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (True):
- # Check all Streamers #
- tStreamers = cs.CheckStreams(debug)
- tStreamers.start()
- tStreamers.join()
- # Connect to the database
- connect = pymysql.connect(host=constants.HOST,
- user=constants.USERNAME,
- password=constants.PASSWORD,
- db=constants.DATABASE,
- charset='utf8mb4',
- port=constants.PORT,
- cursorclass=pymysql.cursors.DictCursor)
- # Get Streamer Table #
- try:
- with connect.cursor() as cursor:
- # Read all Streamers #
- sql = "SELECT * FROM `ls_streamer` s LEFT JOIN `ls_platforms` p ON s.platform = p.id"
- # Execute Query #
- cursor.execute(sql)
- # Result to streamers Var #
- streamers = cursor.fetchall()
- # Check if we have Streamers at all #
- if cursor.rowcount > 0:
- # DO SOMETHING HERE
Add Comment
Please, Sign In to add comment