Python 3.10.4下载安装并使用help查看模块信息(Win10)

本文详细介绍了如何从Python官网下载并定制安装Python 3.10.4,步骤包括设置安装路径、自定义安装选项,以及在Windows上添加菜单项。重点展示了如何通过命令行查看和使用Python的内置模块,如pip、os等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Python 3.10.4下载安装

Python官网: Welcome to Python.org 

首页,Downloads菜单,

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

双击该文件即开始安装,

 

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

 

 

指定安装位置“d:\Programs\Python\Python310”。点击“Install”

 

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

 

 

点击“Close”即可。

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

安装目录信息截图如下:

 

 

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

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

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

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

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

help()

modules

即可显示Python的所有模块

显示的模块名整理到一个表中(大概是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,命令执行之后的效果如下图所示:

 

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

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

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

 

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

import pip

dir(pip)

help(pip.main)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Alexabc3000

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值