IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Python Discussion :

clés de mon dictionnaire qui ne sont pas reconnue


Sujet :

Python

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 646
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 646
    Par défaut clés de mon dictionnaire qui ne sont pas reconnue
    Bonjour,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    #!/usr/bin/python
     
    import xlrd
    from sys import stderr
    from time import strftime,strptime,mktime
     
    fichiers = {
        'repName': '/home/nbah/Téléchargements',
         'teams': 'Teams_ROA_10_9_2019.xlsx',
        'members': 'TeamMembers_ROA_10_9_2019.xlsx'
    }
     
    with xlrd.open_workbook('%s/%s' % (fichiers['repName'],fichiers['teams'])) as clasr:
    	teamSheet = clasr.sheet_by_index(0)
     
    with xlrd.open_workbook('%s/%s' % (fichiers['repName'],fichiers['members'])) as clasr:
    	memberSheet = clasr.sheet_by_index(0)
     
    for r in range(2,teamSheet.nrows):
    	t = teamSheet.row_values(r)
    	code,categ,continent = t[0],t[2],t[4]
    	if not t[2] in Equipes:
    		Equipes.update(
    			{
    				categ: {
    					continent: [
    						{
    						code : {
    							'name': t[1],
    							'category': t[2],
    							'country': t[3],
    							'continent': t[4],
    							'format': t[5],
    							'email': t[6],
    							'webSite': t[7],
    							'riders': [],
    							'staff': []
    							}
    						}
    					]
    				}
    			}
    		)
    	elif not t[4] in Equipes[categ]:
    		Equipes[categ].update(
    					{
    				continent: [{
    					code : {
    						'name': t[1],
    						'category': t[2],
    						'country': t[3],
    						'continent': t[4],
    						'format': t[5],
    						'email': t[6],
    						'webSite': t[7],
    						'riders': [],
    						'staff': []
    					}
    					}]
    				}
    		)
    	else:
    		Equipes[categ][continent][0].update(
    					{
    					code : {
    						'name': t[1],
    						'category': t[2],
    						'country': t[3],
    						'continent': t[4],
    						'format': t[5],
    						'email': t[6],
    						'webSite': t[7],
    						'riders': [],
    						'staff': []
    					}
    				}
    		)
    ###
    ici le dictionnaire est complet
    ###
    for r in range(2,memberSheet.nrows):
    	m = memberSheet.row_values(r)
    	if m[0] == 'Rider':
    ###
    à un moment, une clé a disparu, et le programme échoue : KeyError
    ###
    		Equipes[m[5]][m[7]][0][m[8]]['riders'].append( m )
    	else:
    		if m[0] == 'Ass. Sports Director': m[0] = 'Sports Director Ass.'
    		Equipes[m[5]][m[7]][0][m[8]]['staff'].append( m )
    je ne comprends pas.
    des 'riders' sont ajoutés pendant un temps, puis une clé (correspondant à [m[8]]) a disparu

    les fichiers sont disponibles ici
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

  2. #2
    Expert confirmé

    Homme Profil pro
    Inscrit en
    Octobre 2008
    Messages
    4 307
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2008
    Messages : 4 307
    Par défaut
    Salut,

    Vu ton dictionnaire:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
    {
    	categ: {
    		continent: [
    			{
    			code : {
    				'name': t[1],
    				'category': t[2],
    				'country': t[3],
    				'continent': t[4],
    				'format': t[5],
    				'email': t[6],
    				'webSite': t[7],
    				'riders': [],
    				'staff': []
    				}
    			}
    		]
    	}
    }
    et la façon dont tu y accèdes Equipes[m[5]] [m[7]] [0] [m[8]] ['riders'] m[8] correspond à la clef "code", c'est bien cela ?

    À ta place, je ferais ainsi pour commencer:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    for r in range(2,memberSheet.nrows):
    	m = memberSheet.row_values(r)
    	if m[0] == 'Rider':
            try:
                Equipes[m[5]][m[7]][0][m[8]]['riders'].append( m )
            except KeyError as why:
                print("Key error: %s" % why)
                print(m)
                print(Equipes[m[5]][m[7]][0])
    	else:
            ...
    Note: j'utilise des espaces pas des tabulations ...

  3. #3
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 646
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 646
    Par défaut
    oui, c'est bien ça, m[8] est la clé code.

    pour commencer:
    ensuite, que dois-je regarder ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    Key error: 'BRC'
    ['Rider', 'ABAY', 'Burak', '01/01/1996', 'Male', 'CTM', 'TUR', 'EUR', 'BRC', 'BRUNEI CONTINENTAL CYCLING TEAM', '10014955057']
    {'ACS': {'name': 'AC SPARTA PRAHA', 'category': 'CTM', 'country': 'CZE', 'continent': 'EUR', 'format': '', 'email': 'rubas@sparta-cycling.cz', 'webSite': 'http://www.sparta-cycling.com', 'riders': [], 'staff': []},
     'ADR': {'name': 'ADRIA MOBIL', 'category': 'CTM', 'country': 'SLO', 'continent': 'EUR', 'format': '', 'email': 'cycling@adria-mobil.com', 'webSite': 'http://www.adria-mobil-cycling.com/si', 'riders': [], 'staff': []},
     'AKT': {'name': 'AKROS - THÖMUS', 'category': 'CTM', 'country': 'SUI', 'continent': 'EUR', 'format': '', 'email': 'info@cycswiss.ch', 'webSite': 'http://www.cycswiss.ch', 'riders': [], 'staff': []},
     'ALE': {'name': 'ALECTO CYCLINGTEAM', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'pietrooijakkers@yahoo.co.uk', 'webSite': 'https://alectocyclingteam.nl/', 'riders': [], 'staff': []},
     'AMO': {'name': 'AMORE & VITA - PRODIR', 'category': 'CTM', 'country': 'LAT', 'continent': 'EUR', 'format': '', 'email': 'cristian.fanini@gmail.com', 'webSite': 'http://www.team-amoreevita.com/', 'riders': [], 'staff': []},
     'AVL': {'name': 'AVILUDO - LOULETANO', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'louletanodc@mail.telepac.pt', 'webSite': 'https://louletano.pt', 'riders': [], 'staff': []},
     'BRT': {'name': 'BEAT CYCLING CLUB', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'road@beatcycling.club', 'webSite': 'https://www.beatcycling.club', 'riders': [], 'staff': []},
     'BHP': {'name': "BELTRAMITSA HOPPLA' PETROLI FIRENZE", 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 's.teambeltramiu23@libero.it', 'webSite': 'http://teambeltramiargin18.it', 'riders': [], 'staff': []},
     'ABB': {'name': 'BHS - ALMEBORG BORNHOLM', 'category': 'CTM', 'country': 'DEN', 'continent': 'EUR', 'format': '', 'email': 'info@andreasen-sport.dk', 'webSite': 'http://bhs-almeborg.dk/', 'riders': [], 'staff': []},
     ...snip...
     'JFN': {'name': 'JOKER FUEL OF NORWAY', 'category': 'CTM', 'country': 'NOR', 'continent': 'EUR', 'format': '', 'email': 'post@jokericopal.no', 'webSite': 'https://www.jokericopal.com', 'riders': [['Rider', 'AASHEIM', 'Aksel Fischer', '16/05/1997', 'Male', 'CTM', 'NOR', 'EUR', 'JFN', 'JOKER FUEL OF NORWAY', '10010201047']], 'staff': []},
     'KMT': {'name': 'KOMETA CYCLING TEAM', 'category': 'CTM', 'country': 'ESP', 'continent': 'EUR', 'format': '', 'email': 'info@polarteckometateam.com', 'webSite': 'http://polarteckometateam.com', 'riders': [], 'staff': []},
     'TKC': {'name': 'KYIV CAPITAL TEAM', 'category': 'CTM', 'country': 'UKR', 'continent': 'EUR', 'format': '', 'email': 'info@kolss-team.com', 'webSite': 'http://www.kolss-team.com', 'riders': [], 'staff': []},
     'LAA': {'name': 'L. A. ALUMINIOS / L. A. SPORT', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'geral@aluminios.la', 'webSite': 'http://www.aluminios.la/', 'riders': [], 'staff': []},
     'LPC': {'name': 'LEOPARD PRO CYCLING', 'category': 'CTM', 'country': 'LUX', 'continent': 'EUR', 'format': '', 'email': 'info@leopard.lu', 'webSite': 'http://leopardracing.com', 'riders': [], 'staff': []},
     'LGS': {'name': 'LJUBLJANA GUSTO SANTIC', 'category': 'CTM', 'country': 'SLO', 'continent': 'EUR', 'format': '', 'email': 'info@kdrog.si', 'webSite': 'http://kdrog.si', 'riders': [], 'staff': []},
     'LKT': {'name': 'LKT TEAM BRANDENBURG', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'steffen@blochwitz.biz', 'webSite': 'https://lkt-team-brandenburg.de/', 'riders': [], 'staff': []},
     'LOK': {'name': 'LOKOSPHINX', 'category': 'CTM', 'country': 'RUS', 'continent': 'EUR', 'format': '', 'email': 'lokosfinks@mail.ru', 'webSite': 'http://velodrom.spb.ru', 'riders': [], 'staff': []},
     'LCT': {'name': 'LVIV CYCLING TEAM', 'category': 'CTM', 'country': 'UKR', 'continent': 'EUR', 'format': '', 'email': 'lvivcycling@gmail.com', 'webSite': 'https://www.facebook.com/Lviv-Cycling-Team-2007999', 'riders': [], 'staff': []},
    ...snip..
     'SEG': {'name': 'SEG RACING ACADEMY', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'info@segracing.com', 'webSite': 'https://segracing.com/', 'riders': [], 'staff': []}, 'CTN': {'name': 'SPORT.LAND. NIEDERÖSTERREICH SELLE SMP - ST. RICH', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'cyclingnoe@gmail.com', 'webSite': 'https://www.cyclingnoe.com', 'riders': [], 'staff': []},
     'STA': {'name': 'SPORTING / TAVIRA', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'info@ciclismodetavira.pt', 'webSite': 'https://www.ciclismodetavira.pt', 'riders': [], 'staff': []},
     'AUB': {'name': 'ST MICHEL - AUBER 93', 'category': 'CTM', 'country': 'FRA', 'continent': 'EUR', 'format': '', 'email': 'auber93@wanadoo.fr', 'webSite': 'http://www.StMichel-Auber93.fr', 'riders': [], 'staff': []},
     'SCB': {'name': 'SWIFTCARBON PRO CYCLING', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'paul@swiftcarbonprocycling.co.uk', 'webSite': 'http://www.swiftcarbonprocycling.co.uk', 'riders': [], 'staff': []},
     'SRA': {'name': 'SWISS RACING ACADEMY', 'category': 'CTM', 'country': 'SUI', 'continent': 'EUR', 'format': '', 'email': 'info@swissracingacademy.ch', 'webSite': 'http://www.swissracingacademy.ch', 'riders': [], 'staff': []},
     'TIS': {'name': 'TARTELETTO - ISOREX', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'peter@wielerploeg.be', 'webSite': 'http://www.wielerploeg.be', 'riders': [], 'staff': []},
     'TCQ': {'name': 'TEAM COLOQUICK', 'category': 'CTM', 'country': 'DEN', 'continent': 'EUR', 'format': '', 'email': 'perbaadsgaard@gmail.com', 'webSite': 'https://www.coloquickcycling.dk', 'riders': [], 'staff': []},
     'CPK': {'name': 'TEAM COLPACK', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'info@teamcolpack.it', 'webSite': 'http://www.teamcolpack.it', 'riders': [], 'staff': []},
     'TCO': {'name': 'TEAM COOP', 'category': 'CTM', 'country': 'NOR', 'continent': 'EUR', 'format': '', 'email': 'jan-erik@teamcoopsykkel.no', 'webSite': 'http://www.teamcoopsykkel.no', 'riders': [['Rider', 'AALRUST', 'Håkon Lunder', '05/01/1998', 'Male', 'CTM', 'NOR', 'EUR', 'TCO', 'TEAM COOP', '10010611477'], ['Rider', 'AASVOLD', 'Kristian', '30/05/1995', 'Male', 'CTM', 'NOR', 'EUR', 'TCO', 'TEAM COOP', '10008659353']], 'staff': []},
     'TDA': {'name': 'TEAM DAUNER | AKKON', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'office@dauner-akkon-cycling.com', 'webSite': 'http://dauner-akkon-cycling.com/', 'riders': [], 'staff': []},
     'CCD': {'name': 'TEAM DIFFERDANGE GEBA', 'category': 'CTM', 'country': 'LUX', 'continent': 'EUR', 'format': '', 'email': 'gatti.gabriel02@gmail.com', 'webSite': 'https://www.continentalteamdifferdange.lu', 'riders': [], 'staff': []},
    ...snip...
     'VOS': {'name': 'VOSTER ATS TEAM', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'vosteruniwheelsteam@gmail.com', 'webSite': 'http://www.vosteratsteam.pl/', 'riders': [], 'staff': []},
     'WBD': {'name': 'WALLONIE - BRUXELLES DEVELOPMENT TEAM', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'julie.wavrelle@trworg.be', 'webSite': 'https://www.foac.be/', 'riders': [], 'staff': []},
     'WIB': {'name': 'WIBATECH MERX', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'wibatech.ciasnocha@wp.pl', 'webSite': 'http://www.wibatech.eu', 'riders': [], 'staff': []}}
    Key error: 'NIP'
    ['Rider', 'ACOSTA OSPINA', 'Ruben Dario', '20/08/1996', 'Male', 'PCT', 'COL', 'AME', 'NIP', "NIPPO - VINI FANTINI - FAIZANE'", '10035520976']
    ...snip...
    During handling of the above exception, another exception occurred:
     
    Traceback (most recent call last):
      File "bin/UCIteams-members_xlsx_parser_v4.py", line 115, in <module>
        print(Equipes[m[5]][m[7]][0])
    KeyError: 'AFR'
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

  4. #4
    Membre prolifique
    Avatar de Sve@r
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2006
    Messages
    12 827
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Février 2006
    Messages : 12 827
    Billets dans le blog
    1
    Par défaut
    Bonjour
    Citation Envoyé par N_BaH Voir le message
    ensuite, que dois-je regarder ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Key error: 'BRC'
    {'ACS': {'name': 'AC SPARTA PRAHA', 'category': 'CTM', 'country': 'CZE', 'continent': 'EUR', 'format': '', 'email': 'rubas@sparta-cycling.cz', 'webSite': 'http://www.sparta-cycling.com', 'riders': [], 'staff': []}, 'ADR': {'name': 'ADRIA MOBIL', 'category': 'CTM', 'country': 'SLO', 'continent': 'EUR', 'format': '', 'email': 'cycling@adria-mobil.com', 'webSite': 'http://www.adria-mobil-cycling.com/si', 'riders': [], 'staff': []}, 'AKT': {'name': 'AKROS - THÖMUS', 'category': 'CTM', 'country': 'SUI', 'continent': 'EUR', 'format': '', 'email': 'info@cycswiss.ch', 'webSite': 'http://www.cycswiss.ch', 'riders': [], 'staff': []}, 'ALE': {'name': 'ALECTO CYCLINGTEAM', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'pietrooijakkers@yahoo.co.uk', 'webSite': 'https://alectocyclingteam.nl/', 'riders': [], 'staff': []}, 'AMO': {'name': 'AMORE & VITA - PRODIR', 'category': 'CTM', 'country': 'LAT', 'continent': 'EUR', 'format': '', 'email': 'cristian.fanini@gmail.com', 'webSite': 'http://www.team-amoreevita.com/', 'riders': [], 'staff': []}, 'AVL': {'name': 'AVILUDO - LOULETANO', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'louletanodc@mail.telepac.pt', 'webSite': 'https://louletano.pt', 'riders': [], 'staff': []}, 'BRT': {'name': 'BEAT CYCLING CLUB', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'road@beatcycling.club', 'webSite': 'https://www.beatcycling.club', 'riders': [], 'staff': []}, 'BHP': {'name': "BELTRAMITSA HOPPLA' PETROLI FIRENZE", 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 's.teambeltramiu23@libero.it', 'webSite': 'http://teambeltramiargin18.it', 'riders': [], 'staff': []}, 'ABB': {'name': 'BHS - ALMEBORG BORNHOLM', 'category': 'CTM', 'country': 'DEN', 'continent': 'EUR', 'format': '', 'email': 'info@andreasen-sport.dk', 'webSite': 'http://bhs-almeborg.dk/', 'riders': [], 'staff': []}, 'BIC': {'name': 'BIESSE CARRERA', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'team@biessecarrera.com', 'webSite': 'https://www.biessecarrera.com/', 'riders': [], 'staff': []}, 'BAI': {'name': 'BIKE AID', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'team@windkante.com', 'webSite': 'https://road.bike-aid.de', 'riders': [], 'staff': []}, 'DHB': {'name': 'CANYON DHB P /   B BLOOR HOMES', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'tim@canyoneisberg.co.uk', 'webSite': 'https://canyoneisberg.co.uk', 'riders': [], 'staff': []}, 'CDT': {'name': 'CCC DEVELOPMENT TEAM', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'proteam@cccsport.eu', 'webSite': 'https://cccsport.eu', 'riders': [], 'staff': []}, 'CIB': {'name': 'CIBEL', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'gaspard.vanpeteghem@sint-niklaas.be', 'webSite': 'https://www.team-cibel-cebon.be', 'riders': [], 'staff': []}, 'CTF': {'name': 'CYCLING TEAM FRIULI ASD', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'cyclingteamfriuli@gmail.com', 'webSite': 'http://www.ctfriuli.com', 'riders': [], 'staff': []}, 'AZT': {'name': "D'AMICO UM TOOLS", 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'info@areazeroproteam.com', 'webSite': 'https://www.areazeroproteam.com', 'riders': [], 'staff': []}, 'DSU': {'name': 'DEVELOPMENT TEAM SUNWEB', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'cycling@keep-challenging.com', 'webSite': 'http://www.teamsunweb.com', 'riders': [], 'staff': []}, 'DDC': {'name': 'DIMENSION DATA FOR QHUBEKA CONTINENTAL TEAM', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'ddrafricandevelopment@gmail.com', 'webSite': 'http://www.africasteam.com', 'riders': [], 'staff': []}, 'DKB': {'name': 'DUKLA BANSKA BYSTRICA', 'category': 'CTM', 'country': 'SVK', 'continent': 'EUR', 'format': '', 'email': 'frano@duklacycling.eu', 'webSite': 'http://duklacycling.eu/', 'riders': [], 'staff': []}, 'EFP': {'name': 'EFAPEL', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'geral@fullracing.pt', 'webSite': 'https://www.fullracing.pt/', 'riders': [], 'staff': []}, 'ELA': {'name': 'ELKOV - AUTHOR', 'category': 'CTM', 'country': 'CZE', 'continent': 'EUR', 'format': '', 'email': 'info@hkcycling.cz', 'webSite': 'http://www.hkcycling.cz', 'riders': [], 'staff': []}, 'EUK': {'name': 'EQUIPO EUSKADI', 'category': 'CTM', 'country': 'ESP', 'continent': 'EUR', 'format': '', 'email': 'fundacion@fundacioneuskadi.eus', 'webSite': 'https://www.fundacioneuskadi.eus', 'riders': [], 'staff': []}, 'EVO': {'name': 'EVOPRO RACING', 'category': 'CTM', 'country': 'IRL', 'continent': 'EUR', 'format': '', 'email': 'morgan@evoproracing.com', 'webSite': 'http://www.evoproracing.com', 'riders': [], 'staff': []}, 'FCT': {'name': 'FEREI PRO CYCLING TEAM', 'category': 'CTM', 'country': 'UKR', 'continent': 'EUR', 'format': '', 'email': 'fereiprocycling@gmail.com', 'webSite': 'http://www.tvorproject.com/', 'riders': [], 'staff': []}, 'GTV': {'name': 'GIOTTI VICTORIA', 'category': 'CTM', 'country': 'ROU', 'continent': 'EUR', 'format': '', 'email': 'savoryacyclingteam@gmail.com', 'webSite': 'https://savoryacyclingteam.ro/', 'riders': [], 'staff': []}, 'CGF': {'name': 'GROUPAMA - FDJ', 'category': 'CTM', 'country': 'FRA', 'continent': 'EUR', 'format': '', 'email': 'david.lebourdiec@equipegroupamafdj.fr', 'webSite': 'http://www.equipecycliste-groupama-fdj.fr', 'riders': [], 'staff': []}, 'HRN': {'name': 'HEIZOMAT RAD - NET.DE', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'info@heizomat-rad-net.de', 'webSite': 'https://www.heizomat-rad-net.de', 'riders': [], 'staff': []}, 'HRR': {'name': 'HERRMANN RADTEAM', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'teamleitung@radteam-herrmann.de', 'webSite': 'https://www.herrmann-radteam.de', 'riders': [], 'staff': []}, 'HAC': {'name': 'HRINKOW ADVARICS CYCLEANG', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'alexander@hrinkow-bikes.at', 'webSite': 'http://www.cycleang.com', 'riders': [], 'staff': []}, 'THU': {'name': 'HUROM BDC DEVELOPMENT', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'info@hurom.team', 'webSite': 'https://hurom.team/', 'riders': [], 'staff': []}, 'IAM': {'name': 'IAM EXCELSIOR', 'category': 'CTM', 'country': 'SUI', 'continent': 'EUR', 'format': '', 'email': 'info@iam-excelsior.ch', 'webSite': 'http://vcmartigny.ch/iam-excelsior/', 'riders': [], 'staff': []}, 'IRC': {'name': 'ISEO SERRATURE - RIME - CARNOVALI', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'iseorimecarnovali@gmail.com', 'webSite': 'https://www.iseorimecarnovali.com', 'riders': [], 'staff': []}, 'JFN': {'name': 'JOKER FUEL OF NORWAY', 'category': 'CTM', 'country': 'NOR', 'continent': 'EUR', 'format': '', 'email': 'post@jokericopal.no', 'webSite': 'https://www.jokericopal.com', 'riders': [['Rider', 'AASHEIM', 'Aksel Fischer', '16/05/1997', 'Male', 'CTM', 'NOR', 'EUR', 'JFN', 'JOKER FUEL OF NORWAY', '10010201047']], 'staff': []}, 'KMT': {'name': 'KOMETA CYCLING TEAM', 'category': 'CTM', 'country': 'ESP', 'continent': 'EUR', 'format': '', 'email': 'info@polarteckometateam.com', 'webSite': 'http://polarteckometateam.com', 'riders': [], 'staff': []}, 'TKC': {'name': 'KYIV CAPITAL TEAM', 'category': 'CTM', 'country': 'UKR', 'continent': 'EUR', 'format': '', 'email': 'info@kolss-team.com', 'webSite': 'http://www.kolss-team.com', 'riders': [], 'staff': []}, 'LAA': {'name': 'L. A. ALUMINIOS / L. A. SPORT', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'geral@aluminios.la', 'webSite': 'http://www.aluminios.la/', 'riders': [], 'staff': []}, 'LPC': {'name': 'LEOPARD PRO CYCLING', 'category': 'CTM', 'country': 'LUX', 'continent': 'EUR', 'format': '', 'email': 'info@leopard.lu', 'webSite': 'http://leopardracing.com', 'riders': [], 'staff': []}, 'LGS': {'name': 'LJUBLJANA GUSTO SANTIC', 'category': 'CTM', 'country': 'SLO', 'continent': 'EUR', 'format': '', 'email': 'info@kdrog.si', 'webSite': 'http://kdrog.si', 'riders': [], 'staff': []}, 'LKT': {'name': 'LKT TEAM BRANDENBURG', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'steffen@blochwitz.biz', 'webSite': 'https://lkt-team-brandenburg.de/', 'riders': [], 'staff': []}, 'LOK': {'name': 'LOKOSPHINX', 'category': 'CTM', 'country': 'RUS', 'continent': 'EUR', 'format': '', 'email': 'lokosfinks@mail.ru', 'webSite': 'http://velodrom.spb.ru', 'riders': [], 'staff': []}, 'LCT': {'name': 'LVIV CYCLING TEAM', 'category': 'CTM', 'country': 'UKR', 'continent': 'EUR', 'format': '', 'email': 'lvivcycling@gmail.com', 'webSite': 'https://www.facebook.com/Lviv-Cycling-Team-2007999', 'riders': [], 'staff': []}, 'MGT': {'name': 'MADISON GENESIS', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'roger.hammond@madison.co.uk', 'webSite': 'https://www.madison.co.uk/', 'riders': [], 'staff': []}, 'MPB': {'name': 'MALOJA PUSHBIKERS', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'office@radrennteam-graz.com', 'webSite': 'http://www.pushbikers.com/', 'riders': [], 'staff': []}, 'MPC': {'name': 'MEMIL PRO CYCLING', 'category': 'CTM', 'country': 'SWE', 'continent': 'EUR', 'format': '', 'email': 'info@memilprocycling.com', 'webSite': 'http://www.memilprocycling.com', 'riders': [], 'staff': []}, 'MKT': {'name': 'MERIDIANA KAMEN TEAM', 'category': 'CTM', 'country': 'CRO', 'continent': 'EUR', 'format': '', 'email': 'bk.kamen.pazin@pu.t-com.hr', 'webSite': 'http://www.teammeridiana.it/', 'riders': [], 'staff': []}, 'MET': {'name': 'METEC - TKH CONTINENTAL CYCLINGTEAM P / B MANTEL', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'gchoften@gmail.com', 'webSite': 'http://www.meteccyclingteam.nl', 'riders': [], 'staff': []}, 'MCC': {'name': 'MINSK CYCLING CLUB', 'category': 'CTM', 'country': 'BLR', 'continent': 'EUR', 'format': '', 'email': 'info@minskcyclingclub.com', 'webSite': 'http://www.minskcyclingclub.com', 'riders': [], 'staff': []}, 'MIR': {'name': 'MIRANDA -  MORTÁGUA', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'veloclubedocentro@hotmail.com', 'webSite': 'http://www.miranda-mortagua.com', 'riders': [], 'staff': []}, 'MTA': {'name': 'MONKEY TOWN - A BLOCK CT', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'info@monkeytownct.nl', 'webSite': 'https://www.monkeytownct.nl', 'riders': [], 'staff': []}, 'NRL': {'name': 'NATURA4EVER - ROUBAIX - LILLE METROPOLE', 'category': 'CTM', 'country': 'FRA', 'continent': 'EUR', 'format': '', 'email': 'veloclubroubaix@nordnet.fr', 'webSite': 'http://www.equipe-cycliste-roubaix.com', 'riders': [], 'staff': []}, 'PUS': {'name': 'P & S METALLTECHNIK', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'info@larswackernagel.de', 'webSite': 'http://www.team-pus-metalltechnik.de', 'riders': [], 'staff': []}, 'PNN': {'name': 'PANNON CYCLING TEAM', 'category': 'CTM', 'country': 'HUN', 'continent': 'EUR', 'format': '', 'email': 'drbatorfibela@gmail.com', 'webSite': 'http://www.pannoncycling.hu', 'riders': [], 'staff': []}, 'PSB': {'name': 'PAUWELS SAUZEN – BINGOAL', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'jm@vistamedia.be', 'webSite': 'http://www.pauwelssauzen-bingoal.be', 'riders': [], 'staff': []}, 'RPB': {'name': 'RADIO POPULAR - BOAVISTA', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'boavistaciclismoclube@gmail.com', 'webSite': 'http://www.boavistaciclismo.com', 'riders': [], 'staff': []}, 'RPC': {'name': 'RIBBLE PRO CYCLING', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'team@ribbleprocycling.co.uk', 'webSite': 'http://www.ribbleprocycling.co.uk', 'riders': [], 'staff': []}, 'SBB': {'name': 'SALCANO SAKARYA BB TEAM', 'category': 'CTM', 'country': 'TUR', 'continent': 'EUR', 'format': '', 'email': 'info@sakarya2020.org', 'webSite': 'http://www.sakarya2020.org', 'riders': [], 'staff': []}, 'SAN': {'name': 'SANGEMINI - TREVIGIANI - MG.K VIS', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'info@jommidemetrio.com', 'webSite': 'http://www.jommidemetrio.com', 'riders': [], 'staff': []}, 'SEG': {'name': 'SEG RACING ACADEMY', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'info@segracing.com', 'webSite': 'https://segracing.com/', 'riders': [], 'staff': []}, 'CTN': {'name': 'SPORT.LAND. NIEDERÖSTERREICH SELLE SMP - ST. RICH', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'cyclingnoe@gmail.com', 'webSite': 'https://www.cyclingnoe.com', 'riders': [], 'staff': []}, 'STA': {'name': 'SPORTING / TAVIRA', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'info@ciclismodetavira.pt', 'webSite': 'https://www.ciclismodetavira.pt', 'riders': [], 'staff': []}, 'AUB': {'name': 'ST MICHEL - AUBER 93', 'category': 'CTM', 'country': 'FRA', 'continent': 'EUR', 'format': '', 'email': 'auber93@wanadoo.fr', 'webSite': 'http://www.StMichel-Auber93.fr', 'riders': [], 'staff': []}, 'SCB': {'name': 'SWIFTCARBON PRO CYCLING', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'paul@swiftcarbonprocycling.co.uk', 'webSite': 'http://www.swiftcarbonprocycling.co.uk', 'riders': [], 'staff': []}, 'SRA': {'name': 'SWISS RACING ACADEMY', 'category': 'CTM', 'country': 'SUI', 'continent': 'EUR', 'format': '', 'email': 'info@swissracingacademy.ch', 'webSite': 'http://www.swissracingacademy.ch', 'riders': [], 'staff': []}, 'TIS': {'name': 'TARTELETTO - ISOREX', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'peter@wielerploeg.be', 'webSite': 'http://www.wielerploeg.be', 'riders': [], 'staff': []}, 'TCQ': {'name': 'TEAM COLOQUICK', 'category': 'CTM', 'country': 'DEN', 'continent': 'EUR', 'format': '', 'email': 'perbaadsgaard@gmail.com', 'webSite': 'https://www.coloquickcycling.dk', 'riders': [], 'staff': []}, 'CPK': {'name': 'TEAM COLPACK', 'category': 'CTM', 'country': 'ITA', 'continent': 'EUR', 'format': '', 'email': 'info@teamcolpack.it', 'webSite': 'http://www.teamcolpack.it', 'riders': [], 'staff': []}, 'TCO': {'name': 'TEAM COOP', 'category': 'CTM', 'country': 'NOR', 'continent': 'EUR', 'format': '', 'email': 'jan-erik@teamcoopsykkel.no', 'webSite': 'http://www.teamcoopsykkel.no', 'riders': [['Rider', 'AALRUST', 'Håkon Lunder', '05/01/1998', 'Male', 'CTM', 'NOR', 'EUR', 'TCO', 'TEAM COOP', '10010611477'], ['Rider', 'AASVOLD', 'Kristian', '30/05/1995', 'Male', 'CTM', 'NOR', 'EUR', 'TCO', 'TEAM COOP', '10008659353']], 'staff': []}, 'TDA': {'name': 'TEAM DAUNER | AKKON', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'office@dauner-akkon-cycling.com', 'webSite': 'http://dauner-akkon-cycling.com/', 'riders': [], 'staff': []}, 'CCD': {'name': 'TEAM DIFFERDANGE GEBA', 'category': 'CTM', 'country': 'LUX', 'continent': 'EUR', 'format': '', 'email': 'gatti.gabriel02@gmail.com', 'webSite': 'https://www.continentalteamdifferdange.lu', 'riders': [], 'staff': []}, 'RSW': {'name': 'TEAM FELBERMAYR SIMPLON WELS', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'office@rsw-radsport.at', 'webSite': 'http://www.rsw-radsport.at', 'riders': [], 'staff': []}, 'LKH': {'name': 'TEAM LOTTO - KERN HAUS', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'florian.monreal@team-lotto-kernhaus.de', 'webSite': 'http://www.team-lotto-kernhaus.de', 'riders': [], 'staff': []}, 'TNV': {'name': 'TEAM NOVAK', 'category': 'CTM', 'country': 'ROU', 'continent': 'EUR', 'format': '', 'email': 'cycling@novakgroup.ro', 'webSite': 'https://www.facebook.com/TNVContinentalCyclingTeam', 'riders': [], 'staff': []}, 'SVL': {'name': 'TEAM SAUERLAND NRW P / B SKS GERMANY', 'category': 'CTM', 'country': 'GER', 'continent': 'EUR', 'format': '', 'email': 'info@svl-sports.de', 'webSite': 'https://www.team-sauerland.com', 'riders': [], 'staff': []}, 'VBG': {'name': 'TEAM VORARLBERG SANTIC', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'organisation@proevent-cycling.at', 'webSite': 'https://www.team-vorarlberg.at/', 'riders': [], 'staff': []}, 'WAO': {'name': 'TEAM WAOO', 'category': 'CTM', 'country': 'DEN', 'continent': 'EUR', 'format': '', 'email': 'cp@virtucycling.com', 'webSite': 'https://teamvirtucycling.com/', 'riders': [], 'staff': []}, 'WGN': {'name': 'TEAM WIGGINS LECOL', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'andrew@trinitysportsmanagement.com', 'webSite': 'https://www.teamwiggins.co.uk', 'riders': [], 'staff': []}, 'TFL': {'name': 'TELENET FIDEA LIONS', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'karen.ramakers@sncyclingteam.be', 'webSite': 'http://www.telenetfidealions.be', 'riders': [], 'staff': []}, 'TIR': {'name': 'TIROL KTM CYCLING TEAM', 'category': 'CTM', 'country': 'AUT', 'continent': 'EUR', 'format': '', 'email': 'office@team-radlandtirol.at', 'webSite': 'http://ridewithpassion.tirol', 'riders': [], 'staff': []}, 'SKC': {'name': 'TUFO – PARDUS PROSTEJOV', 'category': 'CTM', 'country': 'CZE', 'continent': 'EUR', 'format': '', 'email': 'info@skcprostejov.cz', 'webSite': 'https://www.skcprostejov.cz', 'riders': [], 'staff': []}, 'UIO': {'name': 'UD OLIVEIRENSE / INOUTBUILD', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'geral@bikecp.pt', 'webSite': 'http://www.bikecp.pt/', 'riders': [], 'staff': []}, 'UXT': {'name': 'UNO - X NORWEGIAN DEVELOPMENT TEAM', 'category': 'CTM', 'country': 'NOR', 'continent': 'EUR', 'format': '', 'email': 'jens.haugland@unox.no', 'webSite': 'https://unoxteam.no/nyheter', 'riders': [], 'staff': []}, 'CDF': {'name': 'VITO - FEIRENSE - PNB', 'category': 'CTM', 'country': 'POR', 'continent': 'EUR', 'format': '', 'email': 'secretaria@cdfeirense.pt', 'webSite': 'http://www.cdfeirense.pt/site/ciclismo/', 'riders': [], 'staff': []}, 'VIT': {'name': 'VITUS PRO CYCLING  P / B BROTHER UK', 'category': 'CTM', 'country': 'GBR', 'continent': 'EUR', 'format': '', 'email': 'cheriepridham@me.com', 'webSite': 'https://vitusprocycling.com/', 'riders': [], 'staff': []}, 'VLA': {'name': 'VLASMAN CT', 'category': 'CTM', 'country': 'NED', 'continent': 'EUR', 'format': '', 'email': 'dhr.welling@planet.nl', 'webSite': 'https://www.vlasmancyclingteam.nl', 'riders': [], 'staff': []}, 'VOS': {'name': 'VOSTER ATS TEAM', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'vosteruniwheelsteam@gmail.com', 'webSite': 'http://www.vosteratsteam.pl/', 'riders': [], 'staff': []}, 'WBD': {'name': 'WALLONIE - BRUXELLES DEVELOPMENT TEAM', 'category': 'CTM', 'country': 'BEL', 'continent': 'EUR', 'format': '', 'email': 'julie.wavrelle@trworg.be', 'webSite': 'https://www.foac.be/', 'riders': [], 'staff': []}, 'WIB': {'name': 'WIBATECH MERX', 'category': 'CTM', 'country': 'POL', 'continent': 'EUR', 'format': '', 'email': 'wibatech.ciasnocha@wp.pl', 'webSite': 'http://www.wibatech.eu', 'riders': [], 'staff': []}}
    VinsS a rajouté une gestion d'exception pour afficher le dictionnaire quand la clef n'est pas trouvée.
    Donc tu demandes Equipes[m[5]][m[7]][0][m[8]]["riders"]. Mais pour arriver jusqu'à la clef "riders", il faut déjà arriver jusqu'à la clef [m[8]] (qui vaut "BRC" puisque "m" vaut ['Rider', 'ABAY', 'Burak', '01/01/1996', 'Male', 'CTM', 'TUR', 'EUR', 'BRC', 'BRUNEI CONTINENTAL CYCLING TEAM', '10014955057']). Mais il n'y arrive pas et la gestion d'exception de Vins t'affiche donc à l'écran le contenu de Equipes[m[5]][m[7]][0].

    Et (j'ai recopié ce dico imbittable dans "vi"), force est de constater que la clef "BRC" ne s'y trouve effectivement pas. Ce n'est pas "riders" qui a disparu, c'est une clef que tu utilises à un niveau supérieur qui n'existe pas...
    Pour info, voici la liste de clefs triées alphabétiquement (merci "vi" et "sort "parce que sans eux je faisais pas ce travail): 'ABB' 'ACS' 'ADR' 'AKT' 'ALE' 'AUB' 'AVL' 'AZT' 'BAI' 'BHP' 'BIC' 'BRT' 'CCD' 'CDF' 'CDT' 'CGF' 'CIB' 'CPK' 'CTF' 'CTN' 'DDC' 'DHB' 'DKB' 'DSU' 'EFP' 'ELA' 'EUK' 'EVO' 'FCT' 'GTV' 'HAC' 'HRN' 'HRR' 'IAM' 'IRC' 'JFN' 'KMT' 'LAA' 'LCT' 'LGS' 'LKH' 'LKT' 'LOK' 'LPC' 'MCC' 'MET' 'MGT' 'MIR' 'MKT' 'MPB' 'MPC' 'MTA' 'NRL' 'PNN' 'PSB' 'PUS' 'RPB' 'RPC' 'RSW' 'SAN' 'SBB' 'SCB' 'SEG' 'SKC' 'SRA' 'STA' 'SVL' 'TCO' 'TCQ' 'TDA' 'TFL' 'THU' 'TIR' 'TIS' 'TKC' 'TNV' 'UIO' 'UXT' 'VBG' 'VIT' 'VLA' 'VOS' 'WAO' 'WBD' 'WGN' 'WIB'.

    Et sinon euh... tu t'en sors avec ce truc en 136 dimensions ???
    Mon Tutoriel sur la programmation «Python»
    Mon Tutoriel sur la programmation «Shell»
    Sinon il y en a pleins d'autres. N'oubliez pas non plus les différentes faq disponibles sur ce site
    Et on poste ses codes entre balises [code] et [/code]

  5. #5
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 646
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 646
    Par défaut
    ça ne me semble pas pire qu'un JSON.

    le but est de demander à l'utilisateur quelle catégorie, puis quel continent, et enfin quelle équipe, en proposant les choix possibles à chaque étapes.
    tu ferais différemment ?

    edit:
    ouch.
    ce n'est peut-être pas aussi "simple" qu'une clé qui disparaît, comme s'en plaint python, car le dictionnaire se remplit, et la clé est bien présente.
    c'est visible quand j'insère ce code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
                    except KeyError as why:                                                                                                 
                            print("Key error: %s" % why)
                            print(m)       
                            for kt in Equipes.keys():
                                    print(kt)                       
                                    for co in Equipes[kt].keys():    
                                            print('\t'+co)        
                                            for tm in sorted(Equipes[kt][co][0].keys()):
                                                    print('\t\t'+tm+' : ', end='')
                                                    print(Equipes[kt][co][0][tm]['riders'])
    quand il y a une exception
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Key error: 'BRC'
    ['Rider', 'ABAY', 'Burak', '01/01/1996', 'Male', 'CTM', 'TUR', 'EUR', 'BRC', 'BRUNEI CONTINENTAL CYCLING TEAM', '10014955057']
    CTM
            AME
    ...snip...
    Key error: 'NIP'
    ['Rider', 'ACOSTA OSPINA', 'Ruben Dario', '20/08/1996', 'Male', 'PCT', 'COL', 'AME', 'NIP', "NIPPO - VINI FANTINI - FAIZANE'", '10035520976']
    CTM
            AME
                    3O3 : []
    ...snip...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
            ASI
                    7RP : []
                    AIS : []
                    APL : []
                    BGT : []
                    BLZ : [['Rider', 'ABE', 'Takayuki', '12/06/1986', 'Male', 'CTM', 'JPN', 'ASI', 'BLZ', 'UTSUNOMIYA BLITZEN', '10006143013']]
                    BRC : [['Rider', 'ABD AZIZ', 'Muhammad Raihaan', '11/04/1988', 'Male', 'CTM', 'BRU', 'ASI', 'BRC', 'BRUNEI CONTINENTAL CYCLING TEAM', '10004692457'], ['Rider', 'ABD HADZID', 'Azmi', '12/09/1991', 'Male', 'CTM', 'BRU', 'ASI', 'BRC', 'BRUNEI CONTINENTAL CYCLING TEAM', '10008010968']]
    ...snip...
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

  6. #6
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 646
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 646
    Par défaut
    donc, le dictionnaire n'est pas altéré (aucune clé ne disparaît), mais dans certains enregistrements du fichier 'équipiers' (teamMembers), le champ code ne correspond pas à la clé définie dans le dictionnaire construit à partir du fichier Équipes (teams).
    mais pourquoi ? ...

    surtout, comment identifier cette différence ?

    j'ai mis en parallèle le dictionnaire et les données du fichier équipiers, je ne vois pas de différences.
    je les ai passé à od -c, rien ne distingue l'un de l'autre.

    qu'est-ce qui pourrait expliquer ce comportement ?
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. lecture d'éléments dans mon fichier
    Par gillou4 dans le forum C
    Réponses: 9
    Dernier message: 23/10/2005, 16h19
  2. [swing][JButton] Des boutons qui disparaissent!
    Par soulhouf dans le forum Débuter
    Réponses: 12
    Dernier message: 19/08/2005, 12h51
  3. Avertissements / Conseils qui disparaissent
    Par Mikol dans le forum EDI
    Réponses: 7
    Dernier message: 28/07/2005, 18h08
  4. Réponses: 1
    Dernier message: 06/04/2005, 15h09
  5. [C#] Des 0 qui disparaissent
    Par GéniuS77 dans le forum Windows Forms
    Réponses: 17
    Dernier message: 25/01/2005, 13h41

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo