Bonjour,

j'ai ce message d'erreur quand je lance la fonction ci-dessous :

Error creating Frame layout
layout has a LIST instead of an ELEMENT
This means you have badly placed ]
the offensive list is :
[<PySimpleGUI.PySimpleGUI.Text object at 0x0000020B5E1D7490>,PySimpleGUI.PySimpleGUI.Text object at 0x0000020B5E1D7520>]
Commeny savoir où se situe le problème ?

Voici mon code :

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
def Help_window():
 
    Radio_copy_Help = [    [sg.Radio('Copy Folder     ', "Radio_Help", default=True,enable_events=True,key='kCopy_folder_Help'), sg.Radio('Copy file', "Radio_Help",enable_events=True,key='kCopy_files_Help',pad=((600, 0), (0, 0)) ) ]     ]
 
    Radio_copy_Help_Frame = sg.Frame('',Radio_copy_Help)
 
##    To_cp_Folder_Title_Help = [sg.Text('To copy Folder \n\n',font=(any,15,"bold",),key='kHelp_header_cp_Folder', visible=True)]
##
##    To_cp_File_Title_Help = [sg.Text('To copy File \n\n',font=(any,15,"bold",),key='kHelp_header_cp_File', visible=False)]
 
    To_cp_Title_Help = [[sg.Text('To copy Folder \n\n',font=(any,15,"bold",),key='kTo_cp_Folder_Title_Help', visible=True),sg.Text('To copy File \n\n',font=(any,15,"bold",),key='kTo_cp_File_Title_Help', visible=False)]]
 
    To_cp_Title_Help_Frame = sg.Frame('',To_cp_Title_Help,size=(800,60),element_justification='c')
 
    To_cp_Text_Help= [ [sg.Text('\n- Select "Copy Folder" \n\n- Choose the List Instance \n\n- Type in the relativ Path Folder \n\n- Choose the folder to copy \n\n- Finally click on "Copy".\n ---------------------------------\n\nExemple :\n\n I want to copy the folder c:\\foldertocopy in \\\\pc1\\BES-INT\\staging and \\\\pc2\\BES-INT\\staging. \n\n\nIn the list instance file , i will have \\\\pc1\\BES-INT on one line, \nthen \\\\pc2\\BES-INT on the next line. \n\nIn relativ path i put /staging. \n\nFor folder to copy i choose the folder c:\\foldertocopy',key='kTo_cp_Folder_Text_Help'),sg.Text('\n- Select "Copy File" \n\n- Choose the List Instance \n\n- Type in the relativ Path Folder \n\n- Choose the folder to copy \n\n- Finally click on "Copy".\n ---------------------------------\n\nExemple :\n\n I want to copy the folder c:\\foldertocopy in \\\\pc1\\BES-INT\\staging and \\\\pc2\\BES-INT\\staging. \n\n\nIn the list instance file , i will have \\\\pc1\\BES-INT on one line, \nthen \\\\pc2\\BES-INT on the next line. \n\nIn relativ path i put /staging. \n\nFor folder to copy i choose the folder c:\\foldertocopy',key='kTo_cp_File_Text_Help',visible=False)]],
 
    To_cp_Text_Help_Frame = sg.Frame('',To_cp_Text_Help,size=(800,500))
 
    #To_cp_Folder_Frame = [ [sg.Frame('', To_cp_Title_Helpme_Help, size=(800,60),element_justification='c',key='F1'),sg.Frame('', To_cp_Title_Help, size=(800,60),element_justification='c',key='F2',visible=False)  ],
                            #[sg.Frame('', To_cp_Folder_Text_Frame, size=(800,500)) ]    ]
 
    To_cp_Title_and_Text = [[To_cp_Title_Help_Frame],[To_cp_Text_Help_Frame]]
 
    To_cp_Title_and_Text_Frame = sg.Frame('',To_cp_Title_and_Text)
 
    copy_layouthelp =   [   [Radio_copy_Help_Frame],
                            [To_cp_Title_and_Text_Frame]
 
                        ]
 
    compare_layouthelp = [[sg.Text('You will find here the help for Compare Folders')]]
 
    remove_layouthelp = [[sg.Text('You will find here the help for Remove')]]
 
    reboot_layouthelp = [[sg.Text('You will find here the help for restart services and Reboot Pcs')]]
 
    layouthelp = [[sg.TabGroup([[sg.Tab('     Copy     ', copy_layouthelp, key='kTabCopyHelp_Help', ),sg.Tab('     Compare     ', compare_layouthelp,key='kTabCompareHelp_Help'),sg.Tab('     Remove     ', remove_layouthelp,key='kTabRemoveHelp'),sg.Tab('     Reboot     ', reboot_layouthelp, key='kTabRebootHelp')]],key='MytabsGroup', title_color='red',selected_title_color='green', tab_location='top',enable_events=True),
           ]
               ]
 
    window_help = sg.Window('Help ', layouthelp,finalize=True)
 
 
 
##
##    window_help.Element('F1').Update(visible = True)
##    window_help.Element('F2').Update(visible = False)
 
 
    while True:
        event, values = window_help.read()
 
##        if event == 'kCopy_folder_Help':
##             window_help.Element('F1').Update(visible = True)
##             window_help.Element('F2').Update(visible = False)
##        elif event == 'kCopy_files_Help':
##            window_help.Element('F1').Update(visible = False)
##            window_help.Element('F2').Update(visible = True)
 
 
        if event == sg.WIN_CLOSED:
            window_help.close()
            break
 
    return  window_help
Merci beaucoup pour l'aide déjà apportée sur de précédents problèmes.