python 蟒蛇测试代码,用来测试重载

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 蟒蛇测试代码,用来测试重载相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env python
# coding: utf-8

import subprocess

def test(size=1024*64):
    """ pip默认为 64k"""
    print 'start'
    cmd = 'dd if=/dev/urandom bs=1 count=%d 2>/dev/null' % size
    p = subprocess.Popen(args=cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
    #p.communicate()
    p.wait()
    print 'end'

以上是关于python 蟒蛇测试代码,用来测试重载的主要内容,如果未能解决你的问题,请参考以下文章