推荐学习书目
› 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
dearmymy
V2EX  ›  Python

请教下关于 Python 运行 Linux 命令行下怎么方便交互

  •  
  •   dearmymy · Jul 28, 2022 · 3062 views
    This topic created in 1520 days ago, the information mentioned may be changed or developed.

    一个 python 写得工具程序,运行起来有些会有一些交互。 pc mac 下打算 qt 写。 但是没桌面的 linux 命令行下请问怎么处理好些。 现在交互不多情况下,我起了一个循环处理用户输入命令,但感觉扩展起来很麻烦。 感觉起一个 web 去操作感觉太麻烦了。搜到几个命令行下的 gui ,感觉年久失修。 请问下有什么好库解决么,实在没打算试试命令行下 gui , 感谢

    6 replies  •  2022-07-29 18:15:36 +08:00
    AoEiuV020CN
        1
    AoEiuV020CN  
       Jul 28, 2022
    我怎么感觉这几天第三次看到这个话题了,python shell 交互的,
    dearmymy
        2
    dearmymy  
    OP
       Jul 28, 2022
    @AoEiuV020CN 我去翻翻帖子
    lululau
        3
    lululau  
       Jul 28, 2022
    lululau
        4
    lululau  
       Jul 28, 2022   ❤️ 1
    fbichijing
        5
    fbichijing  
       Jul 29, 2022
    argparse 之类的。
    24owls
        6
    24owls  
       Jul 29, 2022
    把交互命令写成简短好记的函数,然后 embed 一个 IPython 引入这些函数,这样扩展性有了而且省事儿
    reference: https://stackoverflow.com/questions/15167200/how-do-i-embed-an-ipython-interpreter-into-an-application-running-in-an-ipython
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   955 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 18:53 · PVG 02:53 · LAX 11:53 · JFK 14:53
    ♥ Do have faith in what you're doing.