在Python 3.7.1上,我尝试使用unpy2exe反编译.exe程序。不幸的是,我收到此错误“出现错误:'模块'对象不可调用”
有人知道如何解决吗?
from __future__ import print_function
import argparse
import logging
import unpy2exe
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Extract pyc files from py2exe executable.')
parser.add_argument('filename', help='The py2exe executable')
parser.add_argument(
'-o', '--output-dir', default='.',
help="Output directory")
parser.add_argument(
'-p', '--python-version', default=None,
help="Python major version for pyc (ie: X.Y)")
parser.add_argument(
'-v', '--verbose', help="Verbose output", action="store_true")
args = vars(parser.parse_args())
if args.pop('verbose', False):
logging.basicConfig(format='%(message)s', level=logging.INFO)
try:
unpy2exe(**args)
except Exception as e:
print('There was an error:', str(e))
答案 0 :(得分:0)
您需要在导入的unpy2exe
模块中调用一个函数。使用:
unpy2exe.unpy2exe(*args)