My app is having some problems to display certain characters in windows cmd. For now, it doesn’t have an UI. I made it on Linux Mint 18 and it works fine there. Here are images:
How it’s supposed to show:
TSM Kripp Elder Scrolls: Legends Ranked Day! Giveaway At Midnight EDT! http://goo.gl/svjoeF #sponsored (✿:yin_yang:‿✿)(✿:yin_yang:‿
✿)
This is on windows:
This is after adding .encode(‘utf-8’) to that line, otherwise it crashes. Anyone can help me parse this correctly? Code follows:
def live(self):
"""Displays online followed channels"""
games = []
streams = []
fl = requests.get("https://api.twitch.tv/kraken/streams/followed?oauth_token="+self.oauth_rnd)
for i in range(len(fl.json()['streams'])):
if fl.json()['streams'][i]['game'] not in games:
games.append(fl.json()['streams'][i]['game'])
streams.append((fl.json()['streams'][i]['channel']['name'], fl.json()['streams'][i]['channel']['status'].encode('utf-8'), fl.json()['streams'][i]['game']))
games.sort()
print("\n{0:*^60}".format(""))
print("{0:*^60}".format("LIST OF ONLINE STREAMS"))
print("{0:*^60}".format(""))
for i in range(len(games)):
print(u"\n{0}{1}".format("*"*10, games[i]))
for c in range(len(streams)):
if streams[c][2] == games[i]:
print(streams[c][0], ":", streams[c][1])