当前位置: 首页>>代码示例>>Python>>正文


Python PySimpleGUI.Column方法代码示例

本文整理汇总了Python中PySimpleGUI.Column方法的典型用法代码示例。如果您正苦于以下问题:Python PySimpleGUI.Column方法的具体用法?Python PySimpleGUI.Column怎么用?Python PySimpleGUI.Column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySimpleGUI的用法示例。


在下文中一共展示了PySimpleGUI.Column方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('PvP Module', **cls.LABEL_SETTINGS),
                    sg.Checkbox(
                        'Enabled',
                        key='pvp.enabled',
                        enable_events=True)
                ],
                [
                    sg.Text('Fleet Preset', **cls.LABEL_SETTINGS),
                    sg.Combo(
                        [''] + [x for x in range(1, MAX_FLEET_PRESETS + 1)],
                        key='pvp.fleet_preset',
                        font=cls.FONT_10,
                        size=(13, 1))
                ]
            ],
            key='config_pvp_col',
            visible=False) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:23,代码来源:config_pvp.py

示例2: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Multiline(
                        key='logger',
                        font=('Courier New', 9),
                        autoscroll=True,
                        size=(92, 34),
                        pad=(0, (15, 0)),
                        background_color='grey20',
                        disabled=False)],
                [
                    cls.generate_clear_btn('logger')
                ]
            ],
            key='gui_tab_log',
            size=cls.PRIMARY_COL_TAB_SIZE,
            visible=False
        ) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:22,代码来源:runtime_logger.py

示例3: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('Ship Switcher Module', **cls.LABEL_SETTINGS),
                    sg.Checkbox(
                        'Enabled',
                        key='ship_switcher.enabled',
                        enable_events=True)
                ],
                cls.ship_switcher_slot_generator(1),
                cls.ship_switcher_slot_generator(2),
                cls.ship_switcher_slot_generator(3),
                cls.ship_switcher_slot_generator(4),
                cls.ship_switcher_slot_generator(5),
                cls.ship_switcher_slot_generator(6),
            ],
            key='config_ship_switcher_col',
            visible=False) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:21,代码来源:config_ship_switcher.py

示例4: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('Expedition Module', **cls.LABEL_SETTINGS),
                    sg.Checkbox(
                        'Enabled',
                        key='expedition.enabled',
                        enable_events=True)
                ],
                cls.expedition_line_generator(2),
                cls.expedition_line_generator(3),
                cls.expedition_line_generator(4),
            ],
            key='config_expedition_col',
            visible=False) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:18,代码来源:config_expedition.py

示例5: table_example

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def table_example():

    filename = sg.PopupGetFile('Get required file', no_window = True,file_types=(("CSV Files","*.csv"),))


    data = []
    header_list = []

    with open(filename, "r") as infile:    
        reader = csv.reader(infile)
        for i in range (1):                
            header = next(reader)
            data = list(reader)          
    header = header + ['%', 'Pts']         
    for i in range (len(data)):
 
        percent = int(data[i][5])/int(data[i][6])*100
        data[i] = data[i] + [percent]
        
        pts = int(data[i][2])*4 + int(data[i][4])*2
        data[i] = data[i] + [pts]        

    data.sort(key = operator.itemgetter(7), reverse = True)    
    data.sort(key = operator.itemgetter(8), reverse = True)     

    for i in range(len(data)):
        data[i][7] = str('{:.2f}'.format(data[i][7]))

    col_layout = [[sg.Table(values=data, headings=header, col_widths = (16, 3,3,3,3,6,6,6,4), auto_size_columns=False,
                    max_col_width = 30,justification='right', size=(None, len(data)))]]

    layout = [[sg.Column(col_layout, size=(480,360), scrollable=True)],]

    window = sg.Window('Table', no_titlebar = False, location = (350, 318), grab_anywhere = False).Layout(layout)
    b, v = window.Read() 
开发者ID:PySimpleGUI,项目名称:PySimpleGUI,代码行数:37,代码来源:8d PSG (Tables - add logo).py

示例6: table_example

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def table_example():

    filename = sg.PopupGetFile('Get required file', no_window = True,file_types=(("CSV Files","*.csv"),))


    data = []
    header_list = []

    with open(filename, "r") as infile:    
        reader = csv.reader(infile)
        for i in range (1):                
            header = next(reader)
            data = list(reader)          
    header = header + ['%', 'Pts']         
    for i in range (len(data)):
 
        percent = int(data[i][5])/int(data[i][6])*100
        data[i] = data[i] + [percent]     
        pts = int(data[i][2])*4 + int(data[i][4])*2
        data[i] = data[i] + [pts]        

    data.sort(key = operator.itemgetter(7), reverse = True)    
    data.sort(key = operator.itemgetter(8), reverse = True)     

    for i in range(len(data)):
        data[i][7] = str('{:.2f}'.format(data[i][7]))

    col_layout = [[sg.Table(values=data, headings=header, auto_size_columns=True,
                    max_col_width = 12,justification='right', text_color = 'White',
                            alternating_row_color = 'Grey', size=(None, len(data)))]]

    layout = [[sg.Column(col_layout, size=(443,400), scrollable=True)],]
    window = sg.Window('Table', location = (662, 328), no_titlebar=True, grab_anywhere=False).Layout(layout)
    b, v = window.Read() 
