国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專(zhuān)欄INFORMATION COLUMN

Yet Another shell can run anywhere Python exists.

Jinkey / 3397人閱讀

PySh

Another shell can run anywhere Python exists.

Why another shell

Because it"s fun.

Supported shell feature

Common shell features can be found here. Pysh already have:

|, Pipe output

$var, Use value for variable

" ", double quote (allows variable and command expansion)

Usage
git clone https://github.com/jiacai2050/pysh.git
cd pysh
python -m pysh.shell

## Demo
> ls
.git
.gitignore
.pre-commit-config.yaml
assets
pysh
README.md

> echo $HOME
/Users/liujiacai

> echo ${JAVA_HOME}
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home

> pwd
/Users/liujiacai/codes/python/pysh

> cd ..
/Users/liujiacai/codes/python

> pwd
/Users/liujiacai/codes/python

> cat /etc/hosts | grep 127.0.0.1
127.0.0.1       localhost

> grep 127.0.0.1 /etc/hosts
127.0.0.1       localhost

Supported commands can be found here.

More commands are on the way. PR welcomed !

Have fun ?

How PySh work

A shell in unix box is a bridge bewteen user and the kernel through system call.

As we can see from above picture (taken from here), some commands (eg ls, cat) are passed to other programs, while built-in commands (eg cd, exit) are executed inside shell. This way can keep shell small in size and strong in function.

In order to let PySh run anywhere (hi, Windows, I mean you), PySh implmented all commands in its core, so there is no differences bewteen builtins and one that is not, also you can say all commands are builtins.

One thing I should mention here is:

Pipelines between different commands are supported by generator in Python.

So, every command should yield something, this is like s-expression in Lisp world, where every s-expression should return a value.

How to contribute

PySh use pre-commit to ensure code quality, so you should install it before contribute.

Fork and PR ?

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/38072.html

相關(guān)文章

  • 使用REACT VR構(gòu)建web虛擬現(xiàn)實(shí)

    Building virtual reality experiences on the web with React VR Over the past year, virtual reality has made major strides toward becoming the next computing platform. With Oculus Rift, consumer-grade h...

    anquan 評(píng)論0 收藏0
  • 剖析 Laravel 計(jì)劃任務(wù)--避免重復(fù)

    摘要:持有雞的人是唯一被允許談話的人。這樣可以確保人們互不說(shuō)話,也有自己的空間。所以當(dāng)作業(yè)第一次啟動(dòng)時(shí),創(chuàng)建一個(gè)互斥,然后每次作業(yè)運(yùn)行時(shí),它檢查互斥是否存在,只有在沒(méi)有工作的情況下運(yùn)行。 譯文GitHub https://github.com/yuansir/diving-laravel-zh 原文鏈接 https://divinglaravel.com/task-scheduling/pr...

    li21 評(píng)論0 收藏0
  • Embedding Python modules into C applications.

    In official Doc. of Python 3, there is a short introduction to embedding Python in another application like C/C++ (seeEmbedding Python in Another Application). The common procedure is as follows, w...

    youkede 評(píng)論0 收藏0
  • 線程的狀態(tài)

    摘要:運(yùn)行中,線程狀態(tài)中并沒(méi)有這一狀態(tài),但是實(shí)際執(zhí)行中是有的可運(yùn)行狀態(tài)的線程獲得了時(shí)間片,執(zhí)行程序代碼。其他阻塞運(yùn)行的線程發(fā)出了請(qǐng)求時(shí),會(huì)把該線程置為阻塞狀態(tài)。當(dāng)處理完畢時(shí),線程重新轉(zhuǎn)入可運(yùn)行狀態(tài)。 Thread.State 首先看JDK中的代碼: java.lang.Thread.State /** * A thread state. A thread can be i...

    zhou_you 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<