Skip to content

Commit 18ddeb3

Browse files
authored
Add files via upload
0 parents  commit 18ddeb3

File tree

9 files changed

+424
-0
lines changed

9 files changed

+424
-0
lines changed

Braintech.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env python3
2+
######################################
3+
# BRAINTECH PRIVATE LIMITED
4+
# JOHN MELODY MELISSA
5+
######################################
6+
# यह स्क्रिप्ट John Melody द्वारा लिखा गया है।
7+
# PYTHON में पूरी तरह से द्वारा संचालित. सभी
8+
# अधिकार सुरक्षित | इस स्क्रिप्ट का कोई भी
9+
# हिस्सा अनधिकृत पार्टी द्वारा
10+
# पुनरुत्पादित किया जा सकता है।
11+
######################################
12+
import tkinter
13+
from tkinter import ttk, Menu
14+
from tkinter import *
15+
import serial
16+
import serial.tools.list_ports
17+
import os
18+
19+
# Windows Configuration ::
20+
window = tkinter.Tk()
21+
window.title("Braintech Braiwave Monitor")
22+
window.geometry("1400x700")
23+
window.iconbitmap("icon.ico")
24+
window.config(bg="white")
25+
26+
# Menubar Configuration ::
27+
Menubar = Menu(window)
28+
window.config(menu=Menubar)
29+
window.resizable(True, True)
30+
31+
# Menubar Functions ::
32+
# FileMenu declaration ::
33+
fileMenu = Menu(Menubar, tearoff=0)
34+
fileMenu.add_command(label="New (N)")
35+
fileMenu.add_separator()
36+
fileMenu.add_command(label="Quit (Q)", command=window.destroy)
37+
Menubar.add_cascade(label="File", menu=fileMenu)
38+
Menubar.add_cascade(label="Edit")
39+
40+
# Window Menu ::
41+
def dmgr():
42+
os.system("devmgmt.msc")
43+
44+
def textEditor():
45+
import notepad as texteditor
46+
return textEditor()
47+
48+
def terminal():
49+
os.system("start terminal.py")
50+
51+
WindowMenu = Menu(Menubar, tearoff=0)
52+
WindowMenu.add_command(label="Text Editor (K)", command=textEditor)
53+
WindowMenu.add_command(label="Braintech Terminal (B) ", command=terminal)
54+
WindowMenu.add_command(label="Device Manager (D)", command=dmgr)
55+
Menubar.add_cascade(label="Window", menu=WindowMenu)
56+
57+
# Pereference Menu ::
58+
def themeDark():
59+
window.configure(background="#2B1B17")
60+
return
61+
62+
PereferenceMenu = Menu(Menubar, tearoff=0)
63+
Themes = Menu(PereferenceMenu, tearoff=0)
64+
Themes.add_command(label="Night Theme", command=themeDark)
65+
PereferenceMenu.add_cascade(label="Themes (T) \t ", menu=Themes)
66+
Menubar.add_cascade(label="Pereferences", menu=PereferenceMenu)
67+
68+
# Help Menu ::
69+
def credit():
70+
import credit as software_creditnm
71+
software_credit()
72+
73+
HelpMenu = Menu(Menubar, tearoff=0)
74+
HelpMenu.add_command(label="About (I) ", command=credit)
75+
Menubar.add_cascade(label="Help", menu=HelpMenu)
76+
77+
##====================================================================================##
78+
# Main Function ::
79+
Serial_Port_Communication_LF = LabelFrame(window, text="Electroencephalography Monitor")
80+
Serial_Port_Communication_LF.pack(fill="both", expand="yes")
81+
82+
83+
window.mainloop()

__pycache__/credit.cpython-37.pyc

843 Bytes
Binary file not shown.

__pycache__/terminal.cpython-37.pyc

4.83 KB
Binary file not shown.

