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))
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))