Python >>> Transcript Translation
Roger.E.Eller at sealedair.com
Roger.E.Eller at sealedair.com
Sat Dec 18 14:35:34 EST 2004
Hey,
Can anyone out there who is familiar with Python please translate the
script below to Transcript? This script is supposed to be able to create a
Hard-Drive image that works with the PearPC Macintosh Emulator. I want a
native Rev script that can create this multi-gigabyte file.
Thanks.
Roger Eller <roger.e.eller at sealedair.com>
<Begin Python Script
---------------------------------------------------------->
#!/usr/bin/python
# Copyright (c) 2004 Marco Lange.
import sys
GRANULARITY = 516096
imagename = sys.argv[1]
imagesize = int(sys.argv[2])
if imagesize % GRANULARITY != 0:
imagesize = ((imagesize / GRANULARITY) + 1) * GRANULARITY
print "Using image size:", imagesize
imagefile = open(imagename, "wb+")
imagefile.seek(imagesize-1)
imagefile.write("\x00")
imagefile.close
<End Python Script
---------------------------------------------------------->
More information about the use-livecode
mailing list