ESTE ES EL CODIGO DONDE CREO LAS VENTANAS CON TKINTER 

from tkinter import *
from tkinter import ttk,font
from tkinter.ttk import Style
from tkinter import messagebox
import datetime
from contactospac import *

def ventanatrabajador ():

    def nuevo():

            fuente = font.Font(weight='bold')
            marco = ttk.Frame(ventantrabajador, borderwidth=5, relief="raised", padding=(10, 10))

            marco.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
            ventantrabajador.columnconfigure(0, weight=1)
            ventantrabajador.rowconfigure(0, weight=1)
            marco.columnconfigure(0, weight=1)
            marco.columnconfigure(1, weight=1)
            marco.columnconfigure(2, weight=1)
            marco.rowconfigure(0, weight=1)
            marco.rowconfigure(1, weight=1)
            marco.rowconfigure(4, weight=1)

            lbltitulo = Label(marco, text="Ingrese Los Datos Del Paciente:", font=("Kristen ITC", 20), fg="black").place(x=300,
                                                                                                                         y=10)

            lblnombrepac = Label(marco, text="Nombres Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70, y=60)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=70)

            lblapellidos = Label(marco, text="Apellidos Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70, y=90)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=100)

            lblcedula = Label(marco, text="Cedula:", font=("Kristen ITC", 14), fg="black").place(x=70, y=120)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=130)

            lbledad = Label(marco, text="Edad Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70, y=150)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=160)

            lbldir = Label(marco, text="Direccion :", font=("Kristen ITC", 14), fg="black").place(x=70, y=180)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=190)

            lbltelefono = Label(marco, text="Telefono :", font=("Kristen ITC", 14), fg="black").place(x=70, y=210)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=220)

            lblcelular = Label(marco, text="Celular :", font=("Kristen ITC", 14), fg="black").place(x=70, y=240)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=250)

            lblemail = Label(marco, text="E-mail:", font=("Kristen ITC", 14), fg="black").place(x=70, y=270)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=280)

            lbltratamienti = Label(marco, text="Tratamiento :", font=("Kristen ITC", 14), fg="black").place(x=70, y=300)
            texto1 = StringVar()
            txtnombrepac = Entry(marco, textvariable=texto1, width=80).place(x=330, y=310)

            btonagregar = Button(marco, text="AGREGAR", font=("Kristen ITC", 16), width=15).place(x=450, y=390)


    def eliminar():

          marco2 = ttk.Frame(ventantrabajador, borderwidth=5, relief="raised", padding=(10, 10))
          marco2.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
          ventantrabajador.columnconfigure(0, weight=1)
          ventantrabajador.rowconfigure(0, weight=1)
          marco2.columnconfigure(0, weight=1)
          marco2.columnconfigure(1, weight=1)
          marco2.columnconfigure(2, weight=1)
          marco2.rowconfigure(0, weight=1)
          marco2.rowconfigure(1, weight=1)
          marco2.rowconfigure(4, weight=1)

          lbltitulo = Label(marco2, text="Ingrese El Numero De Cedula Del Paciente a Eliminar:", font=("Kristen ITC", 18),
                          fg="black").place(x=200, y=90)
          texto1 = StringVar()
          txtnombrepac = Entry(marco2, textvariable=texto1, width=50).place(x=400, y=205)
          lbltratamiento = Label(marco2, text="CEDULA :", font=("Kristen ITC", 12), fg="black").place(x=300, y=200)
          btonon = Button(marco2, text="ok", font=("Kristen ITC", 12), width=3).place(x=720, y=193)


    def modificar():

        fuente = font.Font(weight='bold')
        marco = ttk.Frame(ventantrabajador, borderwidth=5, relief="raised", padding=(10, 10))

        marco.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
        ventantrabajador.columnconfigure(0, weight=1)
        ventantrabajador.rowconfigure(0, weight=1)
        marco.columnconfigure(0, weight=1)
        marco.columnconfigure(1, weight=1)
        marco.columnconfigure(2, weight=1)
        marco.rowconfigure(0, weight=1)
        marco.rowconfigure(1, weight=1)
        marco.rowconfigure(4, weight=1)

        lbltitulo = Label(marco, text="Ingrese El Numero De Cedula Del Paciente a Modificar:", font=("Kristen ITC", 18),
                              fg="black").place(x=200, y=90)

        lbltitulo = Label(marco, text="Ingrese El Numero De Cedula Del Paciente a modificar:", font=("Kristen ITC", 18),
                              fg="black").place(x=200, y=90)
        texto1 = StringVar()
        txtnombrepac = Entry(marco, textvariable=texto1, width=50).place(x=400, y=205)
        lbltratamienti = Label(marco, text="CEDULA :", font=("Kristen ITC", 12), fg="black").place(x=300, y=200)
        btonon = Button(marco, text="ok", font=("Kristen ITC", 12), width=3).place(x=720, y=193)


    def asignar ():

         fuente = font.Font(weight='bold')
         marco = ttk.Frame(ventantrabajador, borderwidth=5, relief="raised", padding=(10, 10))

         marco.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
         ventantrabajador.columnconfigure(0, weight=1)
         ventantrabajador.rowconfigure(0, weight=1)
         marco.columnconfigure(0, weight=1)
         marco.columnconfigure(1, weight=1)
         marco.columnconfigure(2, weight=1)
         marco.rowconfigure(0, weight=1)
         marco.rowconfigure(1, weight=1)
         marco.rowconfigure(4, weight=1)

         lbltitulo = Label(marco, text="Reserva De Citas:", font=("Kristen ITC", 18), fg="black").place(x=480,
                                                                                                                         y=90)

         lblfecha = Label(marco, text="Fecha Cita:", font=("Kristen ITC", 12), fg="black").place(x=330, y=150)
         texto1 = StringVar()
         txtfecha = Entry(marco, textvariable=texto1, width=50).place(x=510, y=155)

         lblhora = Label(marco, text="Hora De La Cita:", font=("Kristen ITC", 12), fg="black").place(x=330, y=200)
         texto1 = StringVar()
         txthora = Entry(ventanatrabajador, textvariable=texto1, width=50).place(x=510, y=205)

         lblcedula = Label(ventanatrabajador, text="Cedula Del Paciente:", font=("Kristen ITC", 12), fg="black").place(x=330,
                                                                                                                                    y=250)
         texto1 = StringVar()
         txtcedula = Entry(ventanatrabajador, textvariable=texto1, width=50).place(x=510, y=255)

         lbltratamuiento = Label(ventanatrabajador, text="Tratamiento:", font=("Kristen ITC", 12), fg="black").place(x=330,
                                                                                                                              y=300)
         texto1 = StringVar()
         txttratamiento = Entry(ventanatrabajador, textvariable=texto1, width=50).place(x=510, y=305)

         btonagregar = Button(ventanatrabajador, text="Reservar", font=("Kristen ITC", 12), width=15).place(x=510, y=370)


    def salir1():
     ventanatrabajador.withdraw()

    ventantrabajador = Tk()
    ventantrabajador.geometry("1200x690+0+0")
    ventantrabajador.config(bg="Light Blue")
    ventantrabajador.title("EMPLEADOS")

    btonnuevoingreso = Button(ventantrabajador, text="Nuevo Ingreso", command=nuevo, font=("Kristen ITC", 14),
                                       width=15).place(x=10, y=10)
    btoneliminar = Button(ventantrabajador, text="Eliminar paciente", command=eliminar, font=("Kristen ITC", 14),
                                  width=15).place(x=250, y=10)
    btonmodificar = Button(ventantrabajador, text="Modificar Paciente", command=modificar, font=("Kristen ITC", 14),
                                   width=15).place(x=490, y=10)
    btonasignarcita = Button(ventantrabajador, text="Asignar Cita", command=asignar, font=("Kristen ITC", 14),
                                     width=15).place(x=730, y=10)
    btoncerrar = Button(ventantrabajador, text="salir", command=salir1, font=("Kristen ITC", 14), width=15).place(x=970,
                                                                                                                         y=10)




