python查看帮助文档help命令(Python 3.10.4下载安装并使用)

Python 3.10.4下载及安装

Python官网: https://www.python.org/

首页,Downloads菜单,

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

点击“Python 3.10.4”,开始下载安装包,下载完成后得到文件“python-3.10.4-amd64.exe”(我的笔记本电脑使用的是AMD的CPU,应该是Python官网服务器能根据浏览器的访问信息得到客户端计算机的相关信息):

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

双击该文件即开始安装,

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

点击“Customize installation”(定制安装)

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

指定安装位置“d:ProgramsPythonPython310”。点击“Install”

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

等待一段时间后,完成安装。

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

点击“Close”即可。

在Windows的开始菜单中,添加了几个新的菜单项:

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

安装目录信息截图如下:

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

在命令行使用help查看模块信息

在Windows中可以在开始菜单中点击“Python 3.10 Module Docs”,在窗口中查看。

但是在命令行中查看更方便些。

由于在安装时,将Python的安装目录加入到系统变量PATH中,所以可以在命令行直接进入。

在命令行依次键入命令python,进入Python。依次键入下列命令

help()

modules

即可显示Python的所有模块

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

显示的模块名整理到一个表中(大概是296个),如下表所示

__future__ _thread getopt runpy

_abc _threading_local getpass sched

_aix_support _tkinter gettext secrets

_ast _tracemalloc glob select

_asyncio _uuid graphlib selectors

_bisect _warnings gzip setuptools

_blake2 _weakref hashlib shelve

_bootsubprocess _weakrefset heapq shlex

_bz2 _winapi hmac shutil

_codecs _xxsubinterpreters html signal

_codecs_cn _zoneinfo http site

_codecs_hk abc idlelib smtpd

_codecs_iso2022 aifc imaplib smtplib

_codecs_jp antigravity imghdr sndhdr

_codecs_kr argparse imp socket

_codecs_tw array importlib socketserver

_collections ast inspect sqlite3

_collections_abc asynchat io sre_compile

_compat_pickle asyncio ipaddress sre_constants

_compression asyncore itertools sre_parse

_contextvars atexit json ssl

_csv audioop keyword stat

_ctypes base64 lib2to3 statistics

_ctypes_test bdb linecache string

_datetime binascii locale stringprep

_decimal binhex logging struct

_distutils_hack bisect lzma subprocess

_elementtree builtins mailbox sunau

_functools bz2 mailcap symtable

_hashlib cProfile marshal sys

_heapq calendar math sysconfig

_imp cgi mimetypes tabnanny

_io cgitb mmap tarfile

_json chunk modulefinder telnetlib

_locale cmath msilib tempfile

_lsprof cmd msvcrt test

_lzma code multiprocessing textwrap

_markupbase codecs netrc this

_md5 codeop nntplib threading

_msi collections nt time

_multibytecodec colorsys ntpath timeit

_multiprocessing compileall nturl2path tkinter

_opcode concurrent numbers token

_operator configparser opcode tokenize

_osx_support contextlib operator trace

_overlapped contextvars optparse traceback

_pickle copy os tracemalloc

_py_abc copyreg pathlib tty

_pydecimal crypt pdb turtle

_pyio csv pickle turtledemo

_queue ctypes pickletools types

_random curses pip typing

_sha1 dataclasses pipes unicodedata

_sha256 datetime pkg_resources unittest

_sha3 dbm pkgutil urllib

_sha512 decimal platform uu

_signal difflib plistlib uuid

_sitebuiltins dis poplib venv

_socket distutils posixpath warnings

_sqlite3 doctest pprint wave

_sre email profile weakref

_ssl encodings pstats webbrowser

_stat ensurepip pty winreg

_statistics enum py_compile winsound

_string errno pyclbr wsgiref

_strptime faulthandler pydoc xdrlib

_struct filecmp pydoc_data xml

_symtable fileinput pyexpat xmlrpc

_testbuffer fnmatch queue xxsubtype

_testcapi fractions quopri zipapp

_testconsole ftplib random zipfile

_testimportmultiple functools re zipimport

_testinternalcapi gc reprlib zlib

_testmultiphase genericpath rlcompleter zoneinfo

 

在命令行提示符为“help>”时,键入模块名,即可显示该模块的详细信息。比如键入pip,命令执行之后的效果如下图所示:

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

列出了NAME(模块名)、PACKAGE CONTENTS(包内容)、FUNCTIONS(函数)、DATA(数据)、VERSION(版本号)、FILE(文件,包含了目录)。

 

在命令行提示符为“help>”时,按下回车键,返回Python的命令行,提示符变为“>>>”。

可以使用import、dir、print、help命令显示包(模块)的一些信息,如下图所示:

 

python查看帮助文档help命令(Python 3.10.4下载安装并使用)

其中键入的命令依次如下:

import pip

dir(pip)

help(pip.main)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发表评论

登录后才能评论