日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

Python模拟黑客帝国影片中的终端动画脚本

發布時間:2024/8/1 python 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python模拟黑客帝国影片中的终端动画脚本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


前段時間小編在刷抖音的時候看到很多人用bat制作黑客帝國的數字雨,比如:

bat代碼

@echo off title 黑客帝國 setlocal ENABLEDELAYEDEXPANSION color 0a for /l %%i in (1,1,80) do ( set Down%%i=0 ) :loop for /l %%j in (1,1,80) do ( set /a Down%%j-=1 if !down%%j! LSS 0 ( set /a Arrow%%j=!random!%%4 set /a Down%%j=!random!%%15+10 ) if "!Arrow%%j!" == "1" ( set /a chr=!random!%%2 set /p=!chr!<nul ) else ( set /p= <nul ) ) goto loop goto :eof


那么如何用Python制作黑客帝國的代碼雨呢?

安裝

采用Python包管理工具pip安裝即可:

pip install git+https://github.com/will8211/unimatrix.git
運行

安裝好以后在終端運行下面命令即可:

unimatrix -n -s 96 -l o unimatrix -c blue -u ILovePython unimatrix -c yellow -l e

命令參數

---------------------------------------------------------------注:我這有個學習基地,里面有很多學習資料,感興趣的+Q群:895817687---------------------------------------------------------------USAGEunimatrix [-a] [-b] [-c COLOR] [-f] [-g COLOR] [-h] [-l CHARACTER_LIST] [-n][-o] [-s SPEED] [-u CUSTOM_CHARACTERS]OPTIONAL ARGUMENTS-a Asynchronous scroll. Lines will move at varied speeds.-b Use only bold characters-c COLOR One of: green (default), red, blue, white, yellow, cyan,magenta, black-f Enable "flashers," characters that continuously change.-g COLOR Background color (See -c). Defaults to keepingterminal's current background.-h Show this help message and exit-l CHARACTER_LIST Select character set(s) using a string over lettercodes (see CHARACTER SETS below.)-n Do not use bold characters (overrides -b)-o Disable on-screen status-s SPEED Integer up to 100. 0 uses a one-second delay beforerefreshing, 100 uses none. Use negative numbers foreven lower speeds. Default=85-t TIME Exit the process after TIME seconds-u CUSTOM_CHARACTERS Your own string of characters to display. Enclose insingle quotes ('') to escape special characters. Forexample: -u '#$('-w Single-wave mode: Does a single burst of green rain,exits. You can put in a .bashrc file to run when yourterminal launches. Works well with speed at 95.LONG ARGUMENTS-a --asynchronous-b --all-bold-c --color=COLOR-f --flashers-g --bg-color=COLOR-h --help-l --character-list=CHARACTER_LIST-s --speed=SPEED-n --no-bold-o --status-off-t --time-u --custom_characters=CUSTOM_CHARACTERS-w --single_waveCHARACTER SETSWhen using '-l' or '--character_list=' option, follow it with one or more ofthe following letters:a Lowercase alphabetA Uppercase alphabetc Lowercase Russian Cyrillic alphabetC Uppercase Russian Cyrillic alphabete A few common emoji ( ?????????????????????★ )g Lowercase Greek alphabetG Uppercase Greek alphabetk Japanese katakana (half-width)m Default 'Matrix' set, equal to 'knnssss'n Numbers 0-9o 'Old' style non-unicode set, like cmatrix. Equal to 'AaSn'p Klingon pIqaD (requires 'Horta' family font)*P Klingon pIqaD (requires 'Klingon-pIqaD' or 'Code2000' family font)*r Lowercase Roman numerals ( mcclllxxxxvvvvviiiiii )R Uppercase Roman numerals ( MCCLLLXXXXVVVVVIIIIII )s A subset of symbols actually used in the Matrix films ( -=*_+|:<>" )S All common keyboard symbols ( `-=~!z#$%^&*()_+[]{}|;':",./<>?" )u Custom characters selected using -u switchFor example: '-l naAS' or '--character_list=naAS' will give something similarto the output of the original cmatrix program in its default mode.'-l ACG' will use all the upper-case character sets. Use the sameletter multiple times to increase the frequency of the character set. Forexample, the default setting is equal to '-l knnssss'.* With most modern Linux terminals (gnome-terminal, konsole, lxterminal,xfce4-terminal, mate-terminal) simply having the font installed system-wideis enough. The terminal will fall back to it for the Klingon, meaning thatyou don't have to select it in your terminal settings. 'Horta' seems not towork in Konsole. Fonts may need to be set manually as fallbacks in.Xresources for older terminals, such as urxvt and xterm.KEYBOARD CONTROLSPACE, CTRL-c or q exit- or LEFT decrease speed by 1+ or RIGHT increase speed by 1[ or DOWN decrease speed by 10] or UP increase speed by 10a toggle asynchronous scrollingb cycle through bold character options(bold off-->bold on-->all bold)f toggle flashing characterso toggle on-screen status1 to 9 set color: (1) Green (2) Red (3) Blue (4) White(5) Yellow (6) Cyan (7) Magenta (8) Black(9) Terminal default! to ( set background color (same colors as above, but pressingshift + number)EXAMPLESMimic default output of cmatrix (no unicode characters, works in TTY):$ unimatrix -n -s 96 -l oUse the letters from the name of your favorite operating system in bold blue:$ unimatrix -B -u Linux -c blueUse default character set, plus dollar symbol (note single quotes aroundspecial character):$ unimatrix -l knnssssu -u '$'No bold characters, slowly, using emojis, numbers and a few symbols:$ unimatrix -n -l ens -s 50

總結

以上是生活随笔為你收集整理的Python模拟黑客帝国影片中的终端动画脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。