How to print 😁😛😋🤣emojis using python🐍 | by Keerti Prajapati

文章推薦指數: 80 %
投票人數:10人

Unicode; CLDR names; emoji module. Unicodes: To use Unicodes , we need to replace “+” with “000” from the list ... AboutUsDeepLearningMachineLearningDataVisualisationDataEngineeringWriteforUsHowtoprint😁😛😋🤣emojisusingpython🐍KeertiPrajapatiFollowJun17,2020·2minreadEveryonetodaydouseemojisinoneortheotherwaysonsocialmedia.Beingaprogrammer,haveyoueverthoughttowritecodethatwouldgiveemojisinoutput?Itwouldbereallyfunright!!!Youmightthinktherewillbebigalgorithmtoprintemojis😰🙄.Butletmetellyou ,itisnottrue,infactitisveryeasytowritecodeifyouunderstandtheemojiswell.Byunderstandingtheemojiswell,Imeantounderstandhowemojisrepresentedorstoreinmemory?Everythinginmemoryisstoreinbinaryformatsotheemojisare.Itisverydifficultforustoidentifyemojisinbinary format .Forthisproblemwehavevariousencodingmethods.MethodusedforencodingtheemojisisUnicode .EveryemojishavepredefinedencodedUnicodecharacter.So ,wejustneedtouseUnicodecharactersofemojis.ButitmaybedifficulttouseUnicodecharactersofemojis.Fortunately ,pythonhavemultiplewayusingwhichwecanprintemojis :UnicodeCLDRnamesemojimoduleUnicodes:TouseUnicodes ,weneedtoreplace“+”with“000”fromthelistofunicodes .Forexample :“U+1F600”willbecome“U0001F600”andprefixtheunicodewith“\”andprintit.CLDRnames:EmojishaveCLDRshortnameswhichcanalsobeused.Example:Inabovecode ,firstlineusedCLDRnamesandsecondlineusedUnicode.emojimodule:EmojiscanalsobeimplementedbyusingtheemojimoduleprovidedinPython.Toinstallitrunthefollowingintheterminal.pipinstallemojiemojize() functionrequirestheCLDRshortnametobepassedinitastheparameter.Itthenreturnsthecorrespondingemoji.ReplacethespaceswithunderscoreintheCLDRshortname.Example:UsefollowinglinktogetUnicodewithCLDRnamesofallemojis:https://unicode.org/emoji/charts/emoji-list.html🐍🐍😊😊🐍🐍😊😊🐍🐍AnalyticsVidhyaAnalyticsVidhyaisacommunityofAnalyticsandData…163Python3EmojiPythonProgrammingUnicodeModules163 claps163AnalyticsVidhyaAnalyticsVidhyaisacommunityofAnalyticsandDataScienceprofessionals.Wearebuildingthenext-gendatascienceecosystemhttps://www.analyticsvidhya.comWrittenbyKeertiPrajapatiFollowYetanotherPythonCoderAnalyticsVidhyaAnalyticsVidhyaisacommunityofAnalyticsandDataScienceprofessionals.Wearebuildingthenext-gendatascienceecosystemhttps://www.analyticsvidhya.comMoreFromMediumIoradAnalyticsprovideinsightsaboutyourlearners.LaurenTaylorinioradEmergenciesinDistributedSystemsGregoryPabianinLevelUpCodingITandDataCenterCostReductionCTMTechnologyGroupObservabilityascode,secretsasaservice,andchaoskatas:ThoughtWorksoutlineskeyengineering…RichardGallCentralizationanddecentralizationtoenhanceinfrastructureresilienceAlyshaHelmrichinInfrastructureintheAnthropoceneBeginnersguidetofacadesinlaravelDecodeWebFizzBuzzWendyRavenMcNairinGeekCultureCreateaSpecializedCustomerSelf-HelpWidgetExperienceLaurenTayloriniorad



請為這篇文章評分?