今天要推荐的项目就是 onelinerizer 目标就是要把任意的 Python 代码转换成一行。你可能会问为什么要这样干?作者是这样回答的: Oh dear God why?Yeah. I'm sorry. But on the other hand, why not? 这个项目最初的灵感是 Python Bee,最初源自 MIT ,一个类似拼写游戏的比赛,但是 Python Bee 是写出解决具体...
出题人所说应该是使用onelinerizer进行加密的。 (lambda__operator, __print, __g, __contextlib, __y: [ (lambda__mod: [ [ [ (lambda__items, __after, __sentinel: __y(lambda__this:lambda: (lambda__i: [ (lambda__out: (lambda__ctx: [__ctx.__enter__(), __ctx.__exit__(None...
$ pip install onelinerizer Use either the command line function or the Python module: $echo"def f(x):\n print x\nf(4)">sandbox.py $ onelinerizer sandbox.py --debug $ onelinerizer sandbox_ol.py fromonelinerizerimportonelinerizeonelinerize("def f(x):\nprint x\nf(4)") ...
https:///csvoss/onelinerizer
我孩子的英文名叫andy,也许当初教他写程序的时候,如果先秀一下这行代码,可能就更能激起他对代码的兴趣了。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 >>>print'\n'.join([''.join([('AndyLove'[(x-y)%8]if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3<=0else...
http://www.onelinerizer.com/ 比如: AI检测代码解析 def f(x): return x * 4 y = f(5) print y 1. 2. 3. 4. 变成: AI检测代码解析 (lambda __print, __g: [[(__print(y), None)[1] for __g['y'] in [(f(5))]][0] for __g['f'], f.__name__ in [(lambda x: (...
Integrate with https://github.com/csvoss/onelinerizer to execute any python program Enable the use of 'exec' instead of 'eval' Shorter / more efficient encoding REMOVE THE NEED OF ' -- this is actually possible! We can globally replace ' with str(str)[(all([])+all([])+all([]...
我孩子的英文名叫andy,也许当初教他写程序的时候,如果先秀一下这行代码,可能就更能激起他对代码的兴趣了。 >>>print'\n'.join([''.join([('AndyLove'[(x-y)%8]if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3<=0else' ')forxin range(-30,30)])foryin range(15,-...
+One-lined Python是一个很有创意的项目,目的是将任意Python2脚本,转换成功能等价的单行形式(注释会被去除)。 +项目地址: + +- 官方网站:[One-lined Python (onelinerizer.com)](http://www.onelinerizer.com/) +- 开源项目:[GitHub - csvoss/onelinerizer](https://github.com/csvoss...
Source File: onelinerizer.py From onelinerizer with MIT License 6 votes def onelinerize(original): # original :: string # :: string t = ast.parse(original) table = symtable.symtable(original, '<string>', 'exec') original = original.strip() # If there's only one line anyways, be...