diff options
Diffstat (limited to 'FBGM.py')
-rw-r--r-- | FBGM.py | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ +from ftplib import parse150 +import os, sys + +def txthandler(path): + f = open(path) + print(f.read()) + return 0 + +def pdfhandler(path): + f = open(path) + print(f.read()) + return 0 + + +def dochandler(path): + f = open(path) + print(f.read()) + return 0 + +#Attempting to pass docx file in path +path = 'C:/Users/a big fuck/Downloads/beans.docx' + + +extension = path[path.rfind('.')+1: len(path)] +print(extension) + + + +if extension =='txt': + txthandler(path) + +elif extension == 'pdf': + pdfhandler(path) + +elif extension == 'doc' or 'docx': + dochandler(path) + +else: + print("Extension not recognized") + sys.exit() + + + + + |