Fill a file with some text.

François Pinard pinard at iro.umontreal.ca
Thu Jun 20 17:58:46 CEST 2002


[mdk]

> I need to fill a file with differnt amounts of some text, either just
> the letter x or random, doesn't matter.  But I need the size to be, for
> example, 6070784 bites.  What is the best and or fastest way to do this?

The simplest may be:    open(FILE, 'w').write('x' * 6070784)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list