zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    Android三种菜单的使用方式
    Express无法解析POST请求的JSON参数
    reids数据备份与恢复
    docker获取数据库时间相差8小时
    centos添加新用户
    创建一个新的容器并运行一个命令
    docker启动容器时报错unknown shorthand flag: ‘n‘ in -name
    linux查看cpu详细信息
    ValueError: Shapes (None, 1) and (None, 2) are incompatible
    Python:IOError: image file is truncated 的解决办法
  • 原文地址:https://www.cnblogs.com/dadadechengzi/p/6170371.html
Copyright © 2011-2022 走看看