Contenu de la documentation Python¶
- Nouveautés de Python
- What's New In Python 3.13
- What's New In Python 3.12
- Les nouveautés de Python 3.11
- Résumé – Points forts de la publication
- Nouvelles fonctionnalités
- New Features Related to Type Hints
- Autres changements au langage
- Autres changements à l'implémentation de CPython
- Nouveaux modules
- Modules améliorés
- Optimisations
- Faster CPython
- CPython bytecode changes
- Obsolescence
- Pending Removal in Python 3.12
- Retraits
- Portage vers Python 3.11
- Changements à la compilation
- Changements à l'API C
- Les nouveautés de Python 3.10
- Résumé – Points forts de la publication
- Nouvelles fonctionnalités
- Gestionnaires de contextes entre parenthèses
- Meilleurs messages d'erreurs
- PEP 626 : numéros de lignes précis pour le débogage et les autres outils
- PEP 634 : filtrage par motifs structurels
EncodingWarning
et optionencoding="locale"
optionnels
- Nouvelles fonctionnalités reliées aux indications de types
- Autres changements au langage
- Nouveaux modules
- Modules améliorés
asyncio
argparse
array
asynchat
,asyncore
,smtpd
base64
bdb
bisect
codecs
collections.abc
contextlib
curses
dataclasses
distutils
doctest
encodings
- enum
fileinput
faulthandler
gc
glob
hashlib
hmac
- IDLE et
idlelib
importlib.metadata
inspect
- itertools
linecache
os
os.path
pathlib
platform
pprint
py_compile
pyclbr
shelve
statistics
site
socket
ssl
sqlite3
sys
_thread
threading
traceback
types
typing
unittest
urllib.parse
xml
zipimport
- Optimisations
- Obsolescence
- Retrait
- Portage vers Python 3.10
- Changements au code intermédiaire CPython
- Changements à la compilation
- Changements à l'API C
- Les nouveautés de Python 3.9
- Résumé – Points marquants de cette version
- Vous devez vérifier la présence de
DeprecationWarning
dans votre code - Nouvelles fonctionnalités
- Autres changements au langage
- Nouveaux modules
- Modules améliorés
- Optimisations
- Obsolescence
- Retraits
- Portage vers Python 3.9
- Changements à la compilation
- Changements à l'API C
- Changements importants dans Python 3.9.1
- Changements importants dans Python 3.9.2
- Nouveautés de Python 3.8
- Summary -- Release highlights
- Nouvelles fonctionnalités
- Expression d'affectation
- Positional-only parameters
- Parallel filesystem cache for compiled bytecode files
- Debug build uses the same ABI as release build
- f-strings support
=
for self-documenting expressions and debugging - PEP 578: Python Runtime Audit Hooks
- PEP 587: Python Initialization Configuration
- PEP 590: Vectorcall: a fast calling protocol for CPython
- Pickle protocol 5 with out-of-band data buffers
- Other Language Changes
- New Modules
- Improved Modules
- ast
- asyncio
- builtins
- collections
- cProfile
- csv
- curses
- ctypes
- datetime
- functools
- gc
- gettext
- gzip
- IDLE and idlelib
- inspect
- io
- itertools
- json.tool
- logging
- math
- mmap
- multiprocessing
- os
- os.path
- pathlib
- pickle
- plistlib
- pprint
- py_compile
- shlex
- shutil
- socket
- ssl
- statistics
- sys
- tarfile
- threading
- tokenize
- tkinter
- time
- typing
- unicodedata
- unittest
- venv
- weakref
- xml
- xmlrpc
- Optimizations
- Build and C API Changes
- Deprecated
- API and Feature Removals
- Porting to Python 3.8
- Notable changes in Python 3.8.1
- Notable changes in Python 3.8.8
- Notable changes in Python 3.8.12
- What's New In Python 3.7
- Summary -- Release Highlights
- Nouvelles fonctionnalités
- PEP 563: Postponed Evaluation of Annotations
- PEP 538: Legacy C Locale Coercion
- PEP 540: Forced UTF-8 Runtime Mode
- PEP 553: Built-in
breakpoint()
- PEP 539: New C API for Thread-Local Storage
- PEP 562: Customization of Access to Module Attributes
- PEP 564: New Time Functions With Nanosecond Resolution
- PEP 565: Show DeprecationWarning in
__main__
- PEP 560: Core Support for
typing
module and Generic Types - PEP 552: Hash-based .pyc Files
- PEP 545: Python Documentation Translations
- Python Development Mode (-X dev)
- Other Language Changes
- New Modules
- Improved Modules
- argparse
- asyncio
- binascii
- calendar
- collections
- compileall
- concurrent.futures
- contextlib
- cProfile
- crypt
- datetime
- dbm
- decimal
- dis
- distutils
- enum
- functools
- gc
- hmac
- http.client
- http.server
- idlelib and IDLE
- importlib
- io
- ipaddress
- itertools
- locale
- logging
- math
- mimetypes
- msilib
- multiprocessing
- os
- pathlib
- pdb
- py_compile
- pydoc
- queue
- re
- signal
- socket
- socketserver
- sqlite3
- ssl
- string
- subprocess
- sys
- time
- tkinter
- tracemalloc
- types
- unicodedata
- unittest
- unittest.mock
- urllib.parse
- uu
- uuid
- warnings
- xml.etree
- xmlrpc.server
- zipapp
- zipfile
- C API Changes
- Build Changes
- Optimizations
- Other CPython Implementation Changes
- Deprecated Python Behavior
- Deprecated Python modules, functions and methods
- Deprecated functions and types of the C API
- Platform Support Removals
- API and Feature Removals
- Module Removals
- Windows-only Changes
- Porting to Python 3.7
- Notable changes in Python 3.7.1
- Notable changes in Python 3.7.2
- Notable changes in Python 3.7.6
- Notable changes in Python 3.7.10
- What's New In Python 3.6
- Résumé – Points forts de la publication
- Nouvelles fonctionnalités
- PEP 498: Formatted string literals
- PEP 526: Syntax for variable annotations
- PEP 515: Underscores in Numeric Literals
- PEP 525: Asynchronous Generators
- PEP 530: Asynchronous Comprehensions
- PEP 487: Simpler customization of class creation
- PEP 487: Descriptor Protocol Enhancements
- PEP 519: Adding a file system path protocol
- PEP 495: Local Time Disambiguation
- PEP 529: Change Windows filesystem encoding to UTF-8
- PEP 528: Change Windows console encoding to UTF-8
- PEP 520: Preserving Class Attribute Definition Order
- PEP 468: Preserving Keyword Argument Order
- New dict implementation
- PEP 523: Adding a frame evaluation API to CPython
- PYTHONMALLOC environment variable
- DTrace and SystemTap probing support
- Other Language Changes
- New Modules
- Improved Modules
- array
- ast
- asyncio
- binascii
- cmath
- collections
- concurrent.futures
- contextlib
- datetime
- decimal
- distutils
- encodings
- enum
- faulthandler
- fileinput
- hashlib
- http.client
- idlelib and IDLE
- importlib
- inspect
- json
- logging
- math
- multiprocessing
- os
- pathlib
- pdb
- pickle
- pickletools
- pydoc
- random
- re
- readline
- rlcompleter
- shlex
- site
- sqlite3
- socket
- socketserver
- ssl
- statistics
- struct
- subprocess
- sys
- telnetlib
- time
- timeit
- tkinter
- traceback
- tracemalloc
- typing
- unicodedata
- unittest.mock
- urllib.request
- urllib.robotparser
- venv
- warnings
- winreg
- winsound
- xmlrpc.client
- zipfile
- zlib
- Optimizations
- Build and C API Changes
- Autres Améliorations
- Deprecated
- Removed
- Porting to Python 3.6
- Notable changes in Python 3.6.2
- Notable changes in Python 3.6.4
- Notable changes in Python 3.6.5
- Notable changes in Python 3.6.7
- Notable changes in Python 3.6.10
- Notable changes in Python 3.6.13
- Nouveautés de Python 3.5
- Résumé – Points forts de la publication
- Nouvelles fonctionnalités
- PEP 492 - Coroutines with async and await syntax
- PEP 465 - A dedicated infix operator for matrix multiplication
- PEP 448 - Additional Unpacking Generalizations
- PEP 461 - percent formatting support for bytes and bytearray
- PEP 484 - Type Hints
- PEP 471 - os.scandir() function -- a better and faster directory iterator
- PEP 475: Retry system calls failing with EINTR
- PEP 479: Change StopIteration handling inside generators
- PEP 485: A function for testing approximate equality
- PEP 486: Make the Python Launcher aware of virtual environments
- PEP 488 : Élimination des fichiers PYO
- PEP 489: Multi-phase extension module initialization
- Other Language Changes
- New Modules
- Improved Modules
- argparse
- asyncio
- bz2
- cgi
- cmath
- code
- collections
- collections.abc
- compileall
- concurrent.futures
- configparser
- contextlib
- csv
- curses
- dbm
- difflib
- distutils
- doctest
- enum
- faulthandler
- functools
- glob
- gzip
- heapq
- http
- http.client
- idlelib and IDLE
- imaplib
- imghdr
- importlib
- inspect
- io
- ipaddress
- json
- linecache
- locale
- logging
- lzma
- math
- multiprocessing
- operator
- os
- pathlib
- pickle
- poplib
- re
- readline
- selectors
- shutil
- signal
- smtpd
- smtplib
- sndhdr
- socket
- ssl
- sqlite3
- subprocess
- sys
- sysconfig
- tarfile
- threading
- time
- timeit
- tkinter
- traceback
- types
- unicodedata
- unittest
- unittest.mock
- urllib
- wsgiref
- xmlrpc
- xml.sax
- zipfile
- Other module-level changes
- Optimizations
- Build and C API Changes
- Deprecated
- Removed
- Portage vers Python 3.5
- Notable changes in Python 3.5.4
- Nouveautés de Python 3.4
- Summary -- Release Highlights
- Nouvelles fonctionnalités
- New Modules
- Improved Modules
- abc
- aifc
- argparse
- audioop
- base64
- collections
- colorsys
- contextlib
- dbm
- dis
- doctest
- filecmp
- functools
- gc
- glob
- hashlib
- hmac
- html
- http
- idlelib and IDLE
- importlib
- inspect
- ipaddress
- logging
- marshal
- mmap
- multiprocessing
- operator
- os
- pdb
- pickle
- plistlib
- poplib
- pprint
- pty
- pydoc
- re
- resource
- select
- shelve
- shutil
- smtpd
- smtplib
- socket
- sqlite3
- ssl
- stat
- struct
- subprocess
- sunau
- sys
- tarfile
- textwrap
- threading
- traceback
- types
- urllib
- unittest
- venv
- wave
- weakref
- xml.etree
- zipfile
- CPython Implementation Changes
- Deprecated
- Removed
- Portage vers Python 3.4
- Changed in 3.4.3
- Nouveautés de Python 3.3
- Résumé – Points forts de la publication
- PEP 405: Virtual Environments
- PEP 420: Implicit Namespace Packages
- PEP 3118: New memoryview implementation and buffer protocol documentation
- PEP 393: Flexible String Representation
- PEP 397: Python Launcher for Windows
- PEP 3151: Reworking the OS and IO exception hierarchy
- PEP 380: Syntax for Delegating to a Subgenerator
- PEP 409: Suppressing exception context
- PEP 414: Explicit Unicode literals
- PEP 3155: Qualified name for classes and functions
- PEP 412: Key-Sharing Dictionary
- PEP 362: Function Signature Object
- PEP 421: Adding sys.implementation
- Using importlib as the Implementation of Import
- Other Language Changes
- A Finer-Grained Import Lock
- Builtin functions and types
- New Modules
- Improved Modules
- abc
- array
- base64
- binascii
- bz2
- codecs
- collections
- contextlib
- crypt
- curses
- datetime
- decimal
- ftplib
- functools
- gc
- hmac
- http
- html
- imaplib
- inspect
- io
- itertools
- logging
- math
- mmap
- multiprocessing
- nntplib
- os
- pdb
- pickle
- pydoc
- re
- sched
- select
- shlex
- shutil
- signal
- smtpd
- smtplib
- socket
- socketserver
- sqlite3
- ssl
- stat
- struct
- subprocess
- sys
- tarfile
- tempfile
- textwrap
- threading
- time
- types
- unittest
- urllib
- webbrowser
- xml.etree.ElementTree
- zlib
- Optimizations
- Build and C API Changes
- Deprecated
- Portage vers Python 3.3
- Nouveautés de Python 3.2
- PEP 384: Defining a Stable ABI
- PEP 389: Argparse Command Line Parsing Module
- PEP 391: Dictionary Based Configuration for Logging
- PEP 3148: The
concurrent.futures
module - PEP 3147: PYC Repository Directories
- PEP 3149: ABI Version Tagged .so Files
- PEP 3333: Python Web Server Gateway Interface v1.0.1
- Other Language Changes
- New, Improved, and Deprecated Modules
- elementtree
- functools
- itertools
- collections
- threading
- datetime and time
- math
- abc
- io
- reprlib
- logging
- csv
- contextlib
- decimal and fractions
- ftp
- popen
- select
- gzip and zipfile
- tarfile
- hashlib
- ast
- os
- shutil
- sqlite3
- html
- socket
- ssl
- nntp
- certificates
- imaplib
- http.client
- unittest
- random
- poplib
- asyncore
- tempfile
- inspect
- pydoc
- dis
- dbm
- ctypes
- site
- sysconfig
- pdb
- configparser
- urllib.parse
- mailbox
- turtledemo
- Fils d'exécution
- Optimizations
- Unicode
- Codecs
- Documentation
- IDLE
- Code Repository
- Build and C API Changes
- Portage vers Python 3.2
- Nouveautés de Python 3.1
- Nouveautés de Python 3.0
- Nouveautés de Python 2.7
- The Future for Python 2.x
- Changes to the Handling of Deprecation Warnings
- Python 3.1 Features
- PEP 372: Adding an Ordered Dictionary to collections
- PEP 378: Format Specifier for Thousands Separator
- PEP 389: The argparse Module for Parsing Command Lines
- PEP 391: Dictionary-Based Configuration For Logging
- PEP 3106: Dictionary Views
- PEP 3137: The memoryview Object
- Other Language Changes
- New and Improved Modules
- Build and C API Changes
- Autres changements et corrections
- Portage vers Python 2.7
- New Features Added to Python 2.7 Maintenance Releases
- Two new environment variables for debug mode
- PEP 434: IDLE Enhancement Exception for All Branches
- PEP 466: Network Security Enhancements for Python 2.7
- PEP 477: Backport ensurepip (PEP 453) to Python 2.7
- PEP 476: Enabling certificate verification by default for stdlib http clients
- PEP 493: HTTPS verification migration tools for Python 2.7
- New
make regen-all
build target - Removal of
make touch
build target
- Remerciements
- Nouveautés de Python 2.6
- Python 3.0
- Changes to the Development Process
- PEP 343: The 'with' statement
- PEP 366: Explicit Relative Imports From a Main Module
- PEP 370: Per-user
site-packages
Directory - PEP 371: The
multiprocessing
Package - PEP 3101: Advanced String Formatting
- PEP 3105:
print
As a Function - PEP 3110: Exception-Handling Changes
- PEP 3112: Byte Literals
- PEP 3116: New I/O Library
- PEP 3118: Revised Buffer Protocol
- PEP 3119: Abstract Base Classes
- PEP 3127: Integer Literal Support and Syntax
- PEP 3129: Class Decorators
- PEP 3141: A Type Hierarchy for Numbers
- Other Language Changes
- New and Improved Modules
- Deprecations and Removals
- Build and C API Changes
- Portage vers Python 2.6
- Remerciements
- Nouveautés de Python 2.5
- PEP 308 : Expressions conditionnelles
- PEP 309 : Application partielle de fonction
- PEP 314: Metadata for Python Software Packages v1.1
- PEP 328: Absolute and Relative Imports
- PEP 338: Executing Modules as Scripts
- PEP 341: Unified try/except/finally
- PEP 342: New Generator Features
- PEP 343: The 'with' statement
- PEP 352: Exceptions as New-Style Classes
- PEP 353: Using ssize_t as the index type
- PEP 357: The '__index__' method
- Other Language Changes
- Modules ajoutés, modifiés, et supprimés
- Build and C API Changes
- Portage vers Python 2.5
- Remerciements
- Nouveautés de Python 2.4
- PEP 218: Built-In Set Objects
- PEP 237: Unifying Long Integers and Integers
- PEP 289: Generator Expressions
- PEP 292: Simpler String Substitutions
- PEP 318: Decorators for Functions and Methods
- PEP 322: Reverse Iteration
- PEP 324: New subprocess Module
- PEP 327: Decimal Data Type
- PEP 328: Multi-line Imports
- PEP 331: Locale-Independent Float/String Conversions
- Other Language Changes
- New, Improved, and Deprecated Modules
- Build and C API Changes
- Portage vers Python 2.4
- Remerciements
- Nouveautés de Python 2.3
- PEP 218: A Standard Set Datatype
- PEP 255 : Générateurs simples
- PEP 263: Source Code Encodings
- PEP 273: Importing Modules from ZIP Archives
- PEP 277: Unicode file name support for Windows NT
- PEP 278: Universal Newline Support
- PEP 279: enumerate()
- PEP 282: The logging Package
- PEP 285 : Un type booléen
- PEP 293: Codec Error Handling Callbacks
- PEP 301: Package Index and Metadata for Distutils
- PEP 302: New Import Hooks
- PEP 305: Comma-separated Files
- PEP 307: Pickle Enhancements
- Extended Slices
- Other Language Changes
- New, Improved, and Deprecated Modules
- Pymalloc: A Specialized Object Allocator
- Build and C API Changes
- Autres changements et corrections
- Portage vers Python 2.3
- Remerciements
- Nouveautés de Python 2.2
- Introduction
- PEP 252 et 253 : Changements concernant les types et classes
- PEP 234 : Itérateurs
- PEP 255 : Générateurs simples
- PEP 237: Unifying Long Integers and Integers
- PEP 238: Changing the Division Operator
- Unicode Changes
- PEP 227: Nested Scopes
- New and Improved Modules
- Interpreter Changes and Fixes
- Autres changements et corrections
- Remerciements
- Nouveautés de Python 2.1
- Introduction
- PEP 227: Nested Scopes
- PEP 236 : Directives
__future__
- PEP 207: Rich Comparisons
- PEP 230: Warning Framework
- PEP 229: New Build System
- PEP 205: Weak References
- PEP 232 : Attributs de fonctions
- PEP 235: Importing Modules on Case-Insensitive Platforms
- PEP 217: Interactive Display Hook
- PEP 208: New Coercion Model
- PEP 241: Metadata in Python Packages
- New and Improved Modules
- Autres changements et corrections
- Remerciements
- Nouveautés de Python 2.0
- Introduction
- À propos de Python 1.6.
- Nouveau processus de développement
- Unicode
- Compréhensions de listes
- Opérateurs d’affectation augmentées
- Méthodes de chaînes de caractères
- Garbage Collection of Cycles
- Other Core Changes
- Porting to 2.0
- Extending/Embedding Changes
- Distutils: Making Modules Easy to Install
- Modules XML
- Module changes
- Nouveaux modules
- IDLE Improvements
- Deleted and Deprecated Modules
- Remerciements
- Changelog
- Python next
- Python 3.12.0 beta 1
- Python 3.12.0 alpha 7
- Python 3.12.0 alpha 6
- Python 3.12.0 alpha 5
- Python 3.12.0 alpha 4
- Python 3.12.0 alpha 3
- Python 3.12.0 alpha 2
- Python 3.12.0 alpha 1
- Python 3.11.0 beta 1
- Python 3.11.0 alpha 7
- Python 3.11.0 alpha 6
- Python 3.11.0 alpha 5
- Python 3.11.0 alpha 4
- Python 3.11.0 alpha 3
- Python 3.11.0 alpha 2
- Python 3.11.0 alpha 1
- Python 3.10.0 beta 1
- Python 3.10.0 alpha 7
- Python 3.10.0 alpha 6
- Python 3.10.0 alpha 5
- Python 3.10.0 alpha 4
- Python 3.10.0 alpha 3
- Python 3.10.0 alpha 2
- Python 3.10.0 alpha 1
- Python 3.9.0 beta 1
- Python 3.9.0 alpha 6
- Python 3.9.0 alpha 5
- Python 3.9.0 alpha 4
- Python 3.9.0 alpha 3
- Python 3.9.0 alpha 2
- Python 3.9.0 alpha 1
- Python 3.8.0 beta 1
- Python 3.8.0 alpha 4
- Python 3.8.0 alpha 3
- Python 3.8.0 alpha 2
- Python 3.8.0 alpha 1
- Python 3.7.0 final
- Python 3.7.0 release candidate 1
- Python 3.7.0 beta 5
- Python 3.7.0 beta 4
- Python 3.7.0 beta 3
- Python 3.7.0 beta 2
- Python 3.7.0 beta 1
- Python 3.7.0 alpha 4
- Python 3.7.0 alpha 3
- Python 3.7.0 alpha 2
- Python 3.7.0 alpha 1
- Python 3.6.6 final
- Python 3.6.6 release candidate 1
- Python 3.6.5 final
- Python 3.6.5 release candidate 1
- Python 3.6.4 final
- Python 3.6.4 release candidate 1
- Python 3.6.3 final
- Python 3.6.3 release candidate 1
- Python 3.6.2 final
- Python 3.6.2 release candidate 2
- Python 3.6.2 release candidate 1
- Python 3.6.1 final
- Python 3.6.1 release candidate 1
- Python 3.6.0 final
- Python 3.6.0 release candidate 2
- Python 3.6.0 release candidate 1
- Python 3.6.0 beta 4
- Python 3.6.0 beta 3
- Python 3.6.0 beta 2
- Python 3.6.0 beta 1
- Python 3.6.0 alpha 4
- Python 3.6.0 alpha 3
- Python 3.6.0 alpha 2
- Python 3.6.0 alpha 1
- Python 3.5.5 final
- Python 3.5.5 release candidate 1
- Python 3.5.4 final
- Python 3.5.4 release candidate 1
- Python 3.5.3 final
- Python 3.5.3 release candidate 1
- Python 3.5.2 final
- Python 3.5.2 release candidate 1
- Python 3.5.1 final
- Python 3.5.1 release candidate 1
- Python 3.5.0 final
- Python 3.5.0 release candidate 4
- Python 3.5.0 release candidate 3
- Python 3.5.0 release candidate 2
- Python 3.5.0 release candidate 1
- Python 3.5.0 beta 4
- Python 3.5.0 beta 3
- Python 3.5.0 beta 2
- Python 3.5.0 beta 1
- Python 3.5.0 alpha 4
- Python 3.5.0 alpha 3
- Python 3.5.0 alpha 2
- Python 3.5.0 alpha 1
- Le tutoriel Python
- 1. Mise en bouche
- 2. Mode d'emploi de l'interpréteur Python
- 3. Introduction informelle à Python
- 4. D'autres outils de contrôle de flux
- 4.1. L'instruction
if
- 4.2. L'instruction
for
- 4.3. La fonction
range()
- 4.4. Les instructions
break
,continue
et les clauseselse
au sein des boucles - 4.5. L'instruction
pass
- 4.6. L'instruction
match
- 4.7. Définir des fonctions
- 4.8. Davantage sur la définition des fonctions
- 4.9. Aparté : le style de codage
- 4.1. L'instruction
- 5. Structures de données
- 6. Modules
- 7. Les entrées/sorties
- 8. Erreurs et exceptions
- 8.1. Les erreurs de syntaxe
- 8.2. Exceptions
- 8.3. Gestion des exceptions
- 8.4. Déclencher des exceptions
- 8.5. Chaînage d'exceptions
- 8.6. Exceptions définies par l'utilisateur
- 8.7. Définition d'actions de nettoyage
- 8.8. Actions de nettoyage prédéfinies
- 8.9. Levée et gestion de multiples exceptions non corrélées
- 8.10. Enrichissement des exceptions avec des notes
- 9. Classes
- 10. Survol de la bibliothèque standard
- 10.1. Interface avec le système d'exploitation
- 10.2. Jokers sur les noms de fichiers
- 10.3. Paramètres passés en ligne de commande
- 10.4. Redirection de la sortie d'erreur et fin d'exécution
- 10.5. Recherche de motifs dans les chaînes
- 10.6. Mathématiques
- 10.7. Accès à internet
- 10.8. Dates et heures
- 10.9. Compression de données
- 10.10. Mesure des performances
- 10.11. Contrôle qualité
- 10.12. Piles fournies
- 11. Survol de la bibliothèque standard -- Deuxième partie
- 12. Environnements virtuels et paquets
- 13. Pour aller plus loin
- 14. Édition interactive des entrées et substitution d'historique
- 15. Arithmétique en nombres à virgule flottante : problèmes et limites
- 16. Annexe
- Installation et utilisation de Python
- 1. Ligne de commande et environnement
- 2. Utilisation de Python sur les plateformes Unix
- 3. Configurer Python
- 3.1. Build Requirements
- 3.2. Options de configuration
- 3.2.1. Options générales
- 3.2.2. Options de WebAssembly
- 3.2.3. Options d'installation
- 3.2.4. Options de performance
- 3.2.5. Compilation de Python en mode débogage
- 3.2.6. Debug options
- 3.2.7. Linker options
- 3.2.8. Libraries options
- 3.2.9. Security Options
- 3.2.10. macOS Options
- 3.2.11. Cross Compiling Options
- 3.3. Python Build System
- 3.4. Compiler and linker flags
- 4. Utilisation de Python sur Windows
- 4.1. L'installateur complet
- 4.2. Le paquet Microsoft Store
- 4.3. Les paquets nuget.org
- 4.4. Le paquet intégrable
- 4.5. Paquets alternatifs
- 4.6. Configurer Python
- 4.7. Mode UTF-8
- 4.8. Lanceur Python pour Windows
- 4.9. Recherche de modules
- 4.10. Modules supplémentaires
- 4.11. Compiler Python sous Windows
- 4.12. Autres plateformes
- 5. Utilisation de Python sur un Mac
- 6. Éditeurs et IDEs
- La référence du langage Python
- 1. Introduction
- 2. Analyse lexicale
- 3. Modèle de données
- 3.1. Objets, valeurs et types
- 3.2. Hiérarchie des types standards
- 3.3. Méthodes spéciales
- 3.3.1. Personnalisation de base
- 3.3.2. Personnalisation de l'accès aux attributs
- 3.3.3. Personnalisation de la création de classes
object.__init_subclass__()
object.__set_name__()
- 3.3.3.1. Métaclasses
- 3.3.3.2. Résolution des entrées MRO
- 3.3.3.3. Détermination de la métaclasse appropriée
- 3.3.3.4. Préparation de l'espace de nommage de la classe
- 3.3.3.5. Exécution du corps de la classe
- 3.3.3.6. Création de l'objet classe
- 3.3.3.7. Cas d'utilisations des métaclasses
- 3.3.4. Personnalisation des instances et vérification des sous-classes
- 3.3.5. Émulation de types génériques
- 3.3.6. Émulation d'objets appelables
- 3.3.7. Émulation de types conteneurs
- 3.3.8. Émulation de types numériques
object.__add__()
object.__sub__()
object.__mul__()
object.__matmul__()
object.__truediv__()
object.__floordiv__()
object.__mod__()
object.__divmod__()
object.__pow__()
object.__lshift__()
object.__rshift__()
object.__and__()
object.__xor__()
object.__or__()
object.__radd__()
object.__rsub__()
object.__rmul__()
object.__rmatmul__()
object.__rtruediv__()
object.__rfloordiv__()
object.__rmod__()
object.__rdivmod__()
object.__rpow__()
object.__rlshift__()
object.__rrshift__()
object.__rand__()
object.__rxor__()
object.__ror__()
object.__iadd__()
object.__isub__()
object.__imul__()
object.__imatmul__()
object.__itruediv__()
object.__ifloordiv__()
object.__imod__()
object.__ipow__()
object.__ilshift__()
object.__irshift__()
object.__iand__()
object.__ixor__()
object.__ior__()
object.__neg__()
object.__pos__()
object.__abs__()
object.__invert__()
object.__complex__()
object.__int__()
object.__float__()
object.__index__()
object.__round__()
object.__trunc__()
object.__floor__()
object.__ceil__()
- 3.3.9. Gestionnaire de contexte With
- 3.3.10. Arguments positionnels dans le filtrage par motif sur les classes
- 3.3.11. Emulating buffer types
- 3.3.12. Recherche des méthodes spéciales
- 3.4. Coroutines
- 4. Modèle d'exécution
- 5. Le système d'importation
- 6. Expressions
- 6.1. Conversions arithmétiques
- 6.2. Atomes
- 6.3. Primaires
- 6.4. Expression
await
- 6.5. L'opérateur puissance
- 6.6. Arithmétique unaire et opérations sur les bits
- 6.7. Opérations arithmétiques binaires
- 6.8. Opérations de décalage
- 6.9. Opérations binaires bit à bit
- 6.10. Comparaisons
- 6.11. Opérations booléennes
- 6.12. Expressions d'affectation
- 6.13. Expressions conditionnelles
- 6.14. Expressions lambda
- 6.15. Listes d'expressions
- 6.16. Ordre d'évaluation
- 6.17. Priorités des opérateurs
- 7. Les instructions simples
- 7.1. Les expressions
- 7.2. Les assignations
- 7.3. L'instruction
assert
- 7.4. L'instruction
pass
- 7.5. L'instruction
del
- 7.6. L'instruction
return
- 7.7. L'instruction
yield
- 7.8. L'instruction
raise
- 7.9. L'instruction
break
- 7.10. L'instruction
continue
- 7.11. L'instruction
import
- 7.12. L'instruction
global
- 7.13. L'instruction
nonlocal
- 7.14. The
type
statement
- 8. Instructions composées
- 8.1. L'instruction
if
- 8.2. L'instruction
while
- 8.3. L'instruction
for
- 8.4. L'instruction
try
- 8.5. L'instruction
with
- 8.6. L'instruction
match
- 8.7. Définition de fonctions
- 8.8. Définition de classes
- 8.9. Coroutines
- 8.10. Type parameter lists
- 8.1. L'instruction
- 9. Composants de plus haut niveau
- 10. Spécification complète de la grammaire
- La bibliothèque standard
- Introduction
- Fonctions natives
abs()
aiter()
all()
anext()
any()
ascii()
bin()
bool
breakpoint()
callable()
chr()
classmethod()
compile()
complex
delattr()
dir()
divmod()
enumerate()
eval()
exec()
filter()
float
format()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int
isinstance()
issubclass()
iter()
len()
locals()
map()
max()
min()
next()
object
oct()
open()
ord()
pow()
print()
property
repr()
reversed()
round()
setattr()
slice
sorted()
staticmethod()
sum()
super
type
vars()
zip()
__import__()
- Constantes natives
- Types natifs
- Valeurs booléennes
- Opérations booléennes —
and
,or
,not
- Comparaisons
- Types numériques —
int
,float
,complex
- Boolean Type -
bool
- Les types itérateurs
- Types séquentiels —
list
,tuple
,range
- Type Séquence de Texte —
str
str
- Méthodes de chaînes de caractères
str.capitalize()
str.casefold()
str.center()
str.count()
str.encode()
str.endswith()
str.expandtabs()
str.find()
str.format()
str.format_map()
str.index()
str.isalnum()
str.isalpha()
str.isascii()
str.isdecimal()
str.isdigit()
str.isidentifier()
str.islower()
str.isnumeric()
str.isprintable()
str.isspace()
str.istitle()
str.isupper()
str.join()
str.ljust()
str.lower()
str.lstrip()
str.maketrans()
str.partition()
str.removeprefix()
str.removesuffix()
str.replace()
str.rfind()
str.rindex()
str.rjust()
str.rpartition()
str.rsplit()
str.rstrip()
str.split()
str.splitlines()
str.startswith()
str.strip()
str.swapcase()
str.title()
str.translate()
str.upper()
str.zfill()
- Formatage de chaines à la
printf
- Séquences Binaires —
bytes
,bytearray
,vue mémoire
- Objets bytes
- Objets bytearray
- Opérations sur les bytes et bytearray
bytes.count()
bytearray.count()
bytes.removeprefix()
bytearray.removeprefix()
bytes.removesuffix()
bytearray.removesuffix()
bytes.decode()
bytearray.decode()
bytes.endswith()
bytearray.endswith()
bytes.find()
bytearray.find()
bytes.index()
bytearray.index()
bytes.join()
bytearray.join()
bytes.maketrans()
bytearray.maketrans()
bytes.partition()
bytearray.partition()
bytes.replace()
bytearray.replace()
bytes.rfind()
bytearray.rfind()
bytes.rindex()
bytearray.rindex()
bytes.rpartition()
bytearray.rpartition()
bytes.startswith()
bytearray.startswith()
bytes.translate()
bytearray.translate()
bytes.center()
bytearray.center()
bytes.ljust()
bytearray.ljust()
bytes.lstrip()
bytearray.lstrip()
bytes.rjust()
bytearray.rjust()
bytes.rsplit()
bytearray.rsplit()
bytes.rstrip()
bytearray.rstrip()
bytes.split()
bytearray.split()
bytes.strip()
bytearray.strip()
bytes.capitalize()
bytearray.capitalize()
bytes.expandtabs()
bytearray.expandtabs()
bytes.isalnum()
bytearray.isalnum()
bytes.isalpha()
bytearray.isalpha()
bytes.isascii()
bytearray.isascii()
bytes.isdigit()
bytearray.isdigit()
bytes.islower()
bytearray.islower()
bytes.isspace()
bytearray.isspace()
bytes.istitle()
bytearray.istitle()
bytes.isupper()
bytearray.isupper()
bytes.lower()
bytearray.lower()
bytes.splitlines()
bytearray.splitlines()
bytes.swapcase()
bytearray.swapcase()
bytes.title()
bytearray.title()
bytes.upper()
bytearray.upper()
bytes.zfill()
bytearray.zfill()
- Formatage de bytes a la
printf
- Vues mémoire
memoryview
memoryview.__eq__()
memoryview.tobytes()
memoryview.hex()
memoryview.tolist()
memoryview.toreadonly()
memoryview.release()
memoryview.cast()
memoryview.obj
memoryview.nbytes
memoryview.readonly
memoryview.format
memoryview.itemsize
memoryview.ndim
memoryview.shape
memoryview.strides
memoryview.suboffsets
memoryview.c_contiguous
memoryview.f_contiguous
memoryview.contiguous
- Types d'ensembles —
set
,frozenset
set
frozenset
frozenset.isdisjoint()
frozenset.issubset()
frozenset.issuperset()
frozenset.union()
frozenset.intersection()
frozenset.difference()
frozenset.symmetric_difference()
frozenset.copy()
frozenset.update()
frozenset.intersection_update()
frozenset.difference_update()
frozenset.symmetric_difference_update()
frozenset.add()
frozenset.remove()
frozenset.discard()
frozenset.pop()
frozenset.clear()
- Les types de correspondances —
dict
- Le type gestionnaire de contexte
- Types d'annotation de type — Alias générique, Union
- Autres types natifs
- Attributs spéciaux
- Limitation de longueur de conversion de chaîne vers un entier
- Exceptions natives
- Contexte des exceptions
- Hériter des exceptions natives
- Classes mères
- Exceptions concrètes
AssertionError
AttributeError
EOFError
FloatingPointError
GeneratorExit
ImportError
ModuleNotFoundError
IndexError
KeyError
KeyboardInterrupt
MemoryError
NameError
NotImplementedError
OSError
OverflowError
RecursionError
ReferenceError
RuntimeError
StopIteration
StopAsyncIteration
SyntaxError
IndentationError
TabError
SystemError
SystemExit
TypeError
UnboundLocalError
UnicodeError
UnicodeEncodeError
UnicodeDecodeError
UnicodeTranslateError
ValueError
ZeroDivisionError
EnvironmentError
IOError
WindowsError
- Exceptions système
- Avertissements
- Exception groups
- Hiérarchie des exceptions
- Services de Manipulation de Texte
string
— Opérations usuelles sur des chaînesre
— Opérations à base d'expressions rationnellesdifflib
— Utilitaires pour le calcul des deltasDiffer
HtmlDiff
context_diff()
get_close_matches()
ndiff()
restore()
unified_diff()
diff_bytes()
IS_LINE_JUNK()
IS_CHARACTER_JUNK()
- SequenceMatcher Objects
SequenceMatcher
SequenceMatcher.set_seqs()
SequenceMatcher.set_seq1()
SequenceMatcher.set_seq2()
SequenceMatcher.find_longest_match()
SequenceMatcher.get_matching_blocks()
SequenceMatcher.get_opcodes()
SequenceMatcher.get_grouped_opcodes()
SequenceMatcher.ratio()
SequenceMatcher.quick_ratio()
SequenceMatcher.real_quick_ratio()
- SequenceMatcher Examples
- Differ Objects
- Differ Example
- A command-line interface to difflib
- ndiff example
textwrap
--- Encapsulation et remplissage de textewrap()
fill()
shorten()
dedent()
indent()
TextWrapper
TextWrapper.width
TextWrapper.expand_tabs
TextWrapper.tabsize
TextWrapper.replace_whitespace
TextWrapper.drop_whitespace
TextWrapper.initial_indent
TextWrapper.subsequent_indent
TextWrapper.fix_sentence_endings
TextWrapper.break_long_words
TextWrapper.break_on_hyphens
TextWrapper.max_lines
TextWrapper.placeholder
TextWrapper.wrap()
TextWrapper.fill()
unicodedata
— Base de données Unicodestringprep
— Préparation des chaines de caractères internetreadline
— interface pour GNU readlinerlcompleter
— Fonction de complétion pour GNU readline
- Services autour des Données Binaires
struct
— manipulation de données agrégées sous forme binaire comme une séquence d'octetscodecs
— Registre des codecs et classes de base associéesencode()
decode()
lookup()
CodecInfo
getencoder()
getdecoder()
getincrementalencoder()
getincrementaldecoder()
getreader()
getwriter()
register()
unregister()
open()
EncodedFile()
iterencode()
iterdecode()
BOM
BOM_BE
BOM_LE
BOM_UTF8
BOM_UTF16
BOM_UTF16_BE
BOM_UTF16_LE
BOM_UTF32
BOM_UTF32_BE
BOM_UTF32_LE
- Classes de base de codecs
- Encodings and Unicode
- Standard Encodings
- Python Specific Encodings
encodings.idna
--- Internationalized Domain Names in Applicationsencodings.mbcs
--- Windows ANSI codepageencodings.utf_8_sig
--- UTF-8 codec with BOM signature
- Types de données
datetime
— Types de base pour la date et l'heure- Objets avisés et naïfs
- Constantes
- Types disponibles
- Objets
timedelta
- Objets
date
date
date.today()
date.fromtimestamp()
date.fromordinal()
date.fromisoformat()
date.fromisocalendar()
date.min
date.max
date.resolution
date.year
date.month
date.day
date.replace()
date.timetuple()
date.toordinal()
date.weekday()
date.isoweekday()
date.isocalendar()
date.isoformat()
date.__str__()
date.ctime()
date.strftime()
date.__format__()
- Exemple d'utilisation de la classe
date
:
- Objets
datetime
datetime
datetime.today()
datetime.now()
datetime.utcnow()
datetime.fromtimestamp()
datetime.utcfromtimestamp()
datetime.fromordinal()
datetime.combine()
datetime.fromisoformat()
datetime.fromisocalendar()
datetime.strptime()
datetime.min
datetime.max
datetime.resolution
datetime.year
datetime.month
datetime.day
datetime.hour
datetime.minute
datetime.second
datetime.microsecond
datetime.tzinfo
datetime.fold
datetime.date()
datetime.time()
datetime.timetz()
datetime.replace()
datetime.astimezone()
datetime.utcoffset()
datetime.dst()
datetime.tzname()
datetime.timetuple()
datetime.utctimetuple()
datetime.toordinal()
datetime.timestamp()
datetime.weekday()
datetime.isoweekday()
datetime.isocalendar()
datetime.isoformat()
datetime.__str__()
datetime.ctime()
datetime.strftime()
datetime.__format__()
- Exemple d'utilisation de la classe
datetime
:
- Objets
time
- Objets
tzinfo
- Objets
timezone
- Comportement de
strftime()
etstrptime()
zoneinfo
— Prise en charge des fuseaux horaires IANAcalendar
— Fonctions calendaires généralesDay
Month
Calendar
Calendar.iterweekdays()
Calendar.itermonthdates()
Calendar.itermonthdays()
Calendar.itermonthdays2()
Calendar.itermonthdays3()
Calendar.itermonthdays4()
Calendar.monthdatescalendar()
Calendar.monthdays2calendar()
Calendar.monthdayscalendar()
Calendar.yeardatescalendar()
Calendar.yeardays2calendar()
Calendar.yeardayscalendar()
TextCalendar
HTMLCalendar
LocaleTextCalendar
LocaleHTMLCalendar
setfirstweekday()
firstweekday()
isleap()
leapdays()
weekday()
weekheader()
monthrange()
monthcalendar()
prmonth()
month()
prcal()
calendar()
timegm()
day_name
day_abbr
month_name
month_abbr
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
collections
— Types de données de conteneurscollections.abc
--- Classes de base abstraites pour les conteneursheapq
— File de priorité basée sur un tasbisect
— Algorithme de bissection de listesarray
— Tableaux efficaces de valeurs numériquestypecodes
array
array.typecode
array.itemsize
array.append()
array.buffer_info()
array.byteswap()
array.count()
array.extend()
array.frombytes()
array.fromfile()
array.fromlist()
array.fromunicode()
array.index()
array.insert()
array.pop()
array.remove()
array.reverse()
array.tobytes()
array.tofile()
array.tolist()
array.tounicode()
weakref
--- Weak referencestypes
--- Dynamic type creation and names for built-in types- Dynamic Type Creation
- Standard Interpreter Types
NoneType
FunctionType
LambdaType
GeneratorType
CoroutineType
AsyncGeneratorType
CodeType
CellType
MethodType
BuiltinFunctionType
BuiltinMethodType
WrapperDescriptorType
MethodWrapperType
NotImplementedType
MethodDescriptorType
ClassMethodDescriptorType
ModuleType
EllipsisType
GenericAlias
UnionType
TracebackType
FrameType
GetSetDescriptorType
MemberDescriptorType
MappingProxyType
- Additional Utility Classes and Functions
- Coroutine Utility Functions
copy
— Opérations de copie superficielle et récursivepprint
— L’affichage élégant de donnéesreprlib
--- Alternaterepr()
implementationenum
— Énumérationsgraphlib
— Fonctionnalités pour travailler avec des structures de type graphe
- Modules numériques et mathématiques
numbers
— Classes de base abstraites numériques- Fonctions mathématiques —
math
- Fonctions mathématiques pour nombres complexes —
cmath
decimal
— Arithmétique décimale en virgule fixe et flottante- Introduction pratique
- Les objets Decimal
Decimal
Decimal.adjusted()
Decimal.as_integer_ratio()
Decimal.as_tuple()
Decimal.canonical()
Decimal.compare()
Decimal.compare_signal()
Decimal.compare_total()
Decimal.compare_total_mag()
Decimal.conjugate()
Decimal.copy_abs()
Decimal.copy_negate()
Decimal.copy_sign()
Decimal.exp()
Decimal.from_float()
Decimal.fma()
Decimal.is_canonical()
Decimal.is_finite()
Decimal.is_infinite()
Decimal.is_nan()
Decimal.is_normal()
Decimal.is_qnan()
Decimal.is_signed()
Decimal.is_snan()
Decimal.is_subnormal()
Decimal.is_zero()
Decimal.ln()
Decimal.log10()
Decimal.logb()
Decimal.logical_and()
Decimal.logical_invert()
Decimal.logical_or()
Decimal.logical_xor()
Decimal.max()
Decimal.max_mag()
Decimal.min()
Decimal.min_mag()
Decimal.next_minus()
Decimal.next_plus()
Decimal.next_toward()
Decimal.normalize()
Decimal.number_class()
Decimal.quantize()
Decimal.radix()
Decimal.remainder_near()
Decimal.rotate()
Decimal.same_quantum()
Decimal.scaleb()
Decimal.shift()
Decimal.sqrt()
Decimal.to_eng_string()
Decimal.to_integral()
Decimal.to_integral_exact()
Decimal.to_integral_value()
- Opérandes logiques
- Objets de contexte
getcontext()
setcontext()
localcontext()
BasicContext
ExtendedContext
DefaultContext
Context
Context.clear_flags()
Context.clear_traps()
Context.copy()
Context.copy_decimal()
Context.create_decimal()
Context.create_decimal_from_float()
Context.Etiny()
Context.Etop()
Context.abs()
Context.add()
Context.canonical()
Context.compare()
Context.compare_signal()
Context.compare_total()
Context.compare_total_mag()
Context.copy_abs()
Context.copy_negate()
Context.copy_sign()
Context.divide()
Context.divide_int()
Context.divmod()
Context.exp()
Context.fma()
Context.is_canonical()
Context.is_finite()
Context.is_infinite()
Context.is_nan()
Context.is_normal()
Context.is_qnan()
Context.is_signed()
Context.is_snan()
Context.is_subnormal()
Context.is_zero()
Context.ln()
Context.log10()
Context.logb()
Context.logical_and()
Context.logical_invert()
Context.logical_or()
Context.logical_xor()
Context.max()
Context.max_mag()
Context.min()
Context.min_mag()
Context.minus()
Context.multiply()
Context.next_minus()
Context.next_plus()
Context.next_toward()
Context.normalize()
Context.number_class()
Context.plus()
Context.power()
Context.quantize()
Context.radix()
Context.remainder()
Context.remainder_near()
Context.rotate()
Context.same_quantum()
Context.scaleb()
Context.shift()
Context.sqrt()
Context.subtract()
Context.to_eng_string()
Context.to_integral_exact()
Context.to_sci_string()
- Constantes
- Modes d'arrondi
- Signaux
- Floating Point Notes
- Working with threads
- Cas pratiques
- FAQ decimal
fractions
— Nombres rationnelsrandom
--- Génère des nombres pseudo-aléatoiresstatistics
— Fonctions mathématiques pour les statistiques
- Modules de programmation fonctionnelle
itertools
— Fonctions créant des itérateurs pour boucler efficacementfunctools
— Fonctions d'ordre supérieur et opérations sur des objets appelablesoperator
— Opérateurs standards en tant que fonctionslt()
le()
eq()
ne()
ge()
gt()
__lt__()
__le__()
__eq__()
__ne__()
__ge__()
__gt__()
not_()
__not__()
truth()
is_()
is_not()
abs()
__abs__()
add()
__add__()
and_()
__and__()
floordiv()
__floordiv__()
index()
__index__()
inv()
invert()
__inv__()
__invert__()
lshift()
__lshift__()
mod()
__mod__()
mul()
__mul__()
matmul()
__matmul__()
neg()
__neg__()
or_()
__or__()
pos()
__pos__()
pow()
__pow__()
rshift()
__rshift__()
sub()
__sub__()
truediv()
__truediv__()
xor()
__xor__()
concat()
__concat__()
contains()
__contains__()
countOf()
delitem()
__delitem__()
getitem()
__getitem__()
indexOf()
setitem()
__setitem__()
length_hint()
call()
__call__()
attrgetter()
itemgetter()
methodcaller()
- Correspondances entre opérateurs et fonctions
- Opérateurs en-place
- Accès aux Fichiers et aux Dossiers
pathlib
— Chemins de système de fichiers orientés objet- Utilisation basique
- Chemins purs
PurePath
PurePosixPath
PureWindowsPath
- Propriétés générales
- Opérateurs
- Accéder aux parties individuelles
- Méthodes et propriétés
PurePath.drive
PurePath.root
PurePath.anchor
PurePath.parents
PurePath.parent
PurePath.name
PurePath.suffix
PurePath.suffixes
PurePath.stem
PurePath.as_posix()
PurePath.as_uri()
PurePath.is_absolute()
PurePath.is_relative_to()
PurePath.is_reserved()
PurePath.joinpath()
PurePath.match()
PurePath.relative_to()
PurePath.with_name()
PurePath.with_stem()
PurePath.with_suffix()
PurePath.with_segments()
- Chemins concrets
Path
PosixPath
WindowsPath
- Méthodes
Path.cwd()
Path.home()
Path.stat()
Path.chmod()
Path.exists()
Path.expanduser()
Path.glob()
Path.group()
Path.is_dir()
Path.is_file()
Path.is_junction()
Path.is_mount()
Path.is_symlink()
Path.is_socket()
Path.is_fifo()
Path.is_block_device()
Path.is_char_device()
Path.iterdir()
Path.walk()
Path.lchmod()
Path.lstat()
Path.mkdir()
Path.open()
Path.owner()
Path.read_bytes()
Path.read_text()
Path.readlink()
Path.rename()
Path.replace()
Path.absolute()
Path.resolve()
Path.rglob()
Path.rmdir()
Path.samefile()
Path.symlink_to()
Path.hardlink_to()
Path.touch()
Path.unlink()
Path.write_bytes()
Path.write_text()
- Correspondance des outils du module
os
os.path
— manipulation courante des cheminsabspath()
basename()
commonpath()
commonprefix()
dirname()
exists()
lexists()
expanduser()
expandvars()
getatime()
getmtime()
getctime()
getsize()
isabs()
isfile()
isdir()
isjunction()
islink()
ismount()
join()
normcase()
normpath()
realpath()
relpath()
samefile()
sameopenfile()
samestat()
split()
splitdrive()
splitroot()
splitext()
supports_unicode_filenames
fileinput
— Parcourt les lignes provenant de plusieurs entréesstat
--- Interpretingstat()
resultsS_ISDIR()
S_ISCHR()
S_ISBLK()
S_ISREG()
S_ISFIFO()
S_ISLNK()
S_ISSOCK()
S_ISDOOR()
S_ISPORT()
S_ISWHT()
S_IMODE()
S_IFMT()
filemode()
ST_MODE
ST_INO
ST_DEV
ST_NLINK
ST_UID
ST_GID
ST_SIZE
ST_ATIME
ST_MTIME
ST_CTIME
S_IFSOCK
S_IFLNK
S_IFREG
S_IFBLK
S_IFDIR
S_IFCHR
S_IFIFO
S_IFDOOR
S_IFPORT
S_IFWHT
S_ISUID
S_ISGID
S_ISVTX
S_IRWXU
S_IRUSR
S_IWUSR
S_IXUSR
S_IRWXG
S_IRGRP
S_IWGRP
S_IXGRP
S_IRWXO
S_IROTH
S_IWOTH
S_IXOTH
S_ENFMT
S_IREAD
S_IWRITE
S_IEXEC
UF_NODUMP
UF_IMMUTABLE
UF_APPEND
UF_OPAQUE
UF_NOUNLINK
UF_COMPRESSED
UF_HIDDEN
SF_ARCHIVED
SF_IMMUTABLE
SF_APPEND
SF_NOUNLINK
SF_SNAPSHOT
FILE_ATTRIBUTE_ARCHIVE
FILE_ATTRIBUTE_COMPRESSED
FILE_ATTRIBUTE_DEVICE
FILE_ATTRIBUTE_DIRECTORY
FILE_ATTRIBUTE_ENCRYPTED
FILE_ATTRIBUTE_HIDDEN
FILE_ATTRIBUTE_INTEGRITY_STREAM
FILE_ATTRIBUTE_NORMAL
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
FILE_ATTRIBUTE_NO_SCRUB_DATA
FILE_ATTRIBUTE_OFFLINE
FILE_ATTRIBUTE_READONLY
FILE_ATTRIBUTE_REPARSE_POINT
FILE_ATTRIBUTE_SPARSE_FILE
FILE_ATTRIBUTE_SYSTEM
FILE_ATTRIBUTE_TEMPORARY
FILE_ATTRIBUTE_VIRTUAL
IO_REPARSE_TAG_SYMLINK
IO_REPARSE_TAG_MOUNT_POINT
IO_REPARSE_TAG_APPEXECLINK
filecmp
– Comparaisons de fichiers et de répertoirescmp()
cmpfiles()
clear_cache()
- La classe
dircmp
dircmp
dircmp.report()
dircmp.report_partial_closure()
dircmp.report_full_closure()
dircmp.left
dircmp.right
dircmp.left_list
dircmp.right_list
dircmp.common
dircmp.left_only
dircmp.right_only
dircmp.common_dirs
dircmp.common_files
dircmp.common_funny
dircmp.same_files
dircmp.diff_files
dircmp.funny_files
dircmp.subdirs
DEFAULT_IGNORES
tempfile
— Génération de fichiers et répertoires temporairesglob
— Recherche de chemins de style Unix selon certains motifsfnmatch
— Filtrage par motif des noms de fichiers Unixlinecache
— Accès direct aux lignes d'un texteshutil
--- Opérations de haut niveau sur les fichiers
- Persistance des données
pickle
— Sérialisation d'objets Python- Relations aux autres modules Python
- Format du flux de données
- Interface du module
- Quels objets sont sérialisables ?
- Sérialisation des instances d'une classe
- Réduction personnalisée pour les types, fonctions et autres objets
- Tampons hors-bande
- Restriction des noms dans l'espace de nommage global
- Performances
- Exemples
copyreg
— Enregistre les fonctions support depickle
shelve
— Persistance d’un objet Pythonmarshal
— Sérialisation interne des objets Pythondbm
--- Interfaces to Unix "databases"sqlite3
— Interface DB-API 2.0 pour bases de données SQLite- Tutoriel
- Références
- Fonctions du module
- Fonctions et constantes du module
LEGACY_TRANSACTION_CONTROL
PARSE_COLNAMES
PARSE_DECLTYPES
SQLITE_OK
SQLITE_DENY
SQLITE_IGNORE
apilevel
paramstyle
sqlite_version
sqlite_version_info
threadsafety
version
version_info
SQLITE_DBCONFIG_DEFENSIVE
SQLITE_DBCONFIG_DQS_DDL
SQLITE_DBCONFIG_DQS_DML
SQLITE_DBCONFIG_ENABLE_FKEY
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
SQLITE_DBCONFIG_ENABLE_QPSG
SQLITE_DBCONFIG_ENABLE_TRIGGER
SQLITE_DBCONFIG_ENABLE_VIEW
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
SQLITE_DBCONFIG_RESET_DATABASE
SQLITE_DBCONFIG_TRIGGER_EQP
SQLITE_DBCONFIG_TRUSTED_SCHEMA
SQLITE_DBCONFIG_WRITABLE_SCHEMA
- Connection objects
Connection
Connection.cursor()
Connection.blobopen()
Connection.commit()
Connection.rollback()
Connection.close()
Connection.execute()
Connection.executemany()
Connection.executescript()
Connection.create_function()
Connection.create_aggregate()
Connection.create_window_function()
Connection.create_collation()
Connection.interrupt()
Connection.set_authorizer()
Connection.set_progress_handler()
Connection.set_trace_callback()
Connection.enable_load_extension()
Connection.load_extension()
Connection.iterdump()
Connection.backup()
Connection.getlimit()
Connection.setlimit()
Connection.getconfig()
Connection.setconfig()
Connection.serialize()
Connection.deserialize()
Connection.autocommit
Connection.in_transaction
Connection.isolation_level
Connection.row_factory
Connection.text_factory
Connection.total_changes
- Cursor objects
- Row objects
- Blob objects
- PrepareProtocol objects
- Exceptions
- SQLite and Python types
- Default adapters and converters (deprecated)
- Command-line interface
- How-to guides
- How to use placeholders to bind values in SQL queries
- How to adapt custom Python types to SQLite values
- How to convert SQLite values to custom Python types
- Adapter and converter recipes
- How to use connection shortcut methods
- How to use the connection context manager
- How to work with SQLite URIs
- How to create and use row factories
- Explanation
- Compression de donnée et archivage
zlib
— Compression compatible avec gzipgzip
— Support pour les fichiers gzipbz2
— Prise en charge de la compression bzip2lzma
— Compression via l'algorithme LZMAzipfile
— Travailler avec des archives ZIPBadZipFile
BadZipfile
LargeZipFile
ZipInfo
is_zipfile()
ZIP_STORED
ZIP_DEFLATED
ZIP_BZIP2
ZIP_LZMA
- Objets ZipFile
- Objets Path
- Objets PyZipFile
- Objets ZipInfo
ZipInfo.from_file()
ZipInfo.is_dir()
ZipInfo.filename
ZipInfo.date_time
ZipInfo.compress_type
ZipInfo.comment
ZipInfo.extra
ZipInfo.create_system
ZipInfo.create_version
ZipInfo.extract_version
ZipInfo.reserved
ZipInfo.flag_bits
ZipInfo.volume
ZipInfo.internal_attr
ZipInfo.external_attr
ZipInfo.header_offset
ZipInfo.CRC
ZipInfo.compress_size
ZipInfo.file_size
- Interface en ligne de commande
- Problèmes de décompression
tarfile
— Lecture et écriture de fichiers d'archives taropen()
is_tarfile()
TarError
ReadError
CompressionError
StreamError
ExtractError
HeaderError
FilterError
AbsolutePathError
OutsideDestinationError
SpecialFileError
AbsoluteLinkError
LinkOutsideDestinationError
ENCODING
USTAR_FORMAT
GNU_FORMAT
PAX_FORMAT
DEFAULT_FORMAT
- Les objets TarFile
- Les objets TarInfo
TarInfo
TarInfo.frombuf()
TarInfo.fromtarfile()
TarInfo.tobuf()
TarInfo.name
TarInfo.size
TarInfo.mtime
TarInfo.mode
TarInfo.type
TarInfo.linkname
TarInfo.uid
TarInfo.gid
TarInfo.uname
TarInfo.gname
TarInfo.pax_headers
TarInfo.isfile()
TarInfo.isreg()
TarInfo.isdir()
TarInfo.issym()
TarInfo.islnk()
TarInfo.ischr()
TarInfo.isblk()
TarInfo.isfifo()
TarInfo.isdev()
- Extraction filters
- Interface en ligne de commande
- Exemples
- Formats tar pris en charge
- Problèmes unicode
- Formats de fichiers
csv
— Lecture et écriture de fichiers CSVconfigparser
— Lecture et écriture de fichiers de configuration- Premiers pas
- Types de données prises en charge
- Valeurs de substitution
- Structure des fichiers INI prise en change
- Interpolation des valeurs
- Protocole d'accès associatif
- Personnalisation du comportement de l'analyseur
- Legacy API Examples
- ConfigParser Objects
ConfigParser
ConfigParser.defaults()
ConfigParser.sections()
ConfigParser.add_section()
ConfigParser.has_section()
ConfigParser.options()
ConfigParser.has_option()
ConfigParser.read()
ConfigParser.read_file()
ConfigParser.read_string()
ConfigParser.read_dict()
ConfigParser.get()
ConfigParser.getint()
ConfigParser.getfloat()
ConfigParser.getboolean()
ConfigParser.items()
ConfigParser.set()
ConfigParser.write()
ConfigParser.remove_option()
ConfigParser.remove_section()
ConfigParser.optionxform()
MAX_INTERPOLATION_DEPTH
- RawConfigParser Objects
- Exceptions
tomllib
--- Parse TOML filesnetrc
— traitement de fichier netrcplistlib
--- Generate and parse Apple.plist
files
- Service de cryptographie
hashlib
--- Algorithmes de hachage sécurisés et synthèse de messageshmac
— Authentification de messages par hachage en combinaison avec une clé secrètesecrets
— Générer des nombres aléatoires de façon sécurisée pour la gestion des secrets
- Services génériques du système d'exploitation
os
— Diverses interfaces pour le système d'exploitationerror
name
- Noms de fichiers, arguments en ligne de commande, et variables d'environnement
- Python UTF-8 Mode
- Paramètres de processus
ctermid()
environ
environb
fsencode()
fsdecode()
fspath()
PathLike
getenv()
getenvb()
get_exec_path()
getegid()
geteuid()
getgid()
getgrouplist()
getgroups()
getlogin()
getpgid()
getpgrp()
getpid()
getppid()
getpriority()
PRIO_PROCESS
PRIO_PGRP
PRIO_USER
PRIO_DARWIN_THREAD
PRIO_DARWIN_PROCESS
PRIO_DARWIN_BG
PRIO_DARWIN_NONUI
getresuid()
getresgid()
getuid()
initgroups()
putenv()
setegid()
seteuid()
setgid()
setgroups()
setns()
setpgrp()
setpgid()
setpriority()
setregid()
setresgid()
setresuid()
setreuid()
getsid()
setsid()
setuid()
strerror()
supports_bytes_environ
umask()
uname()
unsetenv()
unshare()
CLONE_FILES
CLONE_FS
CLONE_NEWCGROUP
CLONE_NEWIPC
CLONE_NEWNET
CLONE_NEWNS
CLONE_NEWPID
CLONE_NEWTIME
CLONE_NEWUSER
CLONE_NEWUTS
CLONE_SIGHAND
CLONE_SYSVSEM
CLONE_THREAD
CLONE_VM
- Création de fichiers objets
- Opérations sur les descripteurs de fichiers
close()
closerange()
copy_file_range()
device_encoding()
dup()
dup2()
fchmod()
fchown()
fdatasync()
fpathconf()
fstat()
fstatvfs()
fsync()
ftruncate()
get_blocking()
isatty()
lockf()
F_LOCK
F_TLOCK
F_ULOCK
F_TEST
login_tty()
lseek()
SEEK_SET
SEEK_CUR
SEEK_END
open()
O_RDONLY
O_WRONLY
O_RDWR
O_APPEND
O_CREAT
O_EXCL
O_TRUNC
O_DSYNC
O_RSYNC
O_SYNC
O_NDELAY
O_NONBLOCK
O_NOCTTY
O_CLOEXEC
O_BINARY
O_NOINHERIT
O_SHORT_LIVED
O_TEMPORARY
O_RANDOM
O_SEQUENTIAL
O_TEXT
O_EVTONLY
O_FSYNC
O_SYMLINK
O_NOFOLLOW_ANY
O_ASYNC
O_DIRECT
O_DIRECTORY
O_NOFOLLOW
O_NOATIME
O_PATH
O_TMPFILE
O_SHLOCK
O_EXLOCK
openpty()
pipe()
pipe2()
posix_fallocate()
posix_fadvise()
POSIX_FADV_NORMAL
POSIX_FADV_SEQUENTIAL
POSIX_FADV_RANDOM
POSIX_FADV_NOREUSE
POSIX_FADV_WILLNEED
POSIX_FADV_DONTNEED
pread()
preadv()
RWF_NOWAIT
RWF_HIPRI
pwrite()
pwritev()
RWF_DSYNC
RWF_SYNC
RWF_APPEND
read()
sendfile()
set_blocking()
SF_NODISKIO
SF_MNOWAIT
SF_SYNC
SF_NOCACHE
splice()
SPLICE_F_MOVE
SPLICE_F_NONBLOCK
SPLICE_F_MORE
readv()
tcgetpgrp()
tcsetpgrp()
ttyname()
write()
writev()
- Demander la taille d'un terminal
- Héritage de descripteurs de fichiers
- Fichiers et répertoires
access()
F_OK
R_OK
W_OK
X_OK
chdir()
chflags()
chmod()
chown()
chroot()
fchdir()
getcwd()
getcwdb()
lchflags()
lchmod()
lchown()
link()
listdir()
listdrives()
listmounts()
listvolumes()
lstat()
mkdir()
makedirs()
mkfifo()
mknod()
major()
minor()
makedev()
pathconf()
pathconf_names
readlink()
remove()
removedirs()
rename()
renames()
replace()
rmdir()
scandir()
DirEntry
stat()
stat_result
stat_result.st_mode
stat_result.st_ino
stat_result.st_dev
stat_result.st_nlink
stat_result.st_uid
stat_result.st_gid
stat_result.st_size
stat_result.st_atime
stat_result.st_mtime
stat_result.st_ctime
stat_result.st_atime_ns
stat_result.st_mtime_ns
stat_result.st_ctime_ns
stat_result.st_birthtime
stat_result.st_birthtime_ns
stat_result.st_blocks
stat_result.st_blksize
stat_result.st_rdev
stat_result.st_flags
stat_result.st_gen
stat_result.st_fstype
stat_result.st_rsize
stat_result.st_creator
stat_result.st_type
stat_result.st_file_attributes
stat_result.st_reparse_tag
statvfs()
supports_dir_fd
supports_effective_ids
supports_fd
supports_follow_symlinks
symlink()
sync()
truncate()
unlink()
utime()
walk()
fwalk()
memfd_create()
MFD_CLOEXEC
MFD_ALLOW_SEALING
MFD_HUGETLB
MFD_HUGE_SHIFT
MFD_HUGE_MASK
MFD_HUGE_64KB
MFD_HUGE_512KB
MFD_HUGE_1MB
MFD_HUGE_2MB
MFD_HUGE_8MB
MFD_HUGE_16MB
MFD_HUGE_32MB
MFD_HUGE_256MB
MFD_HUGE_512MB
MFD_HUGE_1GB
MFD_HUGE_2GB
MFD_HUGE_16GB
eventfd()
eventfd_read()
eventfd_write()
EFD_CLOEXEC
EFD_NONBLOCK
EFD_SEMAPHORE
- Attributs étendus pour Linux
- Gestion des processus
abort()
add_dll_directory()
execl()
execle()
execlp()
execlpe()
execv()
execve()
execvp()
execvpe()
_exit()
EX_OK
EX_USAGE
EX_DATAERR
EX_NOINPUT
EX_NOUSER
EX_NOHOST
EX_UNAVAILABLE
EX_SOFTWARE
EX_OSERR
EX_OSFILE
EX_CANTCREAT
EX_IOERR
EX_TEMPFAIL
EX_PROTOCOL
EX_NOPERM
EX_CONFIG
EX_NOTFOUND
fork()
forkpty()
kill()
killpg()
nice()
pidfd_open()
PIDFD_NONBLOCK
plock()
popen()
posix_spawn()
POSIX_SPAWN_OPEN
POSIX_SPAWN_CLOSE
POSIX_SPAWN_DUP2
posix_spawnp()
register_at_fork()
spawnl()
spawnle()
spawnlp()
spawnlpe()
spawnv()
spawnve()
spawnvp()
spawnvpe()
P_NOWAIT
P_NOWAITO
P_WAIT
P_DETACH
P_OVERLAY
startfile()
system()
times()
wait()
waitid()
waitpid()
wait3()
wait4()
P_PID
P_PGID
P_ALL
P_PIDFD
WCONTINUED
WEXITED
WSTOPPED
WUNTRACED
WNOHANG
WNOWAIT
CLD_EXITED
CLD_KILLED
CLD_DUMPED
CLD_TRAPPED
CLD_STOPPED
CLD_CONTINUED
waitstatus_to_exitcode()
WCOREDUMP()
WIFCONTINUED()
WIFSTOPPED()
WIFSIGNALED()
WIFEXITED()
WEXITSTATUS()
WSTOPSIG()
WTERMSIG()
- Interface pour l'ordonnanceur
SCHED_OTHER
SCHED_BATCH
SCHED_IDLE
SCHED_SPORADIC
SCHED_FIFO
SCHED_RR
SCHED_RESET_ON_FORK
sched_param
sched_get_priority_min()
sched_get_priority_max()
sched_setscheduler()
sched_getscheduler()
sched_setparam()
sched_getparam()
sched_rr_get_interval()
sched_yield()
sched_setaffinity()
sched_getaffinity()
- Diverses informations sur le système
- Nombres aléatoires
io
--- Core tools for working with streamstime
— Accès au temps et conversions- Fonctions
asctime()
pthread_getcpuclockid()
clock_getres()
clock_gettime()
clock_gettime_ns()
clock_settime()
clock_settime_ns()
ctime()
get_clock_info()
gmtime()
localtime()
mktime()
monotonic()
monotonic_ns()
perf_counter()
perf_counter_ns()
process_time()
process_time_ns()
sleep()
strftime()
strptime()
struct_time
time()
time_ns()
thread_time()
thread_time_ns()
tzset()
- Constantes d’identification d’horloge
- Constantes de fuseau horaire
- Fonctions
argparse
-- Analyseur d'arguments, d'options, et de sous-commandes de ligne de commande- Fonctionnalité principale
- Référence pour
add_argument()
- Exemple
- Objets
ArgumentParser
ArgumentParser
- Le paramètre prog
- Le paramètre usage
- Le paramètre description
- Le paramètre epilog
- Le paramètre parents
- Le paramètre formatter_class
- Le paramètre prefix_chars
- Le paramètre fromfile_prefix_chars
- Le paramètre argument_default
- Le paramètre allow_abbrev
- Le paramètre conflict_handler
- Le paramètre add_help
- Le paramètre exit_on_error
- La méthode add_argument()
- La méthode parse_args()
- Autres outils
- Mettre à jour du code
optparse
- Exceptions
getopt
– Analyseur de style C pour les options de ligne de commandelogging
— Fonctionnalités de journalisation pour Python- Enregistreurs
Logger
Logger.propagate
Logger.setLevel()
Logger.isEnabledFor()
Logger.getEffectiveLevel()
Logger.getChild()
Logger.getChildren()
Logger.debug()
Logger.info()
Logger.warning()
Logger.error()
Logger.critical()
Logger.log()
Logger.exception()
Logger.addFilter()
Logger.removeFilter()
Logger.filter()
Logger.addHandler()
Logger.removeHandler()
Logger.findCaller()
Logger.handle()
Logger.makeRecord()
Logger.hasHandlers()
- Niveaux de journalisation
- Gestionnaires
- Formateurs
- Filtres
- Objets LogRecord
- LogRecord attributes
- LoggerAdapter Objects
- Thread Safety
- Fonctions de niveau module
- Module-Level Attributes
- Integration with the warnings module
- Enregistreurs
logging.config
--- Logging configurationlogging.handlers
— Gestionnaires de journalisation