⚲
Project
General
Profile
Sign in
Register
Home
Projects
Search
:
CHIRP
All Projects
CHIRP
Home
Download
Documentation
Activity
Issues
Repository
Download (300 Bytes)
New Model #1201
» convert.py
python script to convert .dat file to .hex binary image -
Jens Jensen
, 11/07/2013 11:46 PM
#!/usr/bin/python
import
sys
infile
=
sys
.
argv
[
1
]
outfile
=
sys
.
argv
[
2
]
fin
=
open
(
infile
,
"
r
"
)
filecontents
=
fin
.
read
()
strlist
=
filecontents
.
split
()
fin
.
close
()
intlist
=
map
(
int
,
strlist
)
bytes
=
bytearray
(
intlist
)
fout
=
open
(
outfile
,
"
wb
"
)
fout
.
write
(
bytes
)
fout
.
close
()
« Previous
1
2
3
Next »
(3-3/3)
Loading...