pydoc > xdrlib

๐Ÿ“› NAME

xdrlib โ€” Implements (a subset of) Sun XDR (eXternal Data Representation).

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ”ง Create a packerpacker = xdrlib.Packer()Initialise an XDR packer
๐Ÿ“ฆ Pack an integerpacker.pack_int(42)Encode a signed integer
๐Ÿ“ฆ Pack a stringpacker.pack_string("hello")Encode a variableโ€‘length string
๐Ÿ“ฆ Pack a floatpacker.pack_float(3.14)Encode a singleโ€‘precision float
๐Ÿ“ฆ Pack a doublepacker.pack_double(2.718)Encode a doubleโ€‘precision float
๐Ÿ“ฆ Pack an arraypacker.pack_array(my_list, packer.pack_int)Encode a variableโ€‘length array
๐Ÿ“ค Get packed bytesdata = packer.get_buffer()Retrieve the encoded data
๐Ÿ” Create an unpackerunpacker = xdrlib.Unpacker(data)Initialise an XDR unpacker
๐Ÿ“ฌ Unpack an integerunpacker.unpack_int()Decode a signed integer
๐Ÿ“ฌ Unpack a stringunpacker.unpack_string()Decode a variableโ€‘length string
๐Ÿ“ฌ Unpack a floatunpacker.unpack_float()Decode a singleโ€‘precision float
๐Ÿ“ฌ Unpack an arrayunpacker.unpack_array(unpacker.unpack_int)Decode a variableโ€‘length array
๐Ÿ”„ Reset packerpacker.reset()Clear the packer buffer
๐Ÿ”„ Reset unpackerunpacker.reset(data)Reset unpacker with new data

๐Ÿ“š MODULE REFERENCE

https://docs.python.org/3.10/library/xdrlib.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

๐Ÿ“– DESCRIPTION

See: RFC 1014

๐Ÿ›๏ธ CLASSES

builtins.Exception(builtins.BaseException) โ†’ Error โ†’ ConversionError
builtins.object โ†’ Packer
builtins.object โ†’ Unpacker

๐Ÿ› class ConversionError(Error)

ConversionError(msg)

Method resolution order:

Methods inherited from Error:

Data descriptors inherited from Error:

Static methods inherited from builtins.Exception:

Methods inherited from builtins.BaseException:

Data descriptors inherited from builtins.BaseException:

โš ๏ธ class Error(builtins.Exception)

Error(msg)

Exception class for this module. Use:

except xdrlib.Error as var:
    # var has the Error instance for the exception

Public ivars: msg โ€” contains the message

Method resolution order:

Methods defined here:

Data descriptors defined here:

Static methods inherited from builtins.Exception:

Methods inherited from builtins.BaseException:

Data descriptors inherited from builtins.BaseException:

๐Ÿ“ฆ class Packer(builtins.object)

Pack various data representations into a buffer.

Methods defined here:

Data descriptors defined here:

๐Ÿ“ฌ class Unpacker(builtins.object)

Unpacker(data)

Unpacks various data representations from the given buffer.

Methods defined here:

Data descriptors defined here:

๐Ÿ“ฆ DATA

__all__ = ['Error', 'Packer', 'Unpacker', 'ConversionError']

๐Ÿ“ FILE

/usr/lib/python3.10/xdrlib.py

xdrlib
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“š MODULE REFERENCE ๐Ÿ“– DESCRIPTION ๐Ÿ›๏ธ CLASSES
๐Ÿ› class ConversionError(Error) โš ๏ธ class Error(builtins.Exception) ๐Ÿ“ฆ class Packer(builtins.object) ๐Ÿ“ฌ class Unpacker(builtins.object)
๐Ÿ“ฆ DATA ๐Ÿ“ FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 12:15 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^