def ventanatratam():
    ventanacitas = Tk()
    ventanacitas.geometry("1200x690+0+0")
    ventanacitas.config(bg="Light Blue")
    ventanacitas.title("TRATAMIENTOS")

    lbltitulo = Label(ventanacitas, text="Ingresos De Tratamientos y servicios:", font=("Kristen ITC", 26), fg="black").place(x=300, y=10)

    lblncedulapac = Label(ventanacitas, text="Codigo Del tratamiento:", font=("Kristen ITC", 14), fg="black").place(x=270,
                                                                                                                 y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=33).place(x=270, y=130)

    lblncedulapac = Label(ventanacitas, text="Nombre Del Tramiento :", font=("Kristen ITC", 14), fg="black").place(x=540,
                                                                                                                y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=31).place(x=540, y=130)

    lblncedulapac = Label(ventanacitas, text="Valor del tratamiento:", font=("Kristen ITC", 14), fg="black").place(x=790,
                                                                                                              y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=29).place(x=790, y=130)





def ventanacita():
    ventanacitas = Tk()
    ventanacitas.geometry("1200x690+0+0")
    ventanacitas.config(bg="Light Blue")
    ventanacitas.title("CITAS")

    lbltitulo = Label(ventanacitas, text="RESERVAS DE CITAS:", font=("Kristen ITC", 26), fg="black").place(x=35, y=10)

    lblncedulapac = Label(ventanacitas, text="Cedula Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70, y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=33).place(x=70, y=130)

    lblncedulapac = Label(ventanacitas, text="Codigo Esteticitas:", font=("Kristen ITC", 14), fg="black").place(x=340,   y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=31).place(x=340, y=130)

    lblncedulapac = Label(ventanacitas, text="Fecha De La Cita:", font=("Kristen ITC", 14), fg="black").place(x=590, y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=29).place(x=590, y=130)

    lblncedulapac = Label(ventanacitas, text="Hora De La Cita:", font=("Kristen ITC", 14), fg="black").place(x=830,y=90)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=28).place(x=830, y=130)

    lblncedulapac = Label(ventanacitas, text="COD. Tratamiento:", font=("Kristen ITC", 14), fg="black").place(x=70,y=170)
    texto1 = StringVar()
    txtcedulapac = Entry(ventanacitas, textvariable=texto1, width=31).place(x=70, y=210)

    btonagregar = Button(ventanacitas, text="RESERVAR", font=("Kristen ITC", 16), width=15).place(x=450, y=180)