credit.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
######################################
3+
# BRAINTECH PRIVATE LIMITED
4+
# JOHN MELODY MELISSA
5+
######################################
6+
# यह स्क्रिप्ट John Melody द्वारा लिखा गया है।
7+
# PYTHON में पूरी तरह से द्वारा संचालित. सभी
8+
# अधिकार सुरक्षित | इस स्क्रिप्ट का कोई भी
9+
# हिस्सा अनधिकृत पार्टी द्वारा
10+
# पुनरुत्पादित किया जा सकता है।
11+
######################################
12+
import tkinter
13+
from tkinter import ttk, Image
14+
from tkinter import *
15+
16+
17+
# Windows Configuration ::
18+
window = tkinter.Tk()
19+
window.title("Braintech Braiwave Monitor")
20+
window.geometry("560x210+550+300")
21+
window.iconbitmap("icon.ico")
22+
window.resizable(False, False)
23+
window.attributes("-fullscreen", "false")
24+
25+
outter_layer_frame = LabelFrame(window, text="Credits")
26+
outter_layer_frame.pack(fill="both", expand="yes")
27+
28+
#braintech_logo = PhotoImage(file="icon.png")
29+
#braintech_logo_RESIZED = braintech_logo.subsample(3,3)
30+
#Label(outter_layer_frame, image=braintech_logo_RESIZED).pack(side=TOP)
31+
32+
inner_layer_label = Label(outter_layer_frame, text="\n\n Braintech Brainwave Monitor" +
33+
" (Community Edition) \n\n POWERED BY PYTHON \n\n John@braintechgroup.com \n Copyright (C) BRAINTECH SDN BHD MALAYSIA")
34+
35+
inner_layer_label_donation = Label(outter_layer_frame, text="Donate : https://www.paypal.me/johnmelody ")
36+
inner_layer_label.pack()
37+
inner_layer_label_donation.pack()
38+
window.mainloop()

icon.ico

263 KB
Binary file not shown.

icon.png

50.8 KB
Loading