开发者ID:PySimpleGUI,项目名称:PySimpleGUI,代码行数:36,代码来源:8d PSG (Tables - add logo).py

示例7: calc_ladder

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def calc_ladder():
    filename = sg.PopupGetFile('Get required file', no_window=True, file_types=(("CSV Files", "*.csv"),))
    # populate table with file contents
    # Assume we know csv has heading in row 1
    # Assume we know 7 columns of data - relevenat to AFL w/o Pts or % shown
    # data is a list of lists containing data about each team
    # data[0] is one teams data data[0[[0] = team, data[0][1] P, data[0] [2] W,
    # data[0][3] L, data [0][4] D, data [0][5] F, data [0][6] A
    # no error checking or validation used.

    # initialise variable
    data = []
    header_list = []
    # read csv
    with open(filename, "r") as infile:
        reader = csv.reader(infile)
        for i in range(1):
            # get headings
            header = next(reader)
            # read everything else into a list of rows
            data = list(reader)
            # add headings
    header = header + ['%', 'Pts']
    for i in range(len(data)):
        # calculate % and format to 2 decimal places
        percent = str('{:.2f}'.format(int(data[i][5]) / int(data[i][6]) * 100))
        data[i] = data[i] + [percent]  # add to data
        pts = int(data[i][2]) * 4 + int(data[i][4]) * 2
        data[i] = data[i] + [pts]  # add to data

    # use Table (explore settings) and add to column layout
    col_layout = [[sg.Table(values=data, headings=header, auto_size_columns=True,
                            max_col_width=12, justification='right', background_color='White',
                            text_color='Black', alternating_row_color='LightBlue', size=(None, len(data)))]]

    layout = [[sg.Column(col_layout, size=(500, 400), scrollable=True)], ]

    window = sg.Window('Table', location=(700, 325), grab_anywhere=False).Layout(layout)
    b, v = window.Read() 
开发者ID:PySimpleGUI,项目名称:PySimpleGUI,代码行数:41,代码来源:8b PSG (Tables and calc from csv file).py

示例8: main

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def main():

    toolbar_buttons = [[sg.Button('', image_data=close64,button_color=('white', 'black'), pad=(0,0), key='-CLOSE-'),
                        sg.Button('', image_data=timer64, button_color=('white', 'black'), pad=(0, 0), key='-TIMER-'),
                        sg.Button('', image_data=house64, button_color=('white', 'black'), pad=(0, 0), key='-HOUSE-'),
                        sg.Button('', image_data=cpu64, button_color=('white', 'black'), pad=(0,0), key='-CPU-'),]]

    # layout = toolbar_buttons
    layout =  [[sg.Column( toolbar_buttons, background_color='black')]]

    window = sg.Window('Toolbar', layout, no_titlebar=True, grab_anywhere=True, background_color='black', margins=(0,0))

    # ---===--- Loop taking in user input --- #
    while True:
        button, value = window.read()
        print(button)
        if button == '-CLOSE-' or button is None:
            break                       # exit button clicked
        elif button == '-TIMER-':
            print('Timer Button')       # add your call to launch a timer program
        elif button == '-CPU-':
            print('CPU Button')         # add your call to launch a CPU measuring utility
        elif button == '-HOUSE-':
            print('Home Button')

    window.close() 
开发者ID:PySimpleGUI,项目名称:PySimpleGUI,代码行数:28,代码来源:Demo_Floating_Toolbar.py

示例9: pin

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def pin(elem):
    '''
    Pin's an element provided into a layout so that when it's made invisible and visible again, it will
     be in the correct place.  Otherwise it will be placed at the end of its containing window/column.

    :param elem: the element to put into the layout
    :return: A column element containing the provided element
    '''
    return sg.Column([[elem]], pad=(0,0)) 
开发者ID:PySimpleGUI,项目名称:PySimpleGUI,代码行数:11,代码来源:Demo_Invisible_Elements_Pinning.py

示例10: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('Scheduler', **cls.LABEL_SETTINGS),
                    sg.Checkbox(
                        'Enabled', key='scheduler.enabled', enable_events=True)
                ],
                [
                    sg.Text('Scheduler Rules', **cls.LABEL_SETTINGS),
                    sg.Listbox(
                        key='scheduler.rules',
                        values=[],
                        font=cls.FONT_10,
                        size=(54, 4),
                        enable_events=True)
                ],
                [
                    sg.Text('', **cls.LABEL_SETTINGS),
                    cls.generate_edit_btn('scheduler.rules', size=(20, 1)),
                    cls.generate_remove_btn('scheduler.rules', size=(20, 1)),
                    cls.generate_clear_btn('scheduler.rules', size=(20, 1)),
                ]
            ],
            key='config_scheduler_col',
            visible=False) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:28,代码来源:config_scheduler.py

