-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9th_class.py
88 lines (70 loc) · 2.6 KB
/
9th_class.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
81
82
83
84
85
###################COMPLICATED NOTEPAD#################
# ########SIGN UP########
firstname = input("Please enter name: ")
surname = input("Please enter surname: ")
username = input("Please enter username: ")
password = input("Please enter password: ")
confirm_password = input("Please confirm password: ")
file = open("notepad/db.csv", "a")
file.write(f"{firstname},{surname},{username}, {password}\n")
file.close
# ########SIGN IN########
# input_username = input("Please enter username: ")
# input_password = input("Please enter password: ")
# file = open("notepad/db.csv", "r")
# for line in file.readlines():
# saved_username, saved_password = line.split(",")[2:]
# if saved_username.lower() and saved_password == input_username.lower() and input_password:
# print(f"Welcome {saved_username}")
# break
# else:
# print("sorry, username/or password nott correct\nPlease check for errors or sign up!.")
# ########WRITE JOURNAL########
# import datetime
# title = input("Please enter title: ")
# note = input("Please enter note: ")
# today = datetime.datetime.now()
# date = f"{today.day}/{today.month}/{today.year}"
# username = "kl"
# file = open("notepad/journals.csv", "a")
# file.write(f"{username},{title},{body},{date}\n")
# file.close()
########READ JOURNAL########
# logged_in_username = ######
# journals_found = []
# file = open("notepad/journals.csv", "r")
# for line in file.readlines():
# username, title, body, date = line.split(",")
# if logged_in_username == username:
# journals_found.append({
# "title":title,
# "body":body
# })
# print()
# for index, journal in enumerate(journals_found):
# print(index+1, journal["title"])
# print()
# selected_option = int(input("Above are your notes pick one\n> "))
# print("\n#######################")
# print(journals_found[selected_option-1]["title"].upper())
# print("#######################\n")
# print(journals_found[selected_option-1]["body"])
# print("\n#######################")
# print("#######################\n")
# # ########DELETE JOURNAL########
# # logged_in_username = ######
# # journals_found = []
# # file = open("notepad/journals.csv", "r")
# # for line in file.readlines():
# # username, title, body, date = line.split(",")
# # if logged_in_username == username:
# # journals_found.append({
# # "title":title
# # "body":body
# # })
# # file.close()
# # print()
# # for index, journal in enumerate(journals_found):
# # print(index+1, journal["title"])
# # print()
# # selected_option = int(input("Select a journal to delete\n> "))