notepad.py

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
#!/usr/bin/env python3
2+
######################################
3+
# BRAINTECH PRIVATE LIMITED
4+
# JOHN MELODY MELISSA
5+
######################################
6+
# यह स्क्रिप्ट John Melody द्वारा लिखा गया है।
7+
# PYTHON में पूरी तरह से द्वारा संचालित. सभी
8+
# अधिकार सुरक्षित | इस स्क्रिप्ट का कोई भी
9+
# हिस्सा अनधिकृत पार्टी द्वारा
10+
# पुनरुत्पादित किया जा सकता है।
11+
######################################
12+
from tkinter.messagebox import *
13+
from tkinter.filedialog import *
14+
from tkinter.filedialog import askopenfilename
15+
16+
17+
class Notepad:
18+
# variables
19+
__root = Tk()
20+
21+
# default window width and height
22+
__thisWidth = 300
23+
__thisHeight = 300
24+
__thisTextArea = Text(__root)
25+
__thisMenuBar = Menu(__root)
26+
__thisFileMenu = Menu(__thisMenuBar, tearoff=0)
27+
__thisEditMenu = Menu(__thisMenuBar, tearoff=0)
28+
__thisHelpMenu = Menu(__thisMenuBar, tearoff=0)
29+
__thisScrollBar = Scrollbar(__thisTextArea)
30+
__file = None
31+
32+
def __init__(self, **kwargs):
33+
# initialization
34+
35+
# set icon
36+
try:
37+
self.__root.wm_iconbitmap("logo.ico") # GOT TO FIX THIS ERROR (ICON)
38+
except:
39+
pass
40+
41+
# set window size (the default is 300x300)
42+
43+
try:
44+
self.__thisWidth = kwargs['width']
45+
except KeyError:
46+
pass
47+
48+
try:
49+
self.__thisHeight = kwargs['height']
50+
except KeyError:
51+
pass
52+
53+
# set the window text
54+
self.__root.title(" Braintech Braiwave Monitor [TEXT EDITOR] ")
55+
self.__root.iconbitmap("icon.ico")
56+
57+
# center the window
58+
screenWidth = self.__root.winfo_screenwidth()
59+
screenHeight = self.__root.winfo_screenheight()
60+
61+
left = (screenWidth / 2) - (self.__thisWidth / 2)
62+
top = (screenHeight / 2) - (self.__thisHeight / 2)
63+
64+
self.__root.geometry('%dx%d+%d+%d' % (self.__thisWidth, self.__thisHeight, left, top))
65+
66+
# to make the textarea auto resizable
67+
self.__root.grid_rowconfigure(0, weight=1)
68+
self.__root.grid_columnconfigure(0, weight=1)
69+
70+
# add controls (widget)
71+
72+
self.__thisTextArea.grid(sticky=N + E + S + W)
73+
74+
self.__thisFileMenu.add_command(label="New", command=self.__newFile)
75+
self.__thisFileMenu.add_command(label="Open", command=self.__openFile)
76+
self.__thisFileMenu.add_command(label="Save", command=self.__saveFile)
77+
self.__thisFileMenu.add_separator()
78+
self.__thisFileMenu.add_command(label="Exit", command=self.__quitApplication)
79+
self.__thisMenuBar.add_cascade(label="File", menu=self.__thisFileMenu)
80+
81+
self.__thisEditMenu.add_command(label="Cut", command=self.__cut)
82+
self.__thisEditMenu.add_command(label="Copy", command=self.__copy)
83+
self.__thisEditMenu.add_command(label="Paste", command=self.__paste)
84+
self.__thisMenuBar.add_cascade(label="Edit", menu=self.__thisEditMenu)
85+
86+
self.__thisHelpMenu.add_command(label="About Notepad", command=self.__showAbout)
87+
self.__thisMenuBar.add_cascade(label="Help", menu=self.__thisHelpMenu)
88+
89+
self.__root.config(menu=self.__thisMenuBar)
90+
91+
self.__thisScrollBar.pack(side=RIGHT, fill=Y)
92+
self.__thisScrollBar.config(command=self.__thisTextArea.yview)
93+
self.__thisTextArea.config(yscrollcommand=self.__thisScrollBar.set)
94+
95+
def __quitApplication(self):
96+
self.__root.destroy()
97+
# exit()
98+
99+
def __showAbout(self):
100+
import credit as software_credit
101+
software_credit()
102+
103+
def __openFile(self):
104+
105+
self.__file = askopenfilename(defaultextension=".txt",
106+
filetypes=[("Text File", "*.txt"), ("FIF", "*.fif"), ("Python", "*.py"),
107+
("C/C++", "*.c"), ("BRT", "*.brt"), ("EDF", "*.edf"), ("CSV", "*.csv"),
108+
("Excel", "*.xls"), ("TFF", "*.tff"), ("MATLAB", "*.m"),
109+
("Json", "*.json"), ("All Files", "*.*")])
110+
111+
if self.__file == "":
112+
# no file to open
113+
self.__file = None
114+
else:
115+
# try to open the file
116+
# set the window title
117+
self.__root.title(os.path.basename(self.__file) + " - Notepad")
118+
self.__thisTextArea.delete(1.0, END)
119+
120+
file = open(self.__file, "r")
121+
122+
self.__thisTextArea.insert(1.0, file.read())
123+
124+
file.close()
125+
126+
def __newFile(self):
127+
self.__root.title("Untitled - Notepad")
128+
self.__file = None
129+
self.__thisTextArea.delete(1.0, END)
130+
131+
def __saveFile(self):
132+
133+
if self.__file == None:
134+
# save as new file
135+
self.__file = asksaveasfilename(initialfile='Untitled.txt', defaultextension=".txt",
136+
filetypes=[("Text File", "*.txt"), ("FIF", "*.fif"), ("Python", "*.py"),
137+
("C/C++", "*.c"), ("BRT", "*.brt"), ("EDF", "*.edf"),
138+
("CSV", "*.csv"), ("Excel", "*.xls"), ("TFF", "*.tff"),
139+
("MATLAB", "*.m"), ("Json", "*.json"), ("All Files", "*.*")])
140+
141+
if self.__file == "":
142+
self.__file = None
143+
else:
144+
# try to save the file
145+
file = open(self.__file, "w")
146+
file.write(self.__thisTextArea.get(1.0, END))
147+
file.close()
148+
# change the window title
149+
self.__root.title(os.path.basename(self.__file) + " - Notepad")
150+
151+
152+
else:
153+
file = open(self.__file, "w")
154+
file.write(self.__thisTextArea.get(1.0, END))
155+
file.close()
156+
157+
def __cut(self):
158+
self.__thisTextArea.event_generate("<<Cut>>")
159+
160+
def __copy(self):
161+
self.__thisTextArea.event_generate("<<Copy>>")
162+
163+
def __paste(self):
164+
self.__thisTextArea.event_generate("<<Paste>>")
165+
166+
def run(self):
167+
168+
# run main application
169+
self.__root.mainloop()
170+
171+
172+
# run main application
173+
notepad = Notepad(width=600, height=400)
174+
notepad.run()

terminal.exe

6.27 MB
Binary file not shown.

0 commit comments

Comments
 (0)