前段时间小编在刷抖音的时候看到很多人用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模拟黑客帝国影片中的终端动画脚本相关推荐

  1. Unity3d中角色的动画脚本的编写

    感谢  wyb314 的分享 1.Unity3D中角色的动画脚本的编写(一) 2. Unity3D中角色的动画脚本的编写(二) 3.Unity3D中角色的动画脚本的编写(三)

  2. 直方图python高度_python – 子图中直方图的动画

    normed =直方图的True参数使直方图绘制分布的密度.从the documentation开始: normed : boolean, optional If True, the first el ...

  3. python编写脚本方法_使用Python编写提取日志中的中文的脚本的方法

    由于工作需要在一大堆日志里面提取相应的一些固定字符,如果单纯靠手工取提取,数据量大,劳心劳力,于是自然而然想到了用Python做一个对应的提取工具,代替手工提取的繁杂,涉及中文字符,正则表达式不好匹配 ...

  4. python模拟浏览器下载文件_python第一个脚本,模拟浏览器下载文件 | 学步园

    用wget命令下载文件总是失败.用python脚本模拟浏览器下载,代码如下: #!/usr/bin/python import sys from urllib import FancyURLopene ...

  5. python 模拟键盘输入:以钢琴模拟器脚本与模拟中文输入为例

    用到的库:keyboard,threading,time 代码: # 导入模块 import threading import time import keyboard 先写两个主要的函数出来: # ...

  6. python模拟浏览器下载文件_python第一个脚本,模拟浏览器下载文件

    用wget命令下载文件总是失败.用python脚本模拟浏览器下载,代码如下: #!/bin/python # -*- coding: utf-8 -*- __author__ = 'wulong' i ...

  7. python模拟ddos攻击_python版DDOS攻击脚本

    本文实例为大家分享了python版DDOS攻击脚本,供大家参考,具体内容如下 于是就找到了我之前收藏的一篇python的文章,是关于ddos攻击的一个脚本,正好今天有空,就实践下了. 附上源码pyDd ...

  8. 动画片中计算机技术的应用,三维动画技术在动画影片中的应用

    三维动画技术在动画影片中的应用 三维动画技术广泛应用于影视领域,尤其是在三维动画中,为影片设计增加了艺术感染力和视觉冲击力.下面一起来看看! 一.三维动画技术的发展背景 三维动画技术是近些年随着计算机 ...

  9. python终端指令大全_使用python模拟命令行终端的示例

    可以对?显示帮助信息,需要立即获取输入的字符,因此需要用到termios模块 另外需要对tab键做处理,当按下tab键时可以进行自动补全 #! /usr/bin/env python # coding ...

  10. python 模拟键盘 linux,在Linux中使用Python模拟键盘按键,linuxpython

    在Linux中使用Python模拟键盘按键,linuxpython 之前在做自动化测试中需要用Python在linux中模拟Ctrl+V 进行路径粘贴,试了很多种方法,起初用了xerox和pyperc ...

最新文章

  1. 【Codevs1322】单词矩阵
  2. gorm配置logger显示执行的sql
  3. 牛客 - 字典序(思维)
  4. 不愿意和别人打交道_最不愿与陌生人打交道的星座
  5. 指定开始_Flink-Kafka指定offset的五种方式
  6. 收录查询 php,google收录查询代码-PHP源码
  7. flashfxp3.41中文版注册码:(适合最新版本)
  8. 点阵字库怎样才能做到字符显示更紧凑?
  9. 硬盘格式化怎么操作 硬盘格式化后数据还在吗
  10. 阿里java开发一面 面试题及个人解析答案
  11. 程序是怎样跑起来的-读书文摘
  12. android+微信分享代码,Android 微信分享icon黑边代码解决
  13. 1亿个数中找出最大的100个数(top K问题)
  14. 自己动手打造winpe-只完成了引导的制作和文件夹的构件-仅仅为了学习!
  15. 飞机订票系统的模拟(C语言实现)
  16. 如何使用掘金进行量化策略效析
  17. android 播放固定频率的声音,Android使用SoundPool播放音效
  18. Magix发布Samplitude Pro X7
  19. Log4j SLF4J commom-logging 配置说明
  20. python语言基础与应用考试题_中国大学慕课mooc_Python语言基础与应用_章节测试答案...

热门文章

  1. Matlab实现熵权法并计算权重和综合评分——附增完整代码和测试用例
  2. 广数系统加工中心编程_CNC加工中心编程加工的一些小技巧,学会必有用
  3. Unity3d游戏开发用哪个语言更好?
  4. python实现sm3加密算法
  5. 解决看网课鼠标不能移开,视频不能加速
  6. 电子版证件照怎么制作并改大小
  7. 多实例学习PCNN在关系抽取中的应用
  8. 银行业如何搭建自服务的数据平台?
  9. 开放大学建筑构造计算机考试试题,国家开放大学电大专科《建筑构造》2021期末试题及答案(试卷号:2345)...
  10. c语言字符串不能是数字,C语言判断字符串是否为数字