Add project structure

This commit is contained in:
Stephan Porada 2021-03-17 10:32:45 +01:00
parent cf184f7747
commit 350087354a
4 changed files with 44 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

32
palindrome.py Normal file
View File

@ -0,0 +1,32 @@
#!/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()

11
transform/Transform.py Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Transform(object):
"""Class to transform a given integer into a palindrome"""
def __init__(self):
super(Transform, self).__init__()
@staticmethod
def palindrome(int):
return int

0
transform/__init__.py Normal file
View File