IPB

Bienvenue invité ( Connexion | Inscription )

[ En ligne ] · Standard · Linéaire+

> Pfouuu, java me fait chier, lĂ  ...

momo
post 09/08/2002 21:50
Message #1


lvl1 male rogue St=1 Dex=5 Int=17 Wi=5 Ch=0
****

Groupe : Modérateurs
Messages : 1,730
Inscrit le : 16/05/2002 23:00
Lieu : .gif
Membre no. 12



.. alors je vais essayer Python ... ça à l'air marrant à premiere vu ...

Ceci est un communiqué sans interet aucun d'un momo qui se desespere de programmer bcp mieux en Basic que dans n'importe quel autre langage


--------------------
Natural evolution insists that we are apes; artificial evolution insists that we are machines with an attitude.
Kevin Kelly - Out of control
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Réponse(s)
momo
post 11/08/2002 15:13
Message #2


lvl1 male rogue St=1 Dex=5 Int=17 Wi=5 Ch=0
****

Groupe : Modérateurs
Messages : 1,730
Inscrit le : 16/05/2002 23:00
Lieu : .gif
Membre no. 12



CODE

from Tkinter import *


def Clear_bton():
Texte.delete(0,END)
Graph.delete(ALL)

def Code_bton():
checksum=0
for pos in range(10):
Graph.create_line(pos,0,pos,64,fill="white")
pos=10
pos=Decode(211214,pos,6)
text=Texte.get()
for x in range(len(text)):
cara=str(text[x])
ctere=-1
for y in range(94):
if cara==Jeu_B[y]:
ctere=y
break
pos=Decode(Codes_B[ctere],pos,6)
checksum=checksum+((x+1)*ctere)
checksum=checksum+104
checksum=checksum%103
print "\nChecksum= %s"%checksum
pos=Decode(Codes_B[checksum],pos,6)
print "\n",
pos=Decode(2331112,pos,7)


def Decode(suite,ps,length):
variable=0
exposant=6
chiffre=0
for boucle in range(length):
essai=str(suite)
chiffre=eval(essai[boucle])
if variable==1:
variable=0
else:
variable=1
print(chiffre),
for pixel in range(chiffre):
if variable==1:
Graph.create_line(ps,0,ps,64)
ps=ps+1
else:
Graph.create_line(ps,0,ps,64,fill="white")
ps=ps+1

return ps


Jeu_B=[" ","!",chr(34),"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[",chr(92),"]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"]
Codes_B=& #91;212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312
,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,22
3112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,11132
3,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,1
13123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,3311
21,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,
141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134
111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121
,412121,111143,111341,131141,114113,114311,411311,113141,114131,311141,411131,21
1412]
root=Tk()
Code=Button(root,text="Code",command=Code_bton)
Code.grid(row=0,column=0)
Clear=Button(root,text="Clear",command=Clear_bton)
Clear.grid(row=0,column=1)
Texte=Entry(root)
Texte.grid(row=1,column=0)
Graph=Canvas()
Graph.grid(row=2,column=2)
root.mainloop()

( le bloc note a un word wrap bizarre au copier/coller ... )
bon, il manque encore la sauvegarde du code sous forme d'image mais je verrais ça plus tard ...


--------------------
Natural evolution insists that we are apes; artificial evolution insists that we are machines with an attitude.
Kevin Kelly - Out of control
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
momo   Pfouuu, java me fait chier, lĂ  ...   09/08/2002 21:50
Darhf   alors un petit article pour toi qui date une peu v...   09/08/2002 22:06
momo   je le relis +/- regulierement ... :)   09/08/2002 22:15
Poischack   arf moi j'ai fait l'inverse python -> java......   09/08/2002 23:30
momo   from Tkinter import * def Clear_button(...   10/08/2002 17:44
Gfx   Rah Python rulez !!!!   10/08/2002 17:44
momo   ben ça :)   10/08/2002 17:45
momo   m'enfin quand on voit ce que supporte ce langage, ...   10/08/2002 17:52
Poischack   tu peux toujours utilisĂ© py2exe, il te fait des e...   10/08/2002 17:57
momo   dwd en cours .. done on verra ça Ă  tĂȘte repos...   10/08/2002 18:03
Poischack   c vrai que elif plus que plus cool que else if ....   10/08/2002 18:20
momo   sans compter qu'il est sacrement rapide : je vou...   11/08/2002 8:53
momo   from Tkinter import * def Clear_bton(...   11/08/2002 15:13
momo   tiens, j'y pense, y a pas moyen de mettre une colo...   11/08/2002 15:15
Poischack   nan et c'est bete, sinon ton prog marche, c'est ...   11/08/2002 15:33
momo   PostĂ© le: Dim AoĂ»t 11, 2002 3:13 pm : "bon, i...   11/08/2002 20:01
Poischack   oula va peut etre falloir que je change de lunette...   11/08/2002 20:03
momo   m'enfin en attendant, "impr. Ecran" et paint font ...   11/08/2002 20:11
Gfx   Y'a des trucs mortels en Python momo, lit mes arti...   11/08/2002 23:36
Poischack   heu .... moi je prefere mes prog qui tiennent su...   11/08/2002 23:38
Gfx   Oui mais c beau techniquement :))) J'ai aussi Ă...   12/08/2002 0:13
Gfx   Au fait, jette un oeil aux gĂ©nĂ©rateurs. Et plutĂ...   12/08/2002 0:20
Gfx   Au fait momo, tu peux compiler le Python sous form...   12/08/2002 1:13
momo   ben le tinker, je l'utilise uniquement parceque tk...   12/08/2002 9:52
momo   tĂ©lĂ©chargement de pyQT : Done tĂ©lĂ©chargement...   12/08/2002 12:53
Gfx   momo, tu as juste besoin de la DLL de QT, qui ne f...   12/08/2002 13:39
momo   bon, de toutes façon, j'ai presque terminĂ© le te...   12/08/2002 13:44
momo   bon voilĂ , done ....   12/08/2002 14:02
momo   localisation spatio-temporelle: Terre, 14/08/2002 ...   14/08/2002 20:59
Poischack   Microsoft, relation publique: pschht pschhtt momo...   14/08/2002 21:15
Gfx   Installe l'extension PIL. Ca rulez pour traiter le...   14/08/2002 21:43
momo   ce serait trop facile du coup ...   14/08/2002 21:46
Poischack   :) pff pourquoi faire facil quan don peut faire co...   14/08/2002 21:51
momo   et pourquoi ne pas develloper sa propre librairie ...   15/08/2002 10:53
momo   from Tkinter import * def Dwords(files...   16/08/2002 10:24


Reply to this topicTopic OptionsStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :
 

Version bas débit Nous sommes le : : 04/07/2025 17:11