On this page
pkgutil.read_code
Prev: pkgutil.ModuleInfo | Up: pkgutil | Next: pkgutil.walk_packages
Rel: pkgutil.extend_path, pkgutil.get_data, pkgutil.get_importer, pkgutil.iter_importers
Ref: docs.python.org — pkgutil.read_code
Tags: #public #python3 #stdlib #pkgutil
Import
import pkgutil
from pkgutil import read_code
Signature & Overview
pkgutil.read_code(stream)
pkgutil.read_code() function.
Usage
import pkgutil
# Reads a code object from an open .pyc file stream
assert callable(pkgutil.read_code)
Gotchas
- Low-level helper for
.pycfiles; returnsNoneif the magic number doesn't match.
REPL Inspect
from pkgutil import read_code
help(read_code)
Linked from
Related notes
- tuts/python3/stdlib_module/pkgutil/ModuleInfo Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/walk_packages Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/pkgutil/extend_path Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/get_data Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/get_importer Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/iter_importers Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/iter_modules shared tags: #pkgutil, #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib