zoukankan      html  css  js  c++  java
  • 有趣的pyfiglet

    figlet 是一个文字工具,

    在python中的直接 pip install pyfiglet 就可以了。

    from pyfiglet import Figlet
    fonts = ["xtty","xttyb","yie_ar_k","yie-ar__","zig_zag_","zone7___","z-pilot_","3-d","3x5","4x4_offr","5lineoblique","5x7","5x8","6x9","6x10","64f1____","1943____","a_zooloo","acrobatic","advenger","alligator","alligator2","alphabet","aquaplan","arrows","asc_____","ascii___","assalt_m","asslt__m","atc_____","atc_gran","avatar","b_m__200","banner","banner3","banner3-D","banner4","barbwire","basic","battle_s","battlesh","baz__bil","beer_pub","bell","big","bigchief","binary","block","brite","briteb","britebi","britei","broadway","bubble","bubble__","bubble_b","bulbhead","c_ascii_","c_consen","c1______","c2______","calgphy2","caligraphy","catwalk","caus_in_","char1___","char2___","char3___","char4___","charact1","charact2","charact3","charact4","charact5","charact6","characte","charset_","chartr","chartri","chunky","clb6x10","clb8x8","clb8x10","cli8x8","clr4x6","clr5x6","clr5x8","clr5x10","clr6x6","clr6x8","clr6x10","clr7x8","clr7x10","clr8x8","clr8x10","coil_cop","coinstak","colossal","com_sen_","computer","contessa","contrast","convoy__","cosmic","cosmike","cour","courb","courbi","couri","crawford","cricket","cursive","cyberlarge","cybermedium","cybersmall","d_dragon","dcs_bfmo","decimal","deep_str","defleppard","demo_1__","demo_2__","demo_m__","devilish","diamond","digital","doh","doom","dotmatrix","double","drpepper","druid___","dwhistled","e__fist_","ebbs_1__","ebbs_2__","eca_____","eftichess","eftifont","eftipiti","eftirobot","eftitalic","eftiwall","eftiwater","epic","etcrvs__","f15_____","faces_of","fair_mea","fairligh","fantasy_","fbr_stri","fbr_tilt","fbr1____","fbr2____","fbr12___","fender","finalass","fireing_","flyn_sh","fourtops","fp1_____","fp2_____","fraktur","funky_dr","future_1","future_2","future_3","future_4","future_5","future_6","future_7","future_8","fuzzy","gauntlet","ghost_bo","goofy","gothic","gothic__","graceful","gradient","graffiti","grand_pr","greek","green_be","hades___","heavy_me","helv","helvb","helvbi","helvi","heroboti","hex","high_noo","hills___","hollywood","home_pak","house_of","hypa_bal","hyper___","inc_raw_","invita","isometric1","isometric2","isometric3","isometric4","italic","italics_","ivrit","jazmine","jerusalem","joust___","katakana","kban","kgames_i","kik_star","krak_out","larry3d","lazy_jon","lcd","lean","letter_w","letters","letterw3","lexible_","linux","lockergnome","lower.flc","mad_nurs","madrid","magic_ma","marquee","master_o","maxfour","mayhem_d","mcg_____","mig_ally","mike","mini","mirror","mnemonic","modern__","morse","moscow","mshebrew210","nancyj","nancyj-fancy","nancyj-underlined","new_asci","nfi1____","nipples","notie_ca","npn_____","ntgreek","null.flc","nvscript","o8","octal","odel_lak","ogre","ok_beer_","os2","outrun__","p_s_h_m_","p_skateb","pacos_pe","panther_","pawn_ins","pawp","peaks","pebbles","pepper","phonix__","platoon_","platoon2","pod_____","poison","puffy","pyramid","r2-d2___","rad_____","rad_phan","radical_","rainbow_","rally_s2","rally_sp","rampage_","rastan__","raw_recu","rci_____","rectangles","relief","relief2","rev","ripper!_","road_rai","rockbox_","rok_____","roman","roman___","rot13.flc","rot13","rounded","rowancap","rozzo","runic","runyc","sans","sansb","sansbi","sansi","sblood","sbook","sbookb","sbookbi","sbooki","script","script__","serifcap","shadow","shimrod","short","skate_ro","skateord","skateroc","sketch_s","slant","slide","slscript","sm______","small","smisome1","smkeyboard","smscript","smshadow","smslant","smtengwar","space_op","spc_demo","speed","stacey","stampatello","standard","star_war","starwars","stealth_","stellar","stencil1","stencil2","stop","straight","street_s","subteran","super_te","t__of_ap","tanja","tav1____","taxi____","tec_7000","tec1____","tecrvs__","tengwar","term","thick","thin","threepoint","ti_pan__","ticks","ticksslant","tiles","times","timesofl","tinker-toy","tomahawk","tombstone","top_duck","trashman","trek","triad_st","ts1_____","tsalagi","tsm_____","tsn_base","tty","ttyb","tubular","twin_cob","twopoint","type_set","ucf_fan_","ugalympi","unarmed_","univers","upper.flc","usa_____","usa_pq__","usaflag","utopia","utopiab","utopiabi","utopiai","vortron_","war_of_w","wavy","weird","whimsy","xbrite","xbriteb","xbritebi","xbritei","xchartr","xchartri","xcour","xcourb","xcourbi","xcouri","xhelv","xhelvb","xhelvbi","xhelvi","xsans","xsansb","xsansbi","xsansi","xsbook","xsbookb","xsbookbi","xsbooki","xtimes"]
    
    with open('fontType.txt','w',encoding='utf-8') as w:
        for font in fonts:
            try:
                f = Figlet(font=font)
                text = f.renderText('python')
                print(text)
                w.write(f'{font:}
    {text}
    ')
            except Exception as e:
                print(e)

    简单来说,就是可以让你print 打印出的字体看起来很不一样,贴几个样子:

    xtty
                                  
                   #              
               #   #              
    # #  #  # #### # #   ##  # #  
    ## # #  #  #   ## # #  # ## # 
    #  # #  #  #   #  # #  # #  # 
    #  #  ##   #   #  # #  # #  # 
    #  #  ##   #   #  # #  # #  # 
    ###   #     ## #  #  ##  #  # 
    #    #                        
    #    #                        
    
    xttyb
                                        
                      ##                
                 ##   ##                
    # ##  ##  # ##### ## #   ###  # ##  
    ## ## ##  #  ##   ##### ## ## ## ## 
    ## ## ## ##  ##   ## ## ## ## ## ## 
    ## ##  # #   ##   ## ## ## ## ## ## 
    ## ##  ###   ##   ## ## ## ## ## ## 
    ####    ##    ### ## ##  ###  ## ## 
    ##      #                           
    ##     ##                           
    
    yie_ar_k
        # # # #           
       #####  #           
       ###### #           
       # # ## #           
       # # #  #           
       # # #  #           
        ## #  #           
        # # # #           
    
    yie-ar__
        # # # #           
       #####  #           
       ###### #           
       # # ## #           
       # # #  #           
       # # #  #           
        ## #  #           
        # # # #           
    
    zig_zag_
             ########  ### # # # # ###  # #     ##### #  
           # # # # ## # ## ##  # ###  # # # #   #######  
      # ###  # # # ## # ###  # #### #   # # #    # ##### 
    #####  #  ## # ##   #  ##  ####     ##### #  # # # # 
    ###  ##  #  ## ##      #   ###       # ##### # # # # 
       ## ## ## ## ##          #                         
         ### ###  ###                                    
          ## # ## ###                                    
    
    zone7___
    ##                       ## ##     
    ##           #           ## ##     
    ##            #          ## ##     
    ####  #                  ## ##     
    ####  #              ### ## ##     
    ##                  #### ## ##     
    ##                  ##   ## ##     
    ##                  ##   ## ##     
    
    z-pilot_
    ######## ## ######## ## ##### ## #  ##  # #  ## 
    ######## ## ######## ######## ## #  ## ## #  ## 
    ######## #  ########  # # # #  # #  ##  # #   # 
    ######## #  ######## ## # # #  #    ##  # #   # 
    ######## ## ######## ## #           ##    #     
    ######## ## ######## ## #         ####    #     
    ######## #  # ###### ## #     ######## ## #  ## 
    ######## #  # ###### ## #     ######## ## #  ## 
    
    3-d
                        **   **                       
     ******   **   **  /**  /**                       
    /**///** //** **  ******/**       ******  ******* 
    /**  /**  //***  ///**/ /******  **////**//**///**
    /******    /**     /**  /**///**/**   /** /**  /**
    /**///     **      /**  /**  /**/**   /** /**  /**
    /**       **       //** /**  /**//******  ***  /**
    //       //         //  //   //  //////  ///   // 
    
    3x5
                            
             #  #           
    ### # # ### ### ### ##  
    # # ###  #  # # # # # # 
    ###   #  ## # # ### # # 
    #   ###                 
    
    4x4_offr
    ######## ## ## ## ########  ## 
    ######## ## ## ## ######## ### 
          ## ## ## ## ##      ###  
          ## ## ## ## ##     ###   
          ## ## ## ## ##    ###    
          ## ## ## ## ##   ###     
          ## ## ## ## ##  ###      
          ## ## ## ## ##  ##       
    
    5lineoblique
                                                          
                                                          
                                                          
        ___             __  ___ / __      ___       __    
      //   ) ) //   / /  / /   //   ) ) //   ) ) //   ) ) 
     //___/ / ((___/ /  / /   //   / / //   / / //   / /  
    //            / /  / /   //   / / ((___/ / //   / /   
    
    5x7
                 #    #                 
                 #    #                 
    ###   #  #  ###   ###    ##   ###   
    #  #  #  #   #    #  #  #  #  #  #  
    #  #   # #   #    #  #  #  #  #  #  
    ###     #     ##  #  #   ##   #  #  
    #      #                            
    
    5x8
                   #           #        
                 # #          # #   ##  
                  #    ##     #    #### 
      ##    ##         #     ###   #    
     #  #  #  #         #     #     ##  
      ###  #  #  #            #         
        #   ##   #                      
      ##         #  #                   
    
    6x9
                    #     #                   
                    #     #                   
                   ###    #                   
     ###    #  #    #     # #     ##    ###   
     #  #   #  #    # #   ## #   #  #   #  #  
     #  #   ## #    # #   #  #   #  #   #  #  
     ###      ##     #    #  #    ##    #  #  
     #      #  #                              
     #       ##                               
    
    6x10
                                              
                    #     #                   
                    #     #                   
     # ##   #   #  ####   # ##    ###   # ##  
     ##  #  #   #   #     ##  #  #   #  ##  # 
     ##  #  #  ##   #     #   #  #   #  #   # 
     # ##    ## #   #  #  #   #  #   #  #   # 
     #          #    ##   #   #   ###   #   # 
     #      #   #                             
     #       ###                              
    
    64f1____
    #  #  ## ###     ### ## # #      ## #      #   # # 
       #  #   # #   # ## ###  ###### ###            #  
    #  # ##  ### #  # # #   ###  ###  #  ####    ##### 
     ### ##     #   # ####      #### # ##         #  # 
      #        #### ###  ###  ##   # ###      ### ##   
        # ## # ###  #  ##  #  ## ##   # #     ##     # 
    ##   #    #        #   #  ## ### ###  ### ## # #   
     #  #  # ###  ###  #   #  ##       # ##   ##   #   
    
    1943____
    ### # # ### # # ### # #         ### # # ### # #  
    ### # # ### # # ### # #         ### # # ### # #  
    ### # # ### # # ### # #         ### # # ### # #  
    ### # # ### # # ### # #  #####  ### # # ### # #  
    ### # # ### # # ### # #  ##  ## ### # # ### # #  
    ### # # ### # # ### # #  ##  ## ### # # ### # #  
    ### # # ### # # ### # #  #####  ### # # ### # #  
    ### # # ### # # ### # #  ##  ## ### # # ### # #  
    
    a_zooloo
     ## ##  ###      ##### #####   ##   ##  #####   
     ## ##  ###      ##### #####   ##   ##  #####   
    ### ### ### ### ####### #####  ### ### #######  
    ### ### ### ### ####### #####  ### ### #######  
    ### ### #######    ###  ## ### ####### ###      
    ### ### #######    ###  ## ### ####### ###      
    #######  #####     ##   ##  ##  ###### ##  ###  
    #######  #####     ##   ##  ##  ###### ##  ###  
    
    acrobatic
                             o       o                                 
                            <|>     <|>                                
                            < >     / >                                
     o_ __o     o      o    |      o__ __o      o__ __o    o__ __o  
      |    v   <|>    <|>   o__/_   |     v    /v     v    |     |> 
     /     <  < >    < >   |      /      <  />       <  /    /  
     o/     /   o    o/    |      o/     o/           /  o/   o/ 
      |     o     v  /v     o       |     <|    o       o    |     |  
     /  __/>      </>      <\__   /     /    <\__ __/>   /    /  
     o/            /                                                  
      |            o                                                   
     /         __/>                                         

    感兴趣的可以自行运行上面的代码获得所有的字体的文件。

    不论你在什么时候开始,重要的是开始之后就不要停止。 不论你在什么时候结束,重要的是结束之后就不要悔恨。
  • 相关阅读:
    实习第一天
    使用epublib解析epub文件(章节内容、书籍菜单)
    jdk1.8以前不建议使用其自带的Base64来加解密
    java学习-AES加解密之AES-128-CBC算法
    java学习-sha1散列算法
    日、周、月活跃用户数,用户流失率
    java学习-java.lang.Math随机数生成
    AndroidStudio报错Software caused connection abort: recv failed
    java学习-java.lang一Number类
    jdk内置类javax.imageio.ImageIO支持的图片处理格式
  • 原文地址:https://www.cnblogs.com/yunhgu/p/13731365.html
Copyright © 2011-2022 走看看