V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
huntzhan
V2EX  ›  Python

做了一个从命令行调用 Python 函数的小玩具

  •  
  •   huntzhan ·
    huntzhan · 2020-05-28 18:25:15 +08:00 · 2678 次点击
    这是一个创建于 1422 天前的主题,其中的信息可能已经有所发展或是发生改变。

    更多用法见: https://github.com/huntzhan/fireball

    Basic usage:

    $ fireball os:getcwd
    /Users/huntzhan/Data/Project/personal/fireball
    
    $ fireball os.path:join 'foo' 'bar'
    foo/bar
    
    $ fireball base64:b64encode 'b"foo"'
    b'Zm9v
    

    Help doc:

    $ fireball base64:b64encode -- --help
    NAME
        b64encode - Encode the bytes-like object s using Base64 and return a bytes object.
    
    SYNOPSIS
        b64encode S <flags>
    
    DESCRIPTION
        Optional altchars should be a byte string of length 2 which specifies an
        alternative alphabet for the '+' and '/' characters.  This allows an
        application to e.g. generate url or filesystem safe Base64 strings.
    
    POSITIONAL ARGUMENTS
        S
    
    FLAGS
        --altchars=ALTCHARS
        --pdb_on_error=PDB_ON_ERROR
    
    NOTES
        You can also use flags syntax for POSITIONAL ARGUMENTS
    
    8 条回复    2020-05-29 11:58:44 +08:00
    loonghk
        1
    loonghk  
       2020-05-28 20:12:27 +08:00
    python 就是这点好,总有新轮子

    我之前用 fire 库,现在可以换你这个玩玩了
    xingheng
        2
    xingheng  
       2020-05-28 23:38:17 +08:00
    怎么解决第三方依赖的问题
    huntzhan
        3
    huntzhan  
    OP
       2020-05-28 23:39:11 +08:00
    @xingheng 具体是什么问题
    leishi1313
        4
    leishi1313  
       2020-05-28 23:53:12 +08:00 via Android
    @loonghk 点进去一看,就是用 fire 做的😂
    huntzhan
        5
    huntzhan  
    OP
       2020-05-28 23:54:36 +08:00
    @leishi1313 hhhhhh
    xingheng
        6
    xingheng  
       2020-05-29 08:03:04 +08:00 via iPhone
    @huntzhan 比如说我想用 requests 发一个指定 URL 参数请求,但是环境里面还没有安装 requests 依赖。
    ruanimal
        7
    ruanimal  
       2020-05-29 09:53:00 +08:00
    @huntzhan 还记得 pybon 吗
    huntzhan
        8
    huntzhan  
    OP
       2020-05-29 11:58:44 +08:00
    @xingheng 这种情况建议手动装 requests
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2912 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 07:51 · PVG 15:51 · LAX 00:51 · JFK 03:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.