Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
中缀运算符将子流程输出管道化到python函数_Python_Xonsh - Fatal编程技术网

中缀运算符将子流程输出管道化到python函数

中缀运算符将子流程输出管道化到python函数,python,xonsh,Python,Xonsh,xonsh可以将子流程输出到python函数吗 int($(ls|wc -l)) > 20 作为 我可以接近 from toolz import pipe pipe($(ls |wc -l),int) > 20 这是寻找方法来港 # bash [ $(ls |wc -l ) -gt 20 ] && echo busy dir # xonsh test @$(ls |wc -l) '-gt' 20 and echo busy dir # xonsh with mo

xonsh可以将子流程输出到python函数吗

int($(ls|wc -l)) > 20
作为

我可以接近

from toolz import pipe
pipe($(ls |wc -l),int) > 20
这是寻找方法来港

# bash
[ $(ls |wc -l ) -gt 20 ] && echo busy dir
# xonsh
test @$(ls |wc -l)  '-gt' 20 and echo busy dir
# xonsh with more python 
len(`[^.].*`) > 20 and echo busy dir

但一般来说,我希望有一个中缀操作员,一个la的前向管道
%>%
|>

,这是xonsh的一个公开问题:
# bash
[ $(ls |wc -l ) -gt 20 ] && echo busy dir
# xonsh
test @$(ls |wc -l)  '-gt' 20 and echo busy dir
# xonsh with more python 
len(`[^.].*`) > 20 and echo busy dir