palindrome/palindrome.py

33 lines
829 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from transform.Transform import Transform
def parse_args():
'''
Argument Parser for terminal usage.
'''
parser = argparse.ArgumentParser(description=('Throw in an integer N to'
'transform it into a'
'palindrome'))
parser.add_argument('-i',
'--int',
nargs=1,
required=True,
help='The integer to be transformed.',
type=int)
args = parser.parse_args()
return args
def main():
args = parse_args()
print(args.int)
print(Transform.palindrome(args.int))
return args
if __name__ == '__main__':
main()