This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PySimpleGUI as sg | |
| layout = [[sg.Text('Add 2 Numbers', font='Helvetica 15')], | |
| [sg.InputText(size=(8,1) ,key='in1'), sg.Text(' + '), sg.Input(size=(8,1), key='in2'),sg.Text('',key='answer')], | |
| [sg.Text('')], | |
| [sg.ReadButton('Add')]] | |
| window = sg.Window('Add 2 numbers').Layout(layout) | |
| # event loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| if sys.version_info[0] >= 3: | |
| import PySimpleGUI as sg | |
| else: | |
| import PySimpleGUI27 as sg | |
| sg.ChangeLookAndFeel('Black') | |
| layout = [[ sg.Text('B.O.L.ephant',justification='left', size=(15,1), font=('Times 25')) ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| if sys.version_info[0] >= 3: | |
| import PySimpleGUI as sg | |
| else: | |
| import PySimpleGUI27 as sg | |
| import os | |
| import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PySimpleGUI as sg | |
| import random | |
| frames = [] | |
| for i in range(6): # make 6 rows of frames | |
| row = [] | |
| for j in range(4): # make the 4 colored buttons | |
| row.append(sg.Button('', size=(1,1), key=(i,j), button_color=('black', 'lightblue'))) | |
| # make the hint area and decode button | |
| row.append(sg.Text('', size=(5,1), background_color='yellow', key='_HINT_'+str(i))) | |
| row.append(sg.Button('Decode', key='_DECODE_'+str(i))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PySimpleGUIQt as sg | |
| import random | |
| frames = [] | |
| for i in range(6): # make 6 rows of frames | |
| row = [] | |
| for j in range(4): # make the 4 colored buttons | |
| row.append(sg.Button(' ', size=(30,40), key=(i,j), button_color=('black', 'lightblue'))) | |
| # make the hint area and decode button | |
| row.append(sg.Text('', size=(5,1), background_color='yellow', key='_HINT_'+str(i))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _get_opacity(self): | |
| if platform == 'win': | |
| try: | |
| return winxpgui.GetLayeredWindowAttributes(HWND)[1] / 255. | |
| except Exception as e: | |
| Logger.error( | |
| 'failed to get opacity: {}'.format(e)) | |
| else: | |
| Logger.warning( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PySimpleGUI as sg | |
| layout = [ [sg.Text('Drawing on a 400x400 Grid')], | |
| [sg.Graph((400,400), (0,0), (400,400), key='GRAPH')], | |
| [sg.Button('Go')] | |
| ] | |
| window = sg.Window('My new window').Layout(layout) | |
| graph = window.Element('GRAPH') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| if sys.version_info[0] >= 3: | |
| import PySimpleGUI as sg | |
| else: | |
| import PySimpleGUI27 as sg | |
| import math | |
| layout = [[sg.T('Example of Using Math with a Graph', justification='center', | |
| size=(50,1), relief=sg.RELIEF_SUNKEN)], | |
| [sg.Graph(canvas_size=(400, 400), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| if sys.version_info[0] >= 3: | |
| import PySimpleGUI as sg | |
| else: | |
| import PySimpleGUI27 as sg | |
| import matplotlib | |
| matplotlib.use('TkAgg') | |
| from matplotlib.backends.backend_tkagg import FigureCanvasAgg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PySimpleGUI as sg | |
| import random | |
| BAR_WIDTH = 50 | |
| BAR_SPACING = 75 | |
| EDGE_OFFSET = 3 | |
| GRAPH_SIZE = (500,500) | |
| DATA_SIZE = (500,500) | |
| graph = sg.Graph(GRAPH_SIZE, (0, 0), DATA_SIZE) |