def ventanapac():










    def nuevoingreso():

        fuente = font.Font(weight='bold')
        marco = ttk.Frame(ventanapaciente, borderwidth=5, relief="raised", padding=(10, 10))

        marco.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
        ventanapaciente.columnconfigure(0, weight=1)
        ventanapaciente.rowconfigure(0, weight=1)
        marco.columnconfigure(0, weight=1)
        marco.columnconfigure(1, weight=1)
        marco.columnconfigure(2, weight=1)
        marco.rowconfigure(0, weight=1)
        marco.rowconfigure(1, weight=1)
        marco.rowconfigure(4, weight=1)

        lbltitulo = Label(marco, text="Ingrese Los Datos Del Paciente:", font=("Kristen ITC", 20), fg="black").place(x=300,y=10)


        lblcedula = Label(marco, text="Cedula:", font=("Kristen ITC", 14), fg="black").place(x=70,y=60)
        cedula = StringVar
        txtcedula = Entry(marco, textvariable=cedula, width=80).place(x=330,y=70)



        lblnombres = Label(marco, text="Nombres Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70,y=90)
        nombres = StringVar
        txtnombres = Entry(marco, textvariable=nombres, width=80).place(x=330, y=100)

        lblapelidos = Label(marco, text="Apellindos Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70,y=120)
        apellidos = StringVar
        txtapellidos = Entry(marco, textvariable=apellidos, width=80).place(x=330, y=130)

        lbledad = Label(marco, text="Edad Del Paciente:", font=("Kristen ITC", 14), fg="black").place(x=70,y=150)
        edad = StringVar
        txtnombrepac = Entry(marco, textvariable=edad, width=80).place(x=330, y=160)

        lblfecha_ingreso = Label(marco, text="Fecha De Ingresos :", font=("Kristen ITC", 14), fg="black").place(x=70,y=180)
        Fecha_ingreso = StringVar
        txtfecha_ingreso = Entry(marco, textvariable=Fecha_ingreso, width=80).place(x=330, y=190)

        lbltelefono = Label(marco, text="Telefono :", font=("Kristen ITC", 14), fg="black").place(x=70, y=210)
        telefono = StringVar
        txtnombrepac = Entry(marco, textvariable=telefono, width=80).place(x=330, y=220)

        lblcelular = Label(marco, text="Celular :", font=("Kristen ITC", 14), fg="black").place(x=70, y=240)
        celular = StringVar()
        txtnombrepac = Entry(marco, textvariable=celular, width=80).place(x=330, y=250)

        lblemail = Label(marco, text="E-mail:", font=("Kristen ITC", 14), fg="black").place(x=70, y=270)
        email = StringVar()
        txtnombrepac = Entry(marco, textvariable=email, width=80).place(x=330, y=280)

        lbltratamienti = Label(marco, text="Tratamiento :", font=("Kristen ITC", 14), fg="black").place(x=70,y=300)
        tratamiento = StringVar()
        txtnombrepac = Entry(marco, textvariable=tratamiento, width=80).place(x=330, y=310)



        def ingresarpac():

            contactopac1 = Contactospac()
            contactopac1.insertar( cedula.get(), nombres.get(), apellidos.get(), edad.get(), Fecha_ingreso.get(), telefono.get())



            cedula.set("")
            nombres.set("")
            apellidos.set("")
            edad.set("")
            Fecha_ingreso.set("")
            telefono.set("")
            messagebox.showinfo("mensaje", "Paciente Ingresado ")



        btonagregar = Button(marco, text="AGREGAR",command=ingresarpac, font=("Kristen ITC", 16), width=15).place(x=450, y=390)





    def eliminarpac():


        marco2 = ttk.Frame(ventanapaciente, borderwidth=5, relief="raised", padding=(10, 10))
        marco2.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
        ventanapaciente.columnconfigure(0, weight=1)
        ventanapaciente.rowconfigure(0, weight=1)
        marco2.columnconfigure(0, weight=1)
        marco2.columnconfigure(1, weight=1)
        marco2.columnconfigure(2, weight=1)
        marco2.rowconfigure(0, weight=1)
        marco2.rowconfigure(1, weight=1)
        marco2.rowconfigure(4, weight=1)

        lbltitulo = Label(marco2, text="Ingrese El Numero De Cedula Del Paciente a Eliminar:",font=("Kristen ITC", 18), fg="black").place(x=200, y=90)
        texto1 = StringVar()
        txtnombrepac = Entry(marco2, textvariable=texto1, width=50).place(x=400, y=205)
        lbltratamiento = Label(marco2, text="CEDULA :", font=("Kristen ITC", 12), fg="black").place(x=300, y=200)
        btonon = Button(marco2, text="ok", font=("Kristen ITC", 12), width=3).place(x=720, y=193)




    def modificarpac():

        marco3 = ttk.Frame(ventanapaciente, borderwidth=5, relief="raised", padding=(10, 10))
        marco3.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
        ventanapaciente.columnconfigure(0, weight=1)
        ventanapaciente.rowconfigure(0, weight=1)
        marco3.columnconfigure(0, weight=1)
        marco3.columnconfigure(1, weight=1)
        marco3.columnconfigure(2, weight=1)
        marco3.rowconfigure(0, weight=1)
        marco3.rowconfigure(1, weight=1)
        marco3.rowconfigure(4, weight=1)

        lbltitulo = Label(marco3, text="Ingrese El Numero De Cedula Del Paciente a Eliminar:", font=("Kristen ITC", 18), fg="black").place(x=200, y=90)

        lbltitulo = Label(marco3, text="Ingrese El Numero De Cedula Del Paciente a modificar:", font=("Kristen ITC", 18), fg="black").place(x=200, y=90)
        texto1 = StringVar()
        txtnombrepac = Entry(marco3, textvariable=texto1, width=50).place(x=400, y=205)
        lbltratamienti = Label(marco3, text="CEDULA :", font=("Kristen ITC", 12), fg="black").place(x=300, y=200)
        btonon = Button(marco3, text="ok", font=("Kristen ITC", 12), width=3).place(x=720, y=193)

    def asignarcita():

        marco3 = ttk.Frame(ventanapaciente, borderwidth=5, relief="raised", padding=(10, 10))
        marco3.grid(column=0, row=0, padx=70, pady=75, sticky=(N, S, E, W))
        ventanapaciente.columnconfigure(0, weight=1)
        ventanapaciente.rowconfigure(0, weight=1)
        marco3.columnconfigure(0, weight=1)
        marco3.columnconfigure(1, weight=1)
        marco3.columnconfigure(2, weight=1)
        marco3.rowconfigure(0, weight=1)
        marco3.rowconfigure(1, weight=1)
        marco3.rowconfigure(4, weight=1)

        lbltitulo = Label(ventanapaciente, text="Reserva De Citas:", font=("Kristen ITC", 18), fg="black").place(x=480, y=90)

        lblfecha = Label(ventanapaciente, text="Fecha Cita:", font=("Kristen ITC", 12), fg="black").place(x=330, y=150)
        texto1 = StringVar()
        txtfecha = Entry(ventanapaciente, textvariable=texto1, width=50).place(x=510, y=155)

        lblhora = Label(ventanapaciente, text="Hora De La Cita:", font=("Kristen ITC", 12), fg="black").place(x=330, y=200)
        texto1 = StringVar()
        txthora = Entry(ventanapaciente, textvariable=texto1, width=50).place(x=510, y=205)

        lblcedula = Label(ventanapaciente, text="Cedula Del Paciente:", font=("Kristen ITC", 12), fg="black").place( x=330, y=250)
        texto1 = StringVar()
        txtcedula = Entry(ventanapaciente, textvariable=texto1, width=50).place(x=510, y=255)

        lbltratamuiento = Label(ventanapaciente, text="Tratamiento:", font=("Kristen ITC", 12), fg="black").place(x=330, y=300)
        texto1 = StringVar()
        txttratamiento = Entry(ventanapaciente, textvariable=texto1, width=50).place(x=510, y=305)

        btonagregar = Button(ventanapaciente, text="Reservar", font=("Kristen ITC", 12), width=15).place(x=510, y=370)

    def salir():
        ventanapaciente.withdraw()

    ventanapaciente= Tk()
    ventanapaciente.title("PACIENTES")
    ventanapaciente.geometry("1200x690+0+0")
    ventanapaciente.config(bg="Light Blue")



    btonnuevoingreso = Button(ventanapaciente, text="Nuevo Ingreso",command=nuevoingreso,font=("Kristen ITC", 14), width=15).place(x=10,y=10)
    btoneliminar = Button(ventanapaciente, text="Eliminar paciente", command=eliminarpac, font=("Kristen ITC", 14), width=15).place(x=250,y=10)
    btonmodificar = Button(ventanapaciente, text="Modificar Paciente", command=modificarpac, font=("Kristen ITC", 14),width=15).place(x=490,y=10)
    btonasignarcita = Button(ventanapaciente, text="Asignar Cita",command= asignarcita, font=("Kristen ITC", 14),width=15).place(x=730,y=10)
    btoncerrar = Button(ventanapaciente, text="salir",command=salir, font=("Kristen ITC", 14),  width=15).place(x=970,y=10)






ventanaPrincipal= Tk()
ventanaPrincipal.geometry("1350x700+0+0")
ventanaPrincipal.config(bg="Light Blue")
ventanaPrincipal.title("S.G. CARMEN ALVARADO CENTER")

imagen1=PhotoImage(file="fondoprincipal.gif")
lblimagen1=Label(ventanaPrincipal, image=imagen1).place(x=100,y=100)
imagen2=PhotoImage(file="logo.gif")
lblimagen2=Label(ventanaPrincipal, image=imagen2).place(x=1000,y=500)

btonPcientes=Button(ventanaPrincipal,text="PACIENTES",command=ventanapac,font=("Kristen ITC",14),width=20).place(x=950,y=120)
btoncitas=Button(ventanaPrincipal,text="CITAS",command=ventanacita, font=("Kristen ITC",14),width=20).place(x=950,y=200)
btontratamieto=Button(ventanaPrincipal,text="TRATAMIENTOS",command=ventanatratam,font=("Kristen ITC",14),width=20).place(x=950,y=280)
btonnomina=Button(ventanaPrincipal,text="EMPLEADOS",command=ventanatrabajador,font=("Kristen ITC",14),width=20).place(x=950,y=360)

lbltitulo=Label(text="CARMEN ALVARADO CENTER",font=("Kristen ITC",35),fg="blue").place(x=100,y=550)
lbltitulo=Label(text="BIENVENIDOS",font=("Kristen ITC",35),fg="blue").place(x=300,y=10)



ventanaPrincipal.mainloop()


----------------------------------------------------------------------------------------------------------------------------
CODIGO DE LA CONEXIN A A BASE DE DATOS

import mysql.connector
from mysql.connector import errorcode

class Conexion:
    def conectar(self):
        try:
            conex=mysql.connector.connect(user='root',
                                          password='12345678',
                                          host='127.0.0.1',
                                          database='estetica',
                                          )
            print("Conectado Correctamente")
            return conex
        except mysql.connector.error as err:
            if err.errno== errorcode.ER_ACCESS_DENIED_ERROR:
                   print("Error de usuario y contrasea")
            elif err.errno==errorcode.ER_BAD_DB_ERROR:
                   print("Base de datos no existe")
            else:
                print(err)
            return None

    def cerrarConexion(self,conex):
        print("Cerrando conexion...")
        conex.close()
        print("conexion Cerrada")
----------------------------------------------------------------------------------------------------
CODIGO DONDE INSERTO LOS DATOS

from conexionmysqlserver import *
import datetime


class Contactospac(Conexion):

    def insertar(self,c,n,a,e,f,t):

     ced=int(c)
     edad=int(e)
     fecha=datetime(f)
     cnx=self.conectar()
     cursor=cnx.cursor()
     cursor.execute("INSERT INTO paciente VALUES(Null,'"+ced+"','"+n+"','"+a+"','"+edad+"','"+fecha+"','"+t+"')")
     cnx.commit()
     self.cerrarConexion(cnx) 