⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_bin.py

📁 minimal python variant for small footprint apps like embedded apps
💻 PY
字号:
#! /usr/bin/env python"""Test script for the binascii C module   Uses the mechanism of the python binhex module   Roger E. Masse"""import binheximport tempfilefrom test_support import verbosedef test():    try:        fname1 = tempfile.mktemp()        fname2 = tempfile.mktemp()        f = open(fname1, 'w')    except:        raise ImportError, "Cannot test binascii without a temp file"    start = 'Jack is my hero'    f.write(start)    f.close()        binhex.binhex(fname1, fname2)    if verbose:        print 'binhex'    binhex.hexbin(fname2, fname1)    if verbose:        print 'hexbin'    f = open(fname1, 'r')    finish = f.readline()    if start <> finish:        print 'Error: binhex <> hexbin'    elif verbose:        print 'binhex == hexbin'    try:        import os        os.unlink(fname1)        os.unlink(fname2)    except:        passtest()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -