annotate python/asm.py @ 354:5477e499b039
Added some sort of string functionality
author |
Windel Bouwman |
date |
Thu, 13 Mar 2014 18:59:06 +0100 |
parents |
6f4753202b9a |
children |
6df89163e114 |
rev |
line source |
303
|
1 #!/usr/bin/env python3
|
|
2
|
318
|
3 import argparse
|
334
|
4 from ppci.assembler import Assembler
|
196
|
5
|
|
6 if __name__ == '__main__':
|
|
7 # When run as main file, try to grab command line arguments:
|
|
8 parser = argparse.ArgumentParser(description="Assembler")
|
318
|
9 parser.add_argument('sourcefile', type=argparse.FileType('r'),
|
|
10 help='the source file to assemble')
|
196
|
11 args = parser.parse_args()
|
|
12 a = Assembler()
|
|
13 obj = a.assemble(args.sourcefile.read())
|