How to use the emoji.UNICODE_EMOJI.copy function in emoji

To help you get started, we’ve selected a few emoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DarthKeizer / Pi-Hole-stats-tweeter / lib / debug.py View on Github external
from lib.speed_test import speedtest_ip
    ST_Stats = speedtest_ip()
    print(ST_Stats)
    
    print('\nThe tweets that where created.')
    import lib.construct_tweet as ct # where the tweet is put together
    # build tweet
    PHtweet = ct.PHtweet(P_Stats)
    SYtweet = ct.SYtweet(S_Stats)
    NETtweet =  ct.NETtweet(ST_Stats)
    tweet = '\n\n Tweet 1\n' + PHtweet + '\n\n Tweet 2\n' + SYtweet + '\n\n Tweet 3\n' + NETtweet + '\n'
    print(tweet)
    
    print('\nNumber of characters in tweet +/- 1 or 2') # will try and nail this down to a more accurate number
    num_emoji = (sum(tweet.count(emoji) for emoji in UNICODE_EMOJI)) # accurately count and track emoji
    ignored_chars = UNICODE_EMOJI.copy() # thanks to https://stackoverflow.com/q/56214183/11456464

    PHnum_other = sum(0 if char in ignored_chars else 1 for char in PHtweet)
    totalS = (num_emoji * 2 + PHnum_other)
    print(str(num_emoji) + '(<- individual emjoi * 2) + ' + str(PHnum_other) + '(<- # of characters that aren\'t emoji\'s) = ' +  str(totalS))

    SYnum_other = sum(0 if char in ignored_chars else 1 for char in SYtweet)
    totalS = (num_emoji * 2 + SYnum_other)
    print(str(num_emoji) + '(<- individual emjoi * 2) + ' + str(SYnum_other) + '(<- # of characters that aren\'t emoji\'s) = ' +  str(totalS))

    Netnum_other = sum(0 if char in ignored_chars else 1 for char in NETtweet)
    totalS = (num_emoji * 2 + Netnum_other)
    print(str(num_emoji) + '(<- individual emjoi * 2) + ' + str(Netnum_other) + '(<- # of characters that aren\'t emoji\'s) = ' +  str(totalS))
    return