GithubHelp home page GithubHelp logo

tyanyuy3125 / portal_stillalive_python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from errorer/portal_stillalive_python

0.0 0.0 0.0 4.31 MB

A demo of the credit song 'Still Alive' of Portal 1 written in Python, running in 80x24 text terminal

Python 100.00%

portal_stillalive_python's Introduction

在终端上演示《传送门》片尾曲效果的 Python 脚本程序。

使用条件

still_alive_credit.py 脚本使用 Python 3,以下提到的 pip 多数情况下对应 pip3 命令 以调用 Python 3 的 pip 组件。

Windows 下需要使用 Windows terminal,MinTTY 等支持 ANSI 终端转义序列的终端模拟器。

为了播放音乐,需要用 pip 安装 playsoundplayground 在 Linux 下依赖 python-gobject 软件包(Ubuntu 已默认安装)。在 MacOS 下还需要用 pip 安装 PyObjC

使用方法

在当前目录下执行:

python3 still_alive_credit.py

脚本会读取 TERMCOLUMNSLINES 环境变量来调整输出区域大小并决定是否启用终端颜色等 特性。如果希望在一台标准 VT100 终端上演示,应该运行:

TERM=vt100 python3 still_alive_credit.py

可以使用 --no-sound 参数不带音乐进行演示,此时脚本只依赖 Python 标准库:

python3 still_alive_credit.py --no-sound

A demo of the credit song 'Still Alive' of Portal 1 written in Python, running in text terminal.

Dependency

still_alive_credit.py is written with Python 3. In most cases the following pip should be pip3 command.

In Windows system, you need a teminal emulator supporting ANSI escape sequences like Windows Terminal, MinTTY, Cmder or ConEmu。

For playing music, you need install playsound with pip. In Linux playsound depends on python-gobject (default installed in Ubuntu). In MacOS you also need to use pip to install PyObjC.

Usage

In current directory, execute:

python3 still_alive_credit.py

The script will read environment variable TERM, COLUMNS and LINES to determine the output area size and whether to enable features such as terminal color. If you want run it on a standard VT100 terminal, you should execute:

TERM=vt100 python3 still_alive_credit.py

It's able to use --no-sound option to run the script without playing sound. In this case, the script only depends on Python standard library:

python3 still_alive_credit.py --no-sound

Linux 运行效果 / Snapshot on Linux

演示视频 / demonstration video

https://www.bilibili.com/video/BV1cU4y1A7ud

portal_stillalive_python's People

Contributors

chirsz-ever avatar errorer avatar tyanyuy3125 avatar tizee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.