New Model #1201 » convert.py
1 |
#!/usr/bin/python
|
---|---|
2 |
import sys |
3 |
|
4 |
infile = sys.argv[1] |
5 |
outfile = sys.argv[2] |
6 |
|
7 |
fin = open(infile,"r") |
8 |
filecontents = fin.read() |
9 |
strlist = filecontents.split() |
10 |
fin.close() |
11 |
|
12 |
intlist = map(int, strlist) |
13 |
bytes = bytearray(intlist) |
14 |
|
15 |
fout = open(outfile, "wb") |
16 |
fout.write(bytes) |
17 |
fout.close() |
18 |
|
- « Previous
- 1
- 2
- 3
- Next »