-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
108 lines (73 loc) · 2.02 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
print("Type NEW to create a new document.")
print("Type SAVECLOSE to save & close.")
print("Type OPEN to open.")
print("Type NAME to rename.")
print("Type EDIT to edit.")
DocNameList = []
Line = ""
LineCount = 1
CurrentDoc = ""
Writing = 0
DocName = ""
DocListContents = []
def ASK():
global CurrentDoc
global LineCount
global Line
global DocName
global Writing
StartOption = ""
while StartOption != "SAVE" or StartOption != "NEW" or "EDIT" or StartOption != "OPEN" or StartOption != "NAME" or StartOption != "SAVECLOSE":
StartOption = input("Enter:")
if StartOption == "NEW":
LineCount = 1
DocName = input("Document Name:")
Writing = 0
DocNameList.append(DocName)
NEW()
if StartOption == "CLOSE":
pass
if StartOption == "NAME":
pass
if StartOption == "OPEN":
pass
if StartOption == "EDIT":
EDIT()
if StartOption == "SAVECLOSE":
SAVECLOSE()
def SAVECLOSE():
global CurrentDoc
global DocName
global Writing
DocListContents.append[CurrentDoc]
CurrentDoc = []
DocName = ""
Writing = 0
StartOption = ""
ASK()
def NEW():
global CurrentDoc
global Writing
global LineCount
while Writing == 0:
print(f"Line {LineCount}:")
Line = input(f"\n")
CurrentDoc.append(f"{Line}\n")
LineCount += 1
if "HOME" in Line:
ASK()
def EDIT():
global CurrentDoc
Editing = True
while Editing == True:
EditLine = int(input("Line (int) you want to replace:"))
while EditLine <= len(CurrentDoc):
ReplaceLine = input("Replace contents:")
if "HOME" in ReplaceLine:
ASK()
Editing = False
else:
CurrentDoc[EditLine] = ReplaceLine
print(f"Edited line {CurrentDoc[EditLine]}")
print("Edit complete next line")
ASK()