Accueil > Calculatrices_ > Casio > Casio graph 35+E II > calendrier perpétuel en python (Version 0.1)

calendrier perpétuel en python (Version 0.1)

jeudi 11 novembre 2021, par joz

un calendrier perpetuel en python pour cotre calculatrice Casio Graph 35+ EII

voici le code :

from casioplot import *

# ptitjoz calendrier  novembre 2021 version :
v="V01"

j=["DIM","LUN","MAR","MER","JEU","VEN","SAM"]
mois=["JANVIER","FEVRIER","MARS","AVRIL","MAI","JUIN","JUILLET","AOUT","SEPTEMBRE","OCTOBRE","NOVEMBRE","DECEMBRE"]
nbj=[31,28,31,30,31,30,31,31,30,31,30,31]

m=int(input("mois ? "))
a=int(input("annee ? "))
if a<100:
  a=2000+a
annee=a
mo=m
bis=0

if annee%4==0 and m==2:
  bis=1
if annee%100==0 and m==2:
  bis=0
if annee%400==0 and m==2:
  bis=1
  
c=int((14-m)/12)
a=a-c
m=m+12*c-2
d=1+a+int(a/4)-int(a/100)+int(a/400)+int(31*m/12)
d=1-d+7*int(d/7)
if d==1:
  d=-6

draw_string(2,9,"LUN MAR MER JEU  VEN SAM DIM")
draw_string(38,1,mois[int(mo-1)]+" "+str(annee))
draw_string(116,1,v)

for c in range(7,64,8):
  for l in range(127):
    set_pixel(l,c)
    
for l in range(0,127,18):
  for c in range(8,63,1):
   set_pixel(l,c)
  
    
for c in range(16,63,8):
  for l in range(0,127-18,18):
    d+=1
    if d<10:
      s=" "+str(d)
    else:
      s=str(d)
    if d>0 and d<=nbj[mo-1]+bis:
      draw_string(l+5,c+1,str(s))
  
show_screen()

J’ai publié également cette article sur TI-Planet : tiplanet.org

Un message, un commentaire ?

modération a priori

Ce forum est modéré a priori : votre contribution n’apparaîtra qu’après avoir été validée par un administrateur du site.

Qui êtes-vous ?
Votre message

Pour créer des paragraphes, laissez simplement des lignes vides.

Lien hypertexte

(Si votre message se réfère à un article publié sur le Web, ou à une page fournissant plus d’informations, vous pouvez indiquer ci-après le titre de la page et son adresse.)