forked from adafruit/knitting_machine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
turn a 2K memory dump data file into two 1024 byte tracks for the dis…
…k drive. rename them as necessary
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
|
||
|
||
if len(sys.argv) != 2: | ||
print 'Usage: %s file.dat' % sys.argv[0] | ||
print 'Splits a 2K file.dat file into two 1K track files track0.dat and track1.dat' | ||
sys.exit() | ||
|
||
|
||
|
||
infile = open(sys.argv[1], 'r') | ||
|
||
track0file = open("track0.dat", 'w') | ||
track1file = open("track1.dat", 'w') | ||
|
||
t0dat = infile.read(1024) | ||
t1dat = infile.read(1024) | ||
|
||
|
||
track0file.write(t0dat) | ||
track0file.close() | ||
|
||
track1file.write(t1dat) | ||
track1file.close() |