Last active
July 5, 2018 04:20
-
-
Save PoplarYang/7bb8af58bebea10100ae57f77c4097fb to your computer and use it in GitHub Desktop.
python测试代码,用来测试重载
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment