Skip to content

Commit f6c11bc

Browse files
Merge pull request prathimacode-hub#498 from akash435/periodbranch
Added Periodic Table Elements Information in GUISripts
2 parents c58581f + ba14be2 commit f6c11bc

File tree

11 files changed

+1934
-0
lines changed

11 files changed

+1934
-0
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ✔ PERIODIC TABLE ELEMENTS INFORMATION
2+
- ### A "Periodic Table Elements Information" is an application created in python with tkinter gui.
3+
- ### In this application, user can find the details about any periodic table elements.
4+
- ### Here it supports all the 118 elements of the periodic table.
5+
- ### The details for each mission will be in terms of Name, Symbol, Appearence, Atomic Number, Group Block, Period, Element Category, Atomic Weight, Electronic Configuration, Phase, Melting Point, Boiling Point, Heat of Vaporization, Heat of Fusion, Molar Heat Capacity, Oxidation States, Electronegativity, Ionization Energies, Covalent Radius, Van Der Waal's Radius, Crystal Structure, Thermal Conductivity, Magnetic Ordering.
6+
- ### for the data, used the periodic_table.csv data, and read using pandas library.
7+
8+
****
9+
10+
# REQUIREMENTS :
11+
- ### python 3
12+
- ### tkinter module
13+
- ### from tkinter messagebox module
14+
- ### pandas
15+
16+
****
17+
18+
# How this Script works :
19+
- ### User just need to download the file and run the periodic_table_elements_information.py on their local system.
20+
- ### Now on the main window of the application the user needs to select the name of element from the drop down OptionMenu.
21+
- ### After user has chosen the name of element, when user clicks on the BY DETAILS button, he/she will be able to see the details all the properties and details about that element selected.
22+
- ### Also there is a reset button, clicking on which user can resets both the Option Menu to default element name "Hydrogen".
23+
- ### Also there is an exit button, clicking on which exit dialog box appears asking for the permission of the user for closing the window.
24+
25+
# Purrpose :
26+
- ### This scripts helps us to easily get every details about any element from the 118 element of periodic table elements.
27+
28+
# Compilation Steps :
29+
- ### Install tkinter, pandas
30+
- ### After that download the code file, and run periodic_table_elements_information.py on local system.
31+
- ### Then the script will start running and user can get the details about any element from the periodic table.
32+
33+
****
34+
35+
# SCREENSHOTS :
36+
37+
****
38+
39+
<p align="center">
40+
<img width = 800 src="Images/1.jpg" /><br>
41+
<img width = 800 src="Images/2.jpg" /><br>
42+
<img width = 800 src="Images/3.jpg" /><br>
43+
<img width = 800 src="Images/4.jpg" /><br>
44+
<img width = 800 src="Images/5.jpg" /><br>
45+
<img width = 800 src="Images/6.jpg" /><br>
46+
</p>
47+
48+
****
49+
50+
# Author :
51+
- ### Akash Ramanand Rajak

GUIScripts/Periodic Table Elements Information/periodic_table.csv

