Skip to content

Instantly share code, notes, and snippets.

@PoplarYang
Last active July 5, 2018 04:20
Show Gist options
  • Save PoplarYang/7bb8af58bebea10100ae57f77c4097fb to your computer and use it in GitHub Desktop.
Save PoplarYang/7bb8af58bebea10100ae57f77c4097fb to your computer and use it in GitHub Desktop.
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment