Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!1.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp5-1.free.fr!not-for-mail
From: yves
Subject: Re: Tricher au scrabble...
Newsgroups: fr.comp.lang.python
References:
MIME-Version: 1.0
User-Agent: Pan/0.149 (Bellevue; 4c157ba)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Date: 28 Nov 2023 16:05:20 GMT
Lines: 44
Message-ID: <65660fc0$0$6447$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Nov 2023 17:05:20 CET
NNTP-Posting-Host: 91.175.128.103
X-Trace: 1701187520 news-4.free.fr 6447 91.175.128.103:42388
X-Complaints-To: abuse@proxad.net
Bytes: 1679
Le Tue, 28 Nov 2023 11:33:38 +0100, Dominique a écrit:
> Bonjour,
>
> Je m'amuse à faire un logiciel de triche au Scrabble. J'ai bien les
> presque 350 000 mots en français au format txt.
>
> Voici mes débuts :
>
> -----------------------------------------
> f=open('/home/USER/dico.txt')
> scrabble=dict()
> for i in f:
> j=i[:-1]
> mot=list(j)
> mot.sort() mot=''.join(mot) scrabble[str(mot)]=j
> del (mot)
> del (i)
> del(j)
> del (f)
> print('Création du dictionnaire terminée')
> Comment verriez-vous les choses ?
J'aime bien cogiter sur du concret limpide.
Un petit exemple minimal pour la partie "création de dictionnaire" :
En entrée :
dico.txt :
pomme
fraise
orange
En sortie :
le dictionnaire scrabble :
{'emmop': 'pomme', 'aefirs': 'fraise', 'aegnor': 'orange'}
@+
--
Yves