Lines changed: 1747 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
3+
import tkinter
4+
from tkinter import *
5+
import tkinter as tk
6+
import tkinter.messagebox as mbox
7+
import pandas as pd
8+
9+
10+
11+
window = Tk()
12+
window.geometry("1000x700")
13+
window.title("Periodic Table Elements Information")
14+
15+
# ---------------------------------------------------------
16+
frameCnt = 4
17+
frames = [PhotoImage(file='Images/periodic.gif',format = 'gif -index %i' %(i)) for i in range(frameCnt)]
18+
19+
cnt = 0.0
20+
def update(ind):
21+
global cnt
22+
frame = frames[ind]
23+
if(cnt == 1.0):
24+
cnt = 0
25+
cnt = cnt + 0.2
26+
ind += int(cnt)
27+
if ind == frameCnt:
28+
ind = 0
29+
label.configure(image=frame)
30+
window.after(100, update, ind)
31+
label = Label(window)
32+
label.place(x = 120, y = 100)
33+
window.after(0, update, 0)
34+
# --------------------------------------------------------------------
35+
36+
data = pd.read_csv("periodic_table.csv")
37+
number = data['number'].tolist()
38+
name = data['name'].tolist()
39+
symbol = data['symbol'].tolist()
40+
appearance = data['appearance'].tolist()
41+
atomic_number = data['atomic_number'].tolist()
42+
group_block = data['group_block'].tolist()
43+
period = data['period'].tolist()
44+
element_category = data['element_category'].tolist()
45+
atomic_weight = data['atomic_weight'].tolist()
46+
electron_configuration = data['electron_configuration'].tolist()
47+
phase = data['phase'].tolist()
48+
melting_point = data['melting_point'].tolist()
49+
boiling_point = data['boiling_point'].tolist()
50+
heat_of_vaporization = data['heat_of_vaporization'].tolist()
51+
heat_of_fusion = data['heat_of_fusion'].tolist()
52+
molar_heat_capacity = data['molar_heat_capacity'].tolist()
53+
oxidation_states = data['oxidation_states'].tolist()
54+
electronegativity = data['electronegativity'].tolist()
55+
ionization_energies = data['ionization_energies'].tolist()
56+
covalent_radius = data['covalent_radius'].tolist()
57+
van_der_waals_radius = data['van_der_waals_radius'].tolist()
58+
crystal_structure = data['crystal_structure'].tolist()
59+
thermal_conductivity = data['thermal_conductivity'].tolist()
60+
magnetic_ordering = data['magnetic_ordering'].tolist()
61+
62+
# print(len(number))
63+
# print(name)
64+
# print(symbol)
65+
# print(appearance)
66+
# print(atomic_number)
67+
# print(group_block)
68+
# print(period)
69+
# print(element_category)
70+
# print(atomic_weight)
71+
# print(electron_configuration)
72+
# print(phase)
73+
# print(melting_point)
74+
# print(boiling_point)
75+
# print(heat_of_vaporization)
76+
# print(heat_of_fusion)
77+
# print(molar_heat_capacity)
78+
# print(oxidation_states)
79+
# print(electronegativity)
80+
# print(ionization_energies)
81+
# print(covalent_radius)
82+
# print(van_der_waals_radius)
83+
# print(crystal_structure)
84+
# print(thermal_conductivity)
85+
# print(magnetic_ordering)
86+
#
87+
88+
def details():
89+
selected_name = name_var.get()
90+
for i in range(0,len(name)):
91+
if(name[i] == selected_name):
92+
mbox.showinfo(selected_name + " Details", "Name : " + str(selected_name) + "\n\n1.) Symbol : " + str(symbol[i]) + "\n2.) Appearence : " + str(appearance[i]) + "\n3.) Atomic Number : " + str(atomic_number[i]) + "\n4.) Group Block : " + str(group_block[i]) + "\n5.) Period : " + str(period[i]) + "\n6.) Element Category : " + str(element_category[i]) + "\n7.) Atomic Weight : " + str(atomic_weight[i]) + "\n8.) Electronic Configuration : " + str(electron_configuration[i]) + "\n9.) Phase : " + str(phase[i]) + "\n10.) Melting Point : " + str(melting_point[i]) + "\n11.) Boiling Point : " + str(boiling_point[i]) + "\n12.) Heat of Vaporization : " + str(heat_of_vaporization[i]) + "\n13.) Heat of Fusion : " + str(heat_of_fusion[i]) + "\n14.) Molar Heat Capacity : " + str(molar_heat_capacity[i]) + "\n15.) Oxidation States : " + str(oxidation_states[i]) + "\n16.) Electronegativity : " + str(electronegativity[i]) + "\n17.) Ionization Energies : " + str(ionization_energies[i]) + "\n18.) Covalent Radius : " + str(covalent_radius[i]) + "\n19.) Van Der Waal's Radius : " + str(van_der_waals_radius[i]) + "\n20.) Crystal Structure : " + str(crystal_structure[i]) + "\n21.) Thermal Conductivity : " + str(thermal_conductivity[i]) + "\n22.) Magnetic Ordering : " + str(magnetic_ordering[i]))
93+
94+
95+
# top label
96+
start1 = tk.Label(text = "PERIODIC TABLE ELEMENT INFO", font=("Arial", 40), fg="magenta",underline=0) # same way bg
97+
start1.place(x = 70, y = 10)
98+
#
99+
# label for country code ---------------------------------------------------------------------------------
100+
sel_label = tk.Label(text = "Select Element Name : ", font=("Arial", 30), fg="brown") # same way bg
101+
sel_label.place(x = 150, y = 500)
102+
103+
# creating the drop down menu button for selecting food
104+
name_var = tk.StringVar()
105+
# as icon size are really small, we defined the following 7 sizes
106+
name_choices = name
107+
# food_choices.sort()
108+
name_menu = OptionMenu(window, name_var, *name_choices)
109+
name_menu.config(font=("Arial", 25), bg = "light green", fg = "blue", borderwidth=3)
110+
name_menu["menu"].config(font=("Arial", 10), bg = "light yellow", fg = "blue")
111+
name_menu.place(x=600, y=490)
112+
name_var.set("Hydrogen") # size 1 is selected as by default, and we can
113+
114+
infob = Button(window, text="DETAILS",command=details,font=("Arial", 20), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
115+
infob.place(x =200 , y =600 )
116+
117+
def reset_label():
118+
name_var.set("Hydrogen")
119+
120+
resetb = Button(window, text="RESET",command=reset_label,font=("Arial", 20), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
121+
resetb.place(x =450 , y =600 )
122+
123+
124+
def exit_win():
125+
if mbox.askokcancel("Exit", "Do you want to exit?"):
126+
window.destroy()
127+
128+
exitb = Button(window, text="EXIT",command=exit_win,font=("Arial", 20), bg = "red", fg = "blue", borderwidth=3, relief="raised")
129+
exitb.place(x =730 , y =600 )
130+
131+
132+
window.protocol("WM_DELETE_WINDOW", exit_win)
133+
window.mainloop()

0 commit comments

Comments
 (0)