示例11: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        buttons = [
            cls.generate_tab_btn(
                'config', grp, cls.key_suffix_generator(grp), cls.FONT_9, idx,
                pad=((1, 0), (1, 0)))
            for idx, grp in enumerate(cls.CONFIG_GROUP_LIST)
        ]
        return sg.Column(
            [buttons[:cls.BREAK_POSITION], buttons[cls.BREAK_POSITION:]],
            pad=(0, (10, 5)),
            element_justification='center',
            justification='center'
        ) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:15,代码来源:config_tab_buttons.py

示例12: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('JST Offset', **cls.LABEL_SETTINGS),
                    sg.Spin(
                        [x for x in range(MIN_JST_OFFSET, MAX_JST_OFFSET + 1)],
                        0,
                        key='general.jst_offset',
                        font=cls.FONT_10,
                        size=(3, 1),
                        enable_events=True)
                ],
                [
                    sg.Text('Interaction Mode', **cls.LABEL_SETTINGS),
                    sg.Combo(
                        [x.display_name for x in InteractionModeEnum],
                        key='general.interaction_mode',
                        font=cls.FONT_10,
                        size=(13, 1))
                ],
                [
                    sg.Text('Chrome Dev Port', **cls.LABEL_SETTINGS),
                    sg.Spin(
                        [x for x in range(MIN_PORT, MAX_PORT + 1)],
                        DEFAULT_CHROME_DEV_PORT,
                        key='general.chrome_dev_port',
                        font=cls.FONT_10,
                        size=(5, 1),
                        enable_events=True)
                ]
            ],
            key='config_general_col',
            visible=True) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:36,代码来源:config_general.py

示例13: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [
                    sg.Text('Passive Repair', **cls.LABEL_SETTINGS),
                    sg.Checkbox(
                        'Enabled',
                        key='passive_repair.enabled',
                        enable_events=True)
                ],
                [
                    sg.Text('Repair Threshold', **cls.LABEL_SETTINGS),
                    sg.Combo(
                        [
                            x.display_name for x in DamageStateEnum
                            if x in cls.VALID_DAMAGE_STATES],
                        default_value=DamageStateEnum.SCRATCH.display_name,
                        key='passive_repair.repair_threshold',
                        font=cls.FONT_10,
                        size=(13, 1))
                ],
                [
                    sg.Text('Slots to Reserve', **cls.LABEL_SETTINGS),
                    sg.Spin(
                        [x for x in range(
                            cls.MIN_SLOTS_RESERVED,
                            cls.MAX_SLOTS_RESERVED + 1)],
                        0,
                        key='passive_repair.slots_to_reserve',
                        font=cls.FONT_10,
                        size=(5, 1))
                ]
            ],
            key='config_passive_repair_col',
            visible=False) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:37,代码来源:config_passive_repair.py

示例14: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [sg.Canvas(key='click_plot')],
                [sg.Text("", key='unique_click_points', size=(50, 1))],
                [sg.Button('Refresh', key='refresh_click_plot')]
            ],
            key='gui_tab_click_plot',
            size=cls.PRIMARY_COL_TAB_SIZE,
            visible=False
        ) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:13,代码来源:click_plotter.py

示例15: get_layout

# 需要导入模块: import PySimpleGUI [as 别名]
# 或者: from PySimpleGUI import Column [as 别名]
def get_layout(cls):
        return sg.Column(
            [
                [sg.Column([[]], size=(cls.PRIMARY_COL_TAB_SIZE[0], 1))],
                [sg.Text("kcauto", font=cls.TITLE_FONT, pad=(0, (140, 0)))],
                [sg.Text(f"v{__version__}", font=cls.FONT_9)],
                [sg.Text(
                    "github",
                    key='link_github',
                    font=cls.FONT_10 + ('bold', ),
                    text_color='blue',
                    enable_events=True
                )],
                [
                    sg.Text(
                        "brought to you by",
                        font=cls.FONT_10,
                        pad=(0, (30, 0))),
                    sg.Text(
                        "mrmin123",
                        font=cls.FONT_10 + ('bold', ),
                        pad=(0, (30, 0))),
                ],
                [sg.Text(
                    "support on patreon",
                    key='link_patreon',
                    font=cls.FONT_10 + ('bold', ),
                    text_color='blue',
                    enable_events=True
                )],
            ],
            key='gui_tab_about',
            visible=False,
            size=cls.PRIMARY_COL_TAB_SIZE,
            element_justification='center',
            justification='center'
        ) 
开发者ID:mrmin123,项目名称:kcauto,代码行数:39,代码来源:about.py


注:本文中的PySimpleGUI.Column方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。