我们从Python开源项目中,提取了以下24个代码示例,用于说明如何使用scapy.all.py()。
def import_module(name): name = os.path.realpath(name) thepath = os.path.dirname(name) name = os.path.basename(name) if name.endswith(".py"): name = name[:-3] f,path,desc = imp.find_module(name,[thepath]) try: return imp.load_module(name, f, path, desc) finally: if f: f.close() #### INTERNAL/EXTERNAL FILE EMBEDDING ####
def usage(): print >>sys.stderr,"""Usage: UTscapy [-m module] [-f {text|ansi|HTML|LaTeX}] [-o output_file] [-t testfile] [-k keywords [-k ...]] [-K keywords [-K ...]] [-l] [-d|-D] [-F] [-q[q]] [-P preexecute_python_code] [-s /path/to/scpay] -l\t\t: generate local files -F\t\t: expand only failed tests -d\t\t: dump campaign -D\t\t: dump campaign and stop -C\t\t: don't calculate CRC and SHA -s\t\t: path to scapy.py -q\t\t: quiet mode -qq\t\t: [silent mode] -n <testnum>\t: only tests whose numbers are given (eg. 1,3-7,12) -m <module>\t: additional module to put in the namespace -k <kw1>,<kw2>,...\t: include only tests with one of those keywords (can be used many times) -K <kw1>,<kw2>,...\t: remove tests with one of those keywords (can be used many times) -P <preexecute_python_code> """ raise SystemExit #### MAIN ####
def usage(): print("""Usage: UTscapy [-m module] [-f {text|ansi|HTML|LaTeX}] [-o output_file] [-t testfile] [-k keywords [-k ...]] [-K keywords [-K ...]] [-l] [-d|-D] [-F] [-q[q]] [-P preexecute_python_code] [-s /path/to/scpay] -l\t\t: generate local files -F\t\t: expand only failed tests -d\t\t: dump campaign -D\t\t: dump campaign and stop -C\t\t: don't calculate CRC and SHA -s\t\t: path to scapy.py -q\t\t: quiet mode -qq\t\t: [silent mode] -n <testnum>\t: only tests whose numbers are given (eg. 1,3-7,12) -m <module>\t: additional module to put in the namespace -k <kw1>,<kw2>,...\t: include only tests with one of those keywords (can be used many times) -K <kw1>,<kw2>,...\t: remove tests with one of those keywords (can be used many times) -P <preexecute_python_code> """, file = sys.stderr) raise SystemExit #### MAIN ####