summaryrefslogtreecommitdiff
path: root/FBGM.py
diff options
context:
space:
mode:
Diffstat (limited to 'FBGM.py')
-rw-r--r--FBGM.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/FBGM.py b/FBGM.py
new file mode 100644
index 0000000..99cb4bf
--- /dev/null
+++ b/FBGM.py
@@ -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()
+
+
+
+
+