├── screenshot1.png ├── screenshot2.PNG ├── resources ├── about.png ├── comp.png ├── dots.png ├── home.png ├── home_.png ├── log_a.png ├── login.png ├── logo.png ├── menu.png ├── next.png ├── prev.png ├── attach.png ├── download.png ├── setting.png ├── setting2.png └── upload.png ├── README.md ├── Notes ├── 0.txt ├── 2.txt └── 1.txt ├── server.py ├── LICENSE ├── .gitignore └── main.py /screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/screenshot1.png -------------------------------------------------------------------------------- /screenshot2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/screenshot2.PNG -------------------------------------------------------------------------------- /resources/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/about.png -------------------------------------------------------------------------------- /resources/comp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/comp.png -------------------------------------------------------------------------------- /resources/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/dots.png -------------------------------------------------------------------------------- /resources/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/home.png -------------------------------------------------------------------------------- /resources/home_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/home_.png -------------------------------------------------------------------------------- /resources/log_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/log_a.png -------------------------------------------------------------------------------- /resources/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/login.png -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/logo.png -------------------------------------------------------------------------------- /resources/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/menu.png -------------------------------------------------------------------------------- /resources/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/next.png -------------------------------------------------------------------------------- /resources/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/prev.png -------------------------------------------------------------------------------- /resources/attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/attach.png -------------------------------------------------------------------------------- /resources/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/download.png -------------------------------------------------------------------------------- /resources/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/setting.png -------------------------------------------------------------------------------- /resources/setting2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/setting2.png -------------------------------------------------------------------------------- /resources/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardeepsingh980/DeeNotes-Notes-Share/master/resources/upload.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DeeNotes 2 | 3 | ## Summary 4 | This application can be used to share and view Notes with each other online. The problem of getting notes in school or collages is a major issue. This application can resolve the problem. 5 | 6 | ## Features 7 | 8 | 1. Upload Notes 9 | 10 | 2. View Notes uploaded by anyone. 11 | 12 | 3. Download notes 13 | 14 | 4. Settings 15 | 16 | 5. Delete Notes 17 | 18 | ## Requirements 19 | 1. Python 3.7 or above 20 | 21 | 2. Socket module 22 | 23 | 3. Tkinter module 24 | 25 | ## Screenshots 26 | 27 | ![image](screenshot1.png) 28 | ![image](screenshot2.PNG) 29 | -------------------------------------------------------------------------------- /Notes/0.txt: -------------------------------------------------------------------------------- 1 | Hardeep Singh@!Ch-2@!This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note. 2 | This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note.This Is An Example Note Just For Test. This Note Is A Test Note. This Is An Example NoteJust For Test. This Note Is A Test Note. This Is An Example Note Just For Test. This Note Is A Test Note. -------------------------------------------------------------------------------- /server.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import _thread 3 | 4 | clients = [] 5 | 6 | s = socket.socket() 7 | s.bind(('',5000)) 8 | s.listen(5) 9 | 10 | 11 | 12 | def recv_msg(conn): 13 | while True: 14 | msg = conn.recv(10000000).decode('utf-8') 15 | if 'post!@!' in msg: 16 | msg = msg.split('!@!')[1] 17 | send_to_all(msg) 18 | 19 | 20 | def send_to_all(msg): 21 | for client in clients: 22 | client.send(msg.encode('utf-8')) 23 | 24 | 25 | while True: 26 | conn, addr = s.accept() 27 | clients.append(conn) 28 | print('Connection Establised With ', str(addr)) 29 | _thread.start_new_thread(recv_msg,(conn,)) 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Hardeep Singh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Notes/2.txt: -------------------------------------------------------------------------------- 1 | Hardeep Singh@!Wikipedia@!from tkinter import * 2 | import wikipedia 3 | root = Tk() 4 | root.geometry('200x200') 5 | root.resizable(0,0) 6 | root.title('WIKIPEDIA') 7 | 8 | frame_1 = Frame(root, height=179,width=334) 9 | 10 | 11 | entered = StringVar() 12 | 13 | entry = Entry(frame_1, width=17,font=('calibri',15), textvariable = entered) 14 | entry.grid(row=0) 15 | 16 | def search(): 17 | text.delete(1.0, END) 18 | searched = entered.get() 19 | try: 20 | wiki = wikipedia.summary(searched) 21 | text.insert(INSERT, wiki) 22 | 23 | except: 24 | text.insert(INSERT, 'Try typing something else or check your internet connection.') 25 | 26 | 27 | search = Button(frame_1, text='SEARCH',font=('calibri',10), command=search ) 28 | search.grid(row=2,padx=10) 29 | 30 | 31 | 32 | frame_2 = Frame(root, height=338,width=262) 33 | 34 | scroll = Scrollbar(frame_2) 35 | scroll.pack(side=RIGHT,fill=Y) 36 | 37 | text = Text(frame_2,height=8,width=20,yscrollcommand=scroll.set, wrap=WORD) 38 | text.pack() 39 | scroll.configure(command=text.yview) 40 | 41 | 42 | 43 | 44 | 45 | frame_1.pack(side=TOP) 46 | frame_2.pack() 47 | 48 | root.mainloop() 49 | 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /Notes/1.txt: -------------------------------------------------------------------------------- 1 | Hardeep Singh@!Python Calculator@!from tkinter import * 2 | 3 | 4 | operator = '' 5 | 6 | def button(no): 7 | global operator 8 | operator = str(operator) 9 | operator += str(no) 10 | inp.set(operator) 11 | 12 | def equal(): 13 | global operator 14 | total = eval(operator) 15 | inp.set(total) 16 | operator = total 17 | 18 | def clear(): 19 | global operator 20 | operator = '' 21 | inp.set('') 22 | 23 | def about(): 24 | more = Tk() 25 | more.configure(bg='powder blue') 26 | more.geometry('400x200+300+450') 27 | more.iconbitmap('ca.ico') 28 | 29 | 30 | Label(more, text='CALCULATOR',bg='powder blue',font=('Arial Black',10,'bold')).pack() 31 | 32 | Label(more, text='By: Hardeep Singh',bg='powder blue',font=('Arial Black',10,'bold')).pack() 33 | 34 | Label(more, text='This Calculator was created by Hardeep Singh\n as a time pass project because he\nhe was feeling bored due to sunday :) \nAll the Right belong to Hardeep singh.',bg='powder blue',font=('Arial Black',10,'bold')).pack() 35 | 36 | Label(more, text='Contact us at:\n9803588671',bg='powder blue',font=('Arial Black',10,'bold')).pack(side=LEFT) 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | win = Tk() 45 | win.geometry('313x315+379+128') 46 | win.iconbitmap('ca.ico') 47 | 48 | inp = StringVar() 49 | 50 | 51 | Entry(win, font=('arial black',20),width=16,bd=10,justify='right',bg='light blue',textvariable=inp).place(x=0,y=3) 52 | 53 | #----------------button line 1 ---------------------- 54 | 55 | Button(win, text='Clear',font=('arial black',10),bd=10,width=12,command=clear).place(x=0,y=65) 56 | Button(win, text='A',font=('arial black',10),bd=10,width=2,command=about).place(x=130,y=65) 57 | Button(win, text='-',font=('arial black',10),bd=10,width=2,command=lambda:button('-')).place(x=175,y=65) 58 | Button(win, text='/',font=('arial black',10),bd=10,width=2,command=lambda:button('/')).place(x=220,y=65) 59 | Button(win, text='*',font=('arial black',10),bd=10,width=2,command=lambda:button('*')).place(x=265,y=65) 60 | 61 | #--------------Button line 2 --------------------------- 62 | Button(win, text='7',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(7)).place(x=0,y=113) 63 | Button(win, text='8',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(8)).place(x=70,y=113) 64 | Button(win, text='9',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(9)).place(x=140,y=113) 65 | 66 | 67 | #--------------Button line 3 --------------------------- 68 | Button(win, text='4',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(4)).place(x=0,y=180) 69 | Button(win, text='5',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(5)).place(x=70,y=180) 70 | Button(win, text='6',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(6)).place(x=140,y=180) 71 | 72 | #--------------Button line 4 --------------------------- 73 | Button(win, text='1',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(1)).place(x=0,y=247) 74 | Button(win, text='2',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(2)).place(x=70,y=247) 75 | Button(win, text='3',font=('arial black',10),bd=10,width=5,height=2,command=lambda:button(3)).place(x=140,y=247) 76 | 77 | 78 | Button(win, text='=', font=('arial black',10),bd=10,width=8,height=2,command=equal).place(x=210,y=247) 79 | Button(win, text='0', font=('arial black',10),bd=7,width=3,height=6,command=lambda:button(0)).place(x=210,y=113) 80 | Button(win, text='+', font=('arial black',10),bd=7,width=3,height=6,command=lambda:button('+')).place(x=260,y=113) 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | win.mainloop() 89 | 90 | 91 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | ## ----------------------- Import Modules ---------------------------------------- 2 | from tkinter import * 3 | from tkinter import filedialog 4 | from tkinter import messagebox as mb 5 | from tkinter import colorchooser 6 | import os 7 | import socket 8 | import _thread 9 | ##-------------------------------------------------------------------------- 10 | 11 | 12 | 13 | 14 | ##---------------------- Variables --------------------------------------- 15 | menu_counter = 2 16 | cur_note = -1 17 | bg_color = 'light green' 18 | ##-------------------------------------------------------------------------- 19 | 20 | 21 | 22 | 23 | ##-------------------------------- Class Main_ -------------------------------- 24 | class Main_(): 25 | 26 | ##-------------------------------- About Function ------------------------------------------- 27 | def about(self): 28 | mb.showinfo('About Us','This is the exclusive distribution of DeeNotes created by Hardeep Singh. This Application was developed with Python Language. This for Created for the students who face problems in taking notes. So, this application was created to help the students share the notes with other fellow students.') 29 | ##------------------------------------------------------------------------------------------------ 30 | 31 | 32 | 33 | 34 | ##-------------------------------- Change Background -------------------------------------- 35 | def tcolor(self): 36 | global bg_color 37 | clr = colorchooser.askcolor(title='Select Color') 38 | co = clr[1] 39 | bg_color = co 40 | bg_label1['bg'] = bg_color 41 | menu_bg['bg'] = bg_color 42 | logo_bg['bg'] = bg_color 43 | menu_frame['bg'] = bg_color 44 | log_img['bg'] = bg_color 45 | log_in_as['bg'] = bg_color 46 | name['bg'] = bg_color 47 | log_bg['bg'] = bg_color 48 | upload_l['bg'] = bg_color 49 | down_l['bg'] = bg_color 50 | setting_l['bg'] = bg_color 51 | about_l['bg'] = bg_color 52 | home_l['bg'] = bg_color 53 | set_bg['bg'] = bg_color 54 | ##------------------------------------------------------------------------------------------------- 55 | 56 | 57 | 58 | 59 | ##------------------------------------ Setting Window -------------------------------------------- 60 | def setting_func(self): 61 | global set_bg 62 | set_ = Toplevel() 63 | set_.geometry('300x300') 64 | set_.resizable(0,0) 65 | set_.title('Settings') 66 | set_bg = Label(set_, text='Settings', bg=bg_color, font=('',20),width=300,relief='groove') 67 | set_bg.pack() 68 | Label(set_, text='Change Background', font=('',13)).place(x=10,y=50) 69 | Button(set_, text='Select',font=('',13),command=self.tcolor).place(x=200,y=45) 70 | ##------------------------------------------------------------------------------------------------------ 71 | 72 | 73 | 74 | 75 | ##------------------------------ Delete Notes Function --------------------------------------------- 76 | def delete_func(self): 77 | global cur_note 78 | dir_l = os.listdir('Notes') 79 | use = dir_l[cur_note] 80 | os.remove(f'Notes/{use}') 81 | dir_l = os.listdir('Notes') 82 | c = 0 83 | for i in dir_l: 84 | os.rename(f'Notes/{i}',f'Notes/{c}.txt') 85 | c+=1 86 | 87 | self.next_func() 88 | mb.showinfo('Success','Note Deleted Successfully.') 89 | ##-------------------------------------------------------------------------------------------------------- 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | ##------------------------ Upload Notes Function --------------------------------- 98 | def upload_n_func(self): 99 | user = name_entry.get() 100 | title = title_entry.get() 101 | data = text_u.get(1.0,END) 102 | if user != '' and title != '' and data != '': 103 | to_write = f'post!@!{user}@!{title}@!{data}' 104 | s.send(to_write.encode('utf-8')) 105 | mb.showinfo('Success','Notes Successfully Uploaded.') 106 | self.home_func() 107 | else: 108 | mb.showerror('Fill','Fill All The Columns.') 109 | ##--------------------------------------------------------------------------------------- 110 | 111 | 112 | 113 | 114 | 115 | 116 | ##------------------------------------ Home Function --------------------------------------- 117 | def home_func(self): 118 | global menu_counter 119 | user_label.place(x=60,y=51) 120 | title_label.place(x=60,y=75) 121 | text_.place(x=10,y=100) 122 | frame.place(x=10,y=50) 123 | log_a_label.place(x=13,y=52) 124 | dots_b.place(x=320,y=60) 125 | next_b.place(x=200,y=395) 126 | pre_b.place(x=5,y=395) 127 | name_label.place(x=1000) 128 | name_entry.place(x=1000) 129 | title_u_label.place(x=1000) 130 | title_entry.place(x=1000) 131 | text_u_label.place(x=1000) 132 | text_u.place(x=1000) 133 | attach_u.place(x=1000) 134 | upload_u_b.place(x=1000) 135 | cancel_u_b.place(x=1000) 136 | upload_l.place(x=1000,y=1000) 137 | down_l.place(x=1000,y=1000) 138 | setting_l.place(x=1000,y=1000) 139 | about_l.place(x=1000,y=1000) 140 | menu_frame.place(x=1000,y=1000) 141 | log_img.place(x=1000,y=1000) 142 | home_l.place(x=1000) 143 | name.place(x=1000,y=1000) 144 | log_bg.place(x=1000,y=1000) 145 | log_in_as.place(x=1000,y=1000) 146 | comp_label.place(x=1000) 147 | menu_counter+=1 148 | ##------------------------------------------------------------------------------------------------ 149 | 150 | 151 | 152 | ##------------------------------- Attach Notes Functions --------------------------------------- 153 | def attach_func(self): 154 | returned = filedialog.askopenfile(initialdir='E:\\', title='Select file to open') 155 | if returned != None: 156 | for line in returned: 157 | text_u.insert(END, line) 158 | returned.close() 159 | #------------------------------------------------------------------------------------------------------ 160 | 161 | 162 | ##---------------- Upload Note Function --------------------------------- 163 | def upload_note_func(self): 164 | global menu_counter 165 | user_label.place(x=1000) 166 | title_label.place(x=1000) 167 | text_.place(x=1000) 168 | frame.place(x=1000) 169 | log_a_label.place(x=1000) 170 | dots_b.place(x=1000) 171 | menu_frame.place(x=1000,y=1000) 172 | log_img.place(x=1000,y=1000) 173 | log_in_as.place(x=1000,y=1000) 174 | name.place(x=1000,y=1000) 175 | log_bg.place(x=1000,y=1000) 176 | upload_l.place(x=1000,y=1000) 177 | down_l.place(x=1000,y=1000) 178 | setting_l.place(x=1000,y=1000) 179 | about_l.place(x=1000,y=1000) 180 | next_b.place(x=1000) 181 | pre_b.place(x=1000) 182 | menu_counter+=1 183 | name_label.place(x=20,y=50) 184 | name_entry.place(x=90,y=50) 185 | title_u_label.place(x=20,y=90) 186 | title_entry.place(x=90,y=90) 187 | text_u_label.place(x=20,y=150) 188 | text_u.place(x=20,y=180) 189 | attach_u.place(x=220,y=150) 190 | upload_u_b.place(x=170,y=420) 191 | cancel_u_b.place(x=240,y=420) 192 | home_l.place(x=1000) 193 | comp_label.place(x=1000) 194 | ##--------------------------------------------------------------------------------------- 195 | 196 | 197 | 198 | 199 | 200 | 201 | ##----------------------- Download Notes Function -------------------------------- 202 | def download_notes_func(self): 203 | f = filedialog.asksaveasfile(mode='w', defaultextension='.txt') 204 | if f is None: 205 | return 206 | global cur_note 207 | dir_l = os.listdir('Notes') 208 | use = dir_l[cur_note] 209 | file = open(f'Notes/{use}','r') 210 | data_l = file.read(10000).split('@!') 211 | user = data_l[0] 212 | title = data_l[1] 213 | note_data = data_l[2] 214 | to_write =f'{user} \n\nTitle : {title}\n\n{note_data}' 215 | f.write(to_write) 216 | f.close 217 | ##--------------------------------------------------------------------------------------- 218 | 219 | 220 | 221 | 222 | 223 | ##----------------------- Next Function --------------------------------------------------- 224 | def next_func(self): 225 | try: 226 | global cur_note 227 | dir_l = os.listdir('Notes') 228 | use = dir_l[cur_note+1] 229 | f = open(f'Notes/{use}','r') 230 | data_l = f.read(10000).split('@!') 231 | user = data_l[0] 232 | title = data_l[1] 233 | note_data = data_l[2] 234 | user_label['text'] = user 235 | title_label['text'] = 'Title : '+title 236 | text_.delete(1.0,END) 237 | text_.insert(INSERT, note_data) 238 | cur_note += 1 239 | except: 240 | global all_caught 241 | user_label.place(x=1000) 242 | title_label.place(x=1000) 243 | text_.place(x=1000) 244 | frame.place(x=1000) 245 | comp_label.place(x=10,y=100) 246 | log_a_label.place(x=1000) 247 | dots_b.place(x=1000) 248 | ##----------------------------------------------------------------------------------------------- 249 | 250 | 251 | 252 | 253 | 254 | ##-------------------------------------- Previous Function ----------------------------------------- 255 | def prev_func(self): 256 | try: 257 | global cur_note 258 | if cur_note <= 0: 259 | return 260 | 261 | else: 262 | dir_l = os.listdir('Notes') 263 | use = dir_l[cur_note-1] 264 | f = open(f'Notes/{use}','r') 265 | data_l = f.read(10000).split('@!') 266 | user = data_l[0] 267 | title = data_l[1] 268 | note_data = data_l[2] 269 | user_label['text'] = user 270 | title_label['text'] = 'Title : '+title 271 | text_.delete(1.0,END) 272 | text_.insert(INSERT, note_data) 273 | cur_note -= 1 274 | except: 275 | pass 276 | ##-------------------------------------------------------------------------------------------------------- 277 | 278 | 279 | 280 | 281 | #----------------------------------------------- Menu Function -------------------------------------------------------------- 282 | def menu_func(self): 283 | global menu_counter 284 | if menu_counter%2 != 0: 285 | menu_frame.place(x=1000,y=1000) 286 | log_img.place(x=1000,y=1000) 287 | log_in_as.place(x=1000,y=1000) 288 | name.place(x=1000,y=1000) 289 | log_bg.place(x=1000,y=1000) 290 | upload_l.place(x=1000,y=1000) 291 | down_l.place(x=1000,y=1000) 292 | setting_l.place(x=1000,y=1000) 293 | about_l.place(x=1000,y=1000) 294 | home_l.place(x=1000) 295 | else: 296 | menu_frame.place(x=0,y=38) 297 | log_bg.place(x=0,y=38) 298 | log_img.place(x=10,y=50) 299 | log_in_as.place(x=10,y=120) 300 | name.place(x=5,y=145) 301 | home_l.place(x=5,y=180) 302 | upload_l.place(x=5,y=220) 303 | down_l.place(x=5,y=260) 304 | setting_l.place(x=5,y=310) 305 | about_l.place(x=5,y=350) 306 | menu_counter+=1 307 | ##----------------------------------------------------------------------------------------------------------------------------------- 308 | 309 | 310 | 311 | 312 | ## ----------------------------- Contructor Function -------------------------------------------------------------------------------- 313 | def __init__(self): 314 | global bg_label1,menu_bg,logo_bg 315 | win = Tk() 316 | win.geometry('350x450') 317 | win.resizable(0,0) 318 | win.title('DeeNotes') 319 | win.configure(bg='white') 320 | bg_label1 = Label(win, text='',width=35,bg=bg_color,font=('',20),relief='groove') 321 | bg_label1.pack() 322 | menu_img = PhotoImage(file='resources/menu.png') 323 | menu_bg = Button(win, image=menu_img,bg=bg_color,bd=0,command=self.menu_func) 324 | menu_bg.place(x=10,y=9) 325 | logo_img = PhotoImage(file='resources/logo.png') 326 | logo_bg = Label(win, image=logo_img,bg=bg_color) 327 | logo_bg.place(x=240,y=9) 328 | 329 | 330 | ## Canvas 331 | global user_label, title_label, text_,frame,comp_label,log_a_label,dots_b, next_b, pre_b 332 | frame = Label(win, text='',bg='white',width=14,relief='groove',font=('',30)) 333 | frame.place(x=10,y=50) 334 | log_a_img = PhotoImage(file='resources/log_a.png') 335 | log_a_label = Label(win, image=log_a_img,bg='white') 336 | log_a_label.place(x=13,y=52) 337 | user_label = Label(win,text='',bg='white',font=('',13)) 338 | user_label.place(x=60,y=51) 339 | title_label = Label(win, text='',bg='white',font=('',11,'italic')) 340 | title_label.place(x=60,y=75) 341 | text_ = Text(win,font=('',13),wrap='word',width=36,bd=2,height=15) 342 | text_.place(x=10,y=100) 343 | dots_img = PhotoImage(file='resources/dots.png') 344 | dots_b = Button(win, image=dots_img,bd=0,bg='white') 345 | dots_b.place(x=320,y=60) 346 | pop = Menu(win, tearoff=0) 347 | pop.add_command(label='Download Notes',command=self.download_notes_func) 348 | pop.add_separator() 349 | pop.add_command(label='Delete',command=self.delete_func) 350 | pop.add_separator() 351 | pop.add_command(label='Report Notes') 352 | self.next_func() 353 | def do(event): 354 | try: 355 | pop.tk_popup(event.x_root,event.y_root,0) 356 | finally: 357 | pop.grab_release 358 | dots_b.bind('',do) 359 | next_img = PhotoImage(file='resources/next.png') 360 | next_b = Button(win, image=next_img,text='Next Note ',bg='white',bd=0,compound='right',font=('',13,'bold'),command=self.next_func) 361 | next_b.place(x=200,y=395) 362 | pre_img = PhotoImage(file='resources/prev.png') 363 | pre_b = Button(win, image=pre_img,text=' Previous Note',bg='white',bd=0,compound='left',font=('',13,'bold'),command=self.prev_func) 364 | pre_b.place(x=5,y=395) 365 | comp_img = PhotoImage(file='resources/comp.png') 366 | comp_label = Label(win, image=comp_img) 367 | 368 | 369 | ## Upload Canvas 370 | global name_label, name_entry,title_u_label, title_entry,text_u_label,text_u,attach_u,upload_u_b,cancel_u_b 371 | name_label = Label(win, text='Name : ',bg='white',font=('',13,'bold')) 372 | name_entry = Entry(win,font=('',13),bd=2 ) 373 | title_u_label = Label(win, text='Title : ',bg='white',font=('',13,'bold')) 374 | title_entry = Entry(win,font=('',13),bd=2 ) 375 | text_u_label = Label(win, text='Write Notes : ',font=('',13,'bold'),bg='white') 376 | text_u = Text(win, font=('',13,'bold'),width=34,bd=2,height=12,wrap = 'word') 377 | attach_img = PhotoImage(file='resources/attach.png') 378 | attach_u = Button(win, image=attach_img,text='Attach Notes',bd=0,compound='left',font=('',10),bg='white',command=self.attach_func) 379 | upload_u_b = Button(win, text='Upload',bg='Green',fg='white',bd=0,font=('',11),command=self.upload_n_func) 380 | cancel_u_b = Button(win, text='Cancel',bg='Red',fg='white',bd=0,font=('',11),command=self.home_func) 381 | 382 | 383 | ## Menu Bar 384 | global menu_frame,log_img, log_in_as,name,log_bg,upload_l,down_l,setting_l,about_l,home_l 385 | menu_frame = Label(win,bg=bg_color,width=20,height=27,relief='groove') 386 | log_bg = Label(win,bg=bg_color,width=20,height=9,relief='groove') 387 | login_img =PhotoImage(file='resources/login.png') 388 | log_img = Label(win,image=login_img,bg=bg_color) 389 | log_in_as = Label(win, text='Logged In As : ',bg=bg_color,font=('',13)) 390 | name = Label(win, text='Hardeep Singh',bg=bg_color,font=('',13,'bold')) 391 | home_img = PhotoImage(file='resources/home.png') 392 | home_l = Button(win, image=home_img,text='Home',font=('',13),bg=bg_color,bd=0,compound='left',command=self.home_func) 393 | upload_img = PhotoImage(file='resources/upload.png') 394 | upload_l = Button(win,image=upload_img,text='Upload Notes',bg=bg_color,bd=0,compound='left',font=('',13),command=self.upload_note_func) 395 | down_img = PhotoImage(file='resources/download.png') 396 | down_l = Button(win, image=down_img,text='Downloaded \nNotes',font=('',13),bg=bg_color,bd=0,compound='left') 397 | setting_img = PhotoImage(file='resources/setting.png') 398 | setting_l = Button(win, image=setting_img,text='Settings',font=('',13),bg=bg_color,bd=0,compound='left',command=self.setting_func) 399 | about_img = PhotoImage(file='resources/about.png') 400 | about_l = Button(win, image=about_img,text='About',font=('',13),bg=bg_color,bd=0,compound='left',command=self.about) 401 | 402 | 403 | ## Mainloop 404 | win.mainloop() 405 | ##------------------------------------------------------------------------------------------------------- 406 | ##---------------------------------------------------------------------------------------------------------- 407 | 408 | 409 | 410 | def recv_msg(): 411 | while True: 412 | msg = s.recv(10000000).decode('utf-8') 413 | len_l = len(os.listdir('Notes')) 414 | f = open(f'Notes/{len_l}.txt','w') 415 | f.write(msg) 416 | f.close() 417 | 418 | 419 | 420 | def create_socket(): 421 | global s 422 | s = socket.socket() 423 | s.connect(('localhost',5000)) 424 | _thread.start_new_thread(recv_msg,()) 425 | 426 | ## Object For Main_ Class 427 | _thread.start_new_thread(create_socket,()) 428 | DeeNotes = Main_() 429 | 430 | --------------------------------------------------------------------------------