Python script that generates blob files

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Fri Oct 8 01:12:59 CEST 2004


Sean Carey wrote:
> I am wondering if anyone knows of a python script or any other script
> that will generate random files with random sizes that I can specify.

define "random files".

If you're on Linux or similar, just use the dd utility?

Otherwise something like this (where the contents of the file
is left blank):

f=open("filename","wb")
f.seek( desiredsize-1 )
f.write('\0')
f.close()

--Irmen



More information about the Python-list mailing list