man decompyle2.2 (Commandes) - a Python byte-code decompiler

NAME

decompyle2.2 - a Python byte-code decompiler

SYNOPSIS

decompyle2.2 [ --verify ] [ --showasm ] [ --showast ] [ -o path ] file ...

decompyle2.2 --help

DESCRIPTION

Decompyle converts Python byte-code back into equivalent Python source.

decompyle2.2 is an old version that runs under Python 2.2 and only accepts byte-code from Python 1.5 to 2.2 inclusive. It cannot handle byte-code from Python 2.3 or above; for this, see the latest version which is available for Debian users in the decompyle package.

Whilst the latest decompyle has significant enhancements, it is possible that it may fail on some older bytecode where decompyle 2.2 was successful. For this reason, the older decompyle 2.2 remains available here.

The source generated by decompyle is very readable: docstrings, lists, tuples and hashes get pretty-printed.

Decompyle can also verify the equivalence of the generated source by compiling it and comparing the new byte-code with the original byte-code.

Generated files have the following extensions:

.dis
A successfully decompyled file (and successfully verified if --verify was used).
.dis_unverified
A successfully decompyled file for which --verify failed.
.nodis
A file for which the decompyle failed. Please report this bug to the author or to the Debian bug tracking system.

OPTIONS

A summary of options is included below.

-o path
Output decompyled files to the given path. If multiple input files are decompyled, the longest common prefix is stripped from their pathnames and the remainder appended to path (see the examples below for details).
--verify
Recompile generated sources and compare with the original input byte-code (requires -o).
--showasm
Include byte-code in the output (disables --verify).
--showast
Include the AST (abstract syntax tree) in the output (disables --verify).
--help
Print a usage message and exit.

EXAMPLES

To decompyle foo.pyc and bar.pyc to standard output:

example$ decompyle2.2 foo.pyc bar.pyc

To decompyle foo.pyc and bar.pyc to ./foo.dis and ./bar.dis:

example$ decompyle2.2 -o . foo.pyc bar.pyc

To decompyle bla/fasel.pyc and bla/foo.pyc into /tmp (creating /tmp/fasel.dis and /tmp/foo.dis):

example$ decompyle2.2 -o /tmp bla/fasel.pyc bla/foo.pyc

To decompyle bla/fasel.pyc and bar/foo.pyc into /tmp (creating /tmp/bla/fasel.dis and /tmp/bar/foo.dis):

example$ decompyle2.2 -o /tmp bla/fasel.pyc bar/foo.pyc

SEE ALSO

The original documentation from the program author is available in /usr/share/doc/decompyle2.2/.

AUTHOR

Decompyle was written by Hartmut Goebel <hartmut@goebel.noris.de> and John Aycock.

This manual page was prepared by Ben Burton <bab@debian.org> for the Debian GNU/Linux system (but may be used by others).