• python pydoc


    pydoc是Python自带的模块,主要用于从python模块中自动生成文档,这些文档可以基于文本呈现的、也可以生成WEB 页面的,还可以在服务器上以浏览器的方式呈现!

    windows powershell:

    > python -m pydoc input
    Help on built-in function input in module __builtin__:
    
    input(...)
        input([prompt]) -> value
    
        Equivalent to eval(raw_input(prompt)).

     linux:

    $ pydoc input 

    pydoc help:

    > python -m pydoc input
    Help on built-in function input in module __builtin__:
    
    input(...)
        input([prompt]) -> value
    
        Equivalent to eval(raw_input(prompt)).

    给定的端口启动HTTP

    python -m pydoc -p 1234 #比如说: 端口为1234
    pydoc server ready at http://localhost:1234/
    pydoc server stopped

    参数 -k 在所有可用的模块中按关键字搜索

    > python -m pydoc -k os
    _locale - Support for POSIX locales.
    _osx_support - Shared OS X support functions.
    binhex - Macintosh binhex compression/decompression.
    codeop - Utilities to compile possibly incomplete Python source code.
    commands - Execute shell commands via os.popen() and return status, output.
    custom_tools.post_install
    encodings.palmos - Python Character Mapping Codec for PalmOS 3.5.
    genericpath - Path operations common to more than one OS
    hotshot - High-perfomance logging profiler, mostly written in C.
    idlelib.macosxSupport - A number of functions that enhance IDLE on Mac OSX.
    lib2to3.fixer_util - Utility functions, node construction macros, etc.
    lib2to3.fixes.fix_getcwdu - Fixer that changes os.getcwdu() to os.getcwd().

    参数 -g将启动图形界面

    > python -m pydoc -g

    参数 -w将指定模块的文本字符串生成HTML格式

    > python -m pydoc -w input
    wrote input.html
  • 相关阅读:
    Python-炫酷二维码
    Dictionary 序列化与反序列化
    获取数据库所有表名与字段名
    LinQ To Object 基本用法
    使用jq操作脚本生成元素的事件
    表单验证如何让select设置为必选
    js实现复制功能兼容ios
    微信小程序使用函数防抖解决重复点击消耗性能问题
    electronr进行签名与公证
    使用electron在mac升级签名后进行升级出现“QRLUpdaterErrorDomain”的错误
  • 原文地址:https://www.cnblogs.com/dadadechengzi/p/6170371.html
Copyright © 2020-2023  润新知