python os.urandom模块生产指定文件大小

 
 
  1 #!/usr/bin/env python
  2 #-*- coding:utf-8 -*-
  3 import os
  4 
  5 with open("abc.txt", "w") as f:
  6     f.write(os.urandom(1024*1024*10))

  

posted @ 2016-03-29 18:35  Joelwang  阅读(616)  评论(0编辑  收藏  举报