Skip to content

Commit

Permalink
New Version of Word(Python)
Browse files Browse the repository at this point in the history
  • Loading branch information
AidenSorabji committed Oct 24, 2021
1 parent 8c10691 commit f1b6f29
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Sorabji - Word (Python).py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Imports
import time

# File Types
file_docx = ["Docx", "docx", "1"]
file_txt = ["TxT", "Txt", "txt", "2"]
file_doc = ["Doc", "DOC", "doC", "doc", "3"]
file_rtf = ["RTF", "Rtf", "rtf"]
file_wpd = ["WPD", "Wpd", "wpd"]

# Way to exit
leave = ["exit", "exit()", "Exit", "Exit()"]

# Intro
print("""
Word for
Python
v2.0
""")

time.sleep(1.3)

# File type Program
print("""Please choose a file type:\n 1 docx\n 2 txt\n 3 doc\n 4 rtf\n 5 wpd\n
""")
file_type = input(">>> ")

# Opening files in their respective formats
if file_type in file_docx:
f = open("Untitled.docx", "w")
elif file_type in file_txt:
f = open("Untitled.txt", "w")
elif file_type in file_doc:
f = open("Untitled.doc", "w")
elif file_type in file_rtf:
f = open("Untitled.rtf", "w")
elif file_type in file_wpd:
f = open("Untitled.wpd", "w")
else:
print("""Using .txt ...
""")
time.sleep(1)
f = open("use_the_correct_file_format_next_time_lmao.txt", "w")


print('Remember, press enter and then type "exit()" to exit.')
time.sleep(1)

enter = input("""Press enter to continue...
""")

# typing Part
print("""Start Typing: """)
while True:
write = input(""" \n """)
if write in leave:
# Saving File
print("""
Saving File... """)
f.close()

time.sleep(1.2)

# Exiting out of Python
print("""
Closing Python...""")
time.sleep(0.7)
exit()
else:
f.write(write)

0 comments on commit f1b6f29

Please sign in to comment.