Hi, I am an older individual learning Python using Pycharm and I am stuck with my output box. I don’t know how to print in the box. You can see the print arguments but I am at a loss. I wrote all of this code my self and I am a licensed Land Surveyor and that is what this program is all about, just a coordinate geometry program for two state plane coordinates (Georgia State Plane). Thank you, Bill
import math
import customtkinter
from geopy.distance import geodesic
from pyproj import Transformer
Az: float
Deg: int
Min: float
Sec: float
Az2: float
Az3: float
Az4: float
x1: float
y1: float
x2: float
y2: float
y3: float
y4: float
customtkinter.set_appearance_mode(“dark”)
customtkinter.set_default_color_theme(“blue”)
root = customtkinter.CTk()
root.geometry(“500x750”)
def Solve():
sta_1 = int(entry1.get())
sta_2 = int(entry2.get())
easting_1 = float(entry3.get())
northing_1 = float(entry4.get())
easting_2 = float(entry5.get())
northing_2 = float(entry6.get())
sum1 = float(northing_2 - northing_1)
sum2 = float(easting_2 - easting_1)
sum3 = float(sum1 ** 2 + sum2 ** 2) ** 0.50
sum4 = float(round(sum3, 5))
transformer = Transformer.from_crs(“epsg:2240”, “epsg:4326”)
(x1, y1) = transformer.transform(easting_1, northing_1)
(x2, y2) = transformer.transform(easting_2, northing_2)
root_p = customtkinter.CTk()
root_p.geometry("450x450")
label_p = customtkinter.CTkLabel(master=root_p, text="Coordinate Geometry Output")
label_p.pack()
print("Station One:= ", sta_1)
print("Station two:= ", sta_2)
print("Station One:= ", sta_1)
print("Latitude =: ", round(x1, 7), "Longitude =:", round(y1, 7))
Deg = int(x1)
Min = int((x1 - Deg) * 60)
Sec = ((x1 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 5))
y3 = abs(y1)
Deg = int(y3)
Min = int((y3 - Deg) * 60)
Sec = ((y3 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 5))
print("Station Two =:", sta_2)
print("Latitude =: ", round(x2, 7), "Longitude =: ", round(y2, 7))
Deg = int(x2)
Min = int((x2 - Deg) * 60)
Sec = ((x2 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 5))
y4 = abs(y2)
Deg = int(y4)
Min = int((y4 - Deg) * 60)
Sec = ((y4 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 5))
fst = (x1, y1)
snd = (x2, y2)
print("Geodesic distance =:", round(geodesic(fst, snd).km * 3280.83333333333, 5))
# Quadrant Angles
if sum1 == 0 and sum2 > 0:
print("Az =: ", 90)
print("Distance =: ", sum4)
exit()
if sum1 == 0 and sum2 < 0:
print("Az =: ", 270)
print("Distance =:", sum4)
exit()
if sum2 == 0 and sum1 > 0:
print("Az =: ", 360)
if sum2 == 0 and sum1 < 0:
print("Az =: ", 180)
Az = math.degrees(math.atan(sum2 / sum1))
print(sum2)
print(sum1)
if sum2 > 0 and sum1 > 0:
print("Az1 =: ", Az)
print("N ", int(Az), "E ")
Deg = int(Az)
Min = int((Az - Deg) * 60)
Sec = ((Az - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
elif sum2 > 0 and sum1 < 0:
print("Az2 =: ", 180 + Az)
Az2 = 180 + Az
Deg = int(Az2)
Min = int((Az2 - Deg) * 60)
Sec = ((Az2 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
print("S ", abs(Az), "E ")
Deg = int(abs(Az))
Min = int((abs(Az) - Deg) * 60)
Sec = ((abs(Az) - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
elif sum2 < 0 and sum1 < 0:
print("Az3 =: ", 180 + Az)
Az3 = 180 + Az
Deg = int(Az3)
Min = int((Az3 - Deg) * 60)
Sec = ((Az3 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
print("S ", Az, "W ")
Deg = int(Az)
Min = int((Az - Deg) * 60)
Sec = ((Az - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
elif sum2 < 0 and sum1 > 0:
print("Az4 =:", 360 + Az)
Az4 = 360 + Az
Deg = int(Az4)
Min = int((Az4 - Deg) * 60)
Sec = ((Az4 - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
print("N ", abs(Az), "W ")
Deg = int(abs(Az))
Min = int((abs(Az) - Deg) * 60)
Sec = ((abs(Az) - (Deg + Min / 60)) * 3600)
print("Deg =:", Deg, "Min =:", Min, "Sec =:", round(Sec, 2))
print("Distance =: ", sum4)
print(Az)
root_p.mainloop()
def Clear():
entry1.delete(0, customtkinter.END)
entry2.delete(0, customtkinter.END)
entry3.delete(0, customtkinter.END)
entry4.delete(0, customtkinter.END)
entry5.delete(0, customtkinter.END)
entry6.delete(0, customtkinter.END)
frame = customtkinter.CTkFrame(master=root)
frame.pack(pady=20, padx=60, fill=“both”, expand=True)
label = customtkinter.CTkLabel(master=frame, text=“Coordinate Geometry Inverse Program”)
label.pack()
label = customtkinter.CTkLabel(master=frame, text=“by William H Helbig PS”)
label.pack(pady=12, padx=10)
entry1 = customtkinter.CTkEntry(master=frame, placeholder_text=“Station One”)
entry1.pack(pady=12, padx=10)
entry2 = customtkinter.CTkEntry(master=frame, placeholder_text=“Station Two”)
entry2.pack(pady=12, padx=10)
entry3 = customtkinter.CTkEntry(master=frame, placeholder_text=“First Easting”)
entry3.pack(pady=12, padx=10)
entry4 = customtkinter.CTkEntry(master=frame, placeholder_text=“First Northing”)
entry4.pack(pady=12, padx=10)
entry5 = customtkinter.CTkEntry(master=frame, placeholder_text=“Second Easting”)
entry5.pack(pady=12, padx=10)
entry6 = customtkinter.CTkEntry(master=frame, placeholder_text=“Second Northing”)
entry6.pack(pady=12, padx=10)
button = customtkinter.CTkButton(master=frame, text=“solve”, command=Solve)
button.pack(pady=12, padx=10)
button = customtkinter.CTkButton(master=frame, text=“Clear All”, command=Clear)
button.pack(pady=12, padx=10)
root.mainloop()