I've been writing code for a little while but I'm a little slapdash. I'd like to get better so I've been having a glance at best practices, other peoples code and reading a whole lot. I'd appreciate it if you could read through my code and make some suggestions and explain why. You'll find some of my code below.I want to start writing more readable code, follow best practices and just be awesome. Suggested reading would also be appreciated.import requestsimport jsonimport winsoundimport timeimport sysUSERNAME = lirikFIRST_RUN = TrueVERSION_NO = 1.0def main():    print %s [+] Twitch Notifier %s started... % (time.strftime(%H:%M:%S), VERSION_NO)    print %s [+] Loading follows from %s % (time.strftime(%H:%M:%S), USERNAME)    try:        twitch_data = requests.get(https://api.twitch.tv/kraken/users/%s/follows/channels % USERNAME)    except:        print %s [+] Failed to contacted Twitch API % time.strftime(%H:%M:%S)        sys.exit(1)    user_info = json.loads(twitch_data.text)  # load user data json into user_info    users_online = list()  # initialise user_online list    while True:        for channel in user_info['follows']:  # Loop through channels in the users follow list            stream_name = channel['channel']['name']  # Add channel name to var stream_name for simplicity            try:                stream_data = requests.get(https://api.twitch.tv/kraken/streams/%s % stream_name)            except:                print stream_data.status_code                print stream_data.text                continue            try:                stream_info = json.loads(stream_data.text)            except ValueError, e:                print e                continue            if stream_info['stream']:                if stream_name not in users_online:                    print %s [+] Online: %s [%s][%s] % (time.strftime(%H:%M:%S),                                                          stream_name,                                                          stream_info['stream']['game'],                                                          stream_info['stream']['viewers'])                    users_online.append(stream_name)                    winsound.Beep(1000, 1000)            else:                if stream_name in users_online:                    print %s [+]Checking if %s is offline. % (time.strftime(%H:%M:%S),                                                                stream_name)                    if chk_user_online(stream_name) is False:  #Double check if user is offline. Sometimes the twitch API fucks up.                        print %s [-] Offline: %s % (time.strftime(%H:%M:%S),                                                      stream_name)                        users_online.remove(stream_name)                else:                    pass                    #print [*] No change in users online.        if len(users_online) < 1 and first_run:            first_run = False            print %s [*] There are currently no users online. % time.strftime(%H:%M:%S)        time.sleep(180)def chk_user_online(streamer):    try:        stream_data = requests.get(https://api.twitch.tv/kraken/streams/%s % streamer)        stream_info = json.loads(stream_data.text)    except:        print Stream check failed.        return Exception(Failed to access stream data)    if stream_info['stream'] is None:        return False    else:        return Trueif __name__ == __main__:    main()
Twitch client that notifies me when a followed streamer comes online
python;beginner;json;https