Unidad No.4: Practica #10: Calendario

#Aqui insertamos el codigo
#!/usr/bin/env phyton
 
#- * - coding: utf - 8 -*-
#Simple calendario con tkinter
 
 
import calendar
import Tkinter as tk
import datetime
 
# Obtenemos los valores del ano y mes a mostrar
 
ano = datetime.date.today ().year
mes = datetime.date.today ().month
 
 
def writeCalendar(ano, mes):
    # Asignamos el ano y mes al calendario
 
    str1 = calendar.month (ano, mes)
    label1.configure (text=str1)
 
def mesAnterior():
    global mes, ano
    mes -= 1
 
    if ano == 0:
 
     mes = 12
 
    ano -= 1
    writeCalendar (ano, mes)
 
 
def mesSiguiente():
    global mes, ano
    mes += 1
 
    if mes == 13:
     mes = 1
 
    ano += 1
 
    writeCalendar (ano, mes)
 
 
root = tk.Tk ()
root.title ("Calendario")
 
# Lo posicionamos en un label
 
label1 = tk.Label (root, text="", font=('courier', 40, 'bold'), bg='white', justify=tk.LEFT)
label1.grid (row=1, column=1)
 
# ponemos los botones dentro un Frame
 
frame = tk.Frame (root, bd=5)
anterior = tk.Button (frame, text="Anterior", command=mesAnterior)
anterior.grid (row=1, column=1, sticky=tk.W)
siguiente = tk.Button (frame, text="Siguiente", command=mesSiguiente)
siguiente.grid (row=1, column=2)
frame.grid (row=2, column=1)
 
writeCalendar (ano, mes)
 
# ejecutamos el evento loop
 
root.mainloop ()

No hay comentarios:

Publicar un comentario

Unidad No.4 Triangulo en 3D

import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * verticies = (     (1, -1, -1),     (1, 1,...