format discs.

Taka taka at net.hr
Wed Jul 9 14:19:21 CEST 2003


On Wed, 09 Jul 2003 06:26:38 +0000, Flanagan wrote:

> hello to all 
> 
> somebody can say to me whereupon I modulate of python I can format 
> discs. 
> 
> 
> thanks flanagan

Let's presume you want to format a unix partition and that it is
/dev/hda1.
The do this:

#!/bin/python

import os
partition = open ('/dev/hda1', 'w')

for x in range(os.path.getsize('/dev/hda1'):
	partition.write ('0')

partition.close()


:)




More information about the Python-list mailing list