我想知道这可能是编译错误,还是我可以做些什么来阻止它显示.我为cmd制作了一个argparse程序.我使用py2exe编译它,当我运行它时,它正确地执行程序,但在运行代码之前总是会出现此错误:
Traceback (most recent call last):
File "boot_common.py", line 46, in <module>
ImportError: No module named 'ctypes'
Run Code Online (Sandbox Code Playgroud)
如果它是我的代码中的东西,这是我的脚本:
import argparse
import zipfile
import os
from contextlib import closing
def parse_args():
parser = argparse.ArgumentParser('ziputil '+\
'-m <mode> -f <file> -p <output>')
parser.add_argument('-f', action="store", dest='files', type=str,
help='-f <file> : Specify the files to be zipped, or the .zip to be unzipped.')
parser.add_argument('-m', action="store", dest='mode', type=str,
help='-m <mode> : Zip to zip files, UnZip, to unzip files, or ZipDir to zip entire directories.') …Run Code Online (Sandbox Code Playgroud)