blob: 12be5fe62e1f4786cbc47f9264ca4b6c3b18d561 [file] [log] [blame]
Kevin O'Connore5de5ec2011-07-05 20:57:07 -04001#!/usr/bin/env python
2# Encode an integer in little endian format in a file.
3#
4# Copyright (C) 2011 Kevin O'Connor <kevin@koconnor.net>
5#
6# This file may be distributed under the terms of the GNU GPLv3 license.
7
8import sys
9import struct
10
11def main():
12 filename = sys.argv[1]
13 value = int(sys.argv[2])
14
15 outval = struct.pack('<Q', value)
16 f = open(filename, 'wb')
17 f.write(outval)
18 f.close()
19
20if __name__ == '__main__':
21 main()