示例#1
0
    def __init__(self, title=__title__):
        super(WImageLoaded, self).__init__(title)
        self.title = title
        self.paused = True
        self.image2D = True
        self.exit = False
        self.layout = [[
            sg.Frame(title="",
                     layout=[[
                         sg.Text("File RGB:", size=(10, 1)),
                         sg.Input(key="InputRGB"),
                         sg.FileBrowse()
                     ], [sg.Submit(key="SubmitRGB")],
                             [sg.Text("", key="RGB_error", visible=False)],
                             [sg.Image(filename="", key="RGB_img")]]),
            sg.Frame(title="",
                     layout=[[
                         sg.Text("File Depth:", size=(10, 1)),
                         sg.Input(key="InputDepth"),
                         sg.FileBrowse()
                     ], [sg.Submit(key="SubmitDepth")],
                             [sg.Text("", key="Depth_error", visible=False)],
                             [sg.Image(filename="", key="Depth_img")]])
        ],
                       [
                           sg.Button(button_text="Exit",
                                     key="Exit",
                                     size=(10, 1),
                                     font=("verdana", 14))
                       ]]

        self.window = None
示例#2
0
    def __init__(self):

        self.deler = 0
        self.run_face = 0
        self.ledsign = 0
        self.recognizer = None
        self.detector = None

        self.datasets = "./datasets"
        self.face_number = "./face_number"
        self.trainer = "./trainer"

        self.button = None
        self.value = None
        self.font = 'Arial'
        self.layout = [[
            sg.Text('ID'),
            sg.Input(key='id', size=(10, 1)),
            sg.Text('Age'),
            sg.Input(key='age', size=(10, 1))
        ],
                       [
                           sg.Button('Import face', font=self.font),
                           sg.Button('Training model', font=self.font),
                           sg.Button('Recognize faces',
                                     key='first',
                                     font=self.font),
                           sg.Button('Clean up the model', font=self.font),
                           sg.Button('Clean up all data', font=self.font),
                       ], [sg.Output(size=(60, 8), font=self.font)],
                       [
                           sg.Button('exit', font=self.font),
                       ]]
        self.window = sg.Window('Face recognition system',
                                font=self.font,
                                layout=self.layout)
event, values = window2.read()

en = int(values[0])
boy = int(values[1])

header = [
    [
        sg.Text(
            'Harf Girilmesini Istemediginiz\nKutucuklara "*" Karakterini Giriniz'
        )
    ],  #GUI
    [sg.Button('OLUSTURULAN BULMACAYI COZ')]
]

input_rows = [[sg.Input(size=(4, 4), pad=(0, 0)) for col in range(en)]
              for row in range(boy)]

layout = input_rows + header

window = sg.Window('KARE BULMACA', layout, font='Courier 12')
event, values = window.read()

satiratla = 0
basayaz = str(en) + ' ' + str(boy) + '\n'
yazilacak = '?'

dosyaismi = str(boy) + str(en) + '.txt'
print dosyaismi

with open(dosyaismi, 'w') as f:  #Dosya oku
示例#4
0
                path.append(os.path.join(root, d))
        for f in files:
            if f == dir_name:
                path.append(os.path.join(root, f))
    return path


sg.ChangeLookAndFeel('Dark')
sg.SetOptions(element_padding=(0, 0))
layout = [[
    sg.Text('File manager', text_color='powderblue', pad=((3, 10), 10))
],
          [
              sg.Text('Choose Folder to mkdir or mkfile or search:',
                      pad=((3, 10), 10)),
              sg.Input(),
              sg.FolderBrowse()
          ],
          [
              sg.Text('Remove Folder                    :', pad=((3, 10), 10)),
              sg.Input(),
              sg.FolderBrowse()
          ],
          [
              sg.Text('Choose file to delete            :', pad=((3, 10), 10)),
              sg.Input(),
              sg.FileBrowse()
          ],
          [
              sg.Text('Choose file to copy              :', pad=((3, 10), 10)),
              sg.Input(),
示例#5
0
#!/usr/bin/env python
import sys
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg

layout = [[sg.Text('Filename', )],
          [sg.Input(), sg.FileBrowse()],
          [sg.OK(), sg.Cancel()]]

button, (number,) = sg.Window('Get filename example').LayoutAndRead(layout)



import PySimpleGUI as sg

button, (filename,) = sg.Window('Get filename example').LayoutAndRead(
    [[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()]])
示例#6
0
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg

# Demonstrates a number of PySimpleGUI features including:
#   Default element size
#   auto_size_buttons
#   ReadButton
#   Dictionary return values
#   Update of elements in form (Text, Input)
#   do_not_clear of Input elements

layout = [
    [sg.Text('Enter Your Passcode')],
    [sg.Input(size=(10, 1), do_not_clear=True, key='input')],
    [sg.ReadButton('1'),
     sg.ReadButton('2'),
     sg.ReadButton('3')],
    [sg.ReadButton('4'),
     sg.ReadButton('5'),
     sg.ReadButton('6')],
    [sg.ReadButton('7'),
     sg.ReadButton('8'),
     sg.ReadButton('9')],
    [sg.ReadButton('Submit'),
     sg.ReadButton('0'),
     sg.ReadButton('Clear')],
    [
        sg.Text('',
                size=(15, 1),
示例#7
0
                  [
                      sg.Text('Spain', size=(15, 1), font=("Calibri", 11)),
                      sg.InputCombo(['yes', 'no', 'undefined'])
                  ],
                  [
                      sg.Text('Narrow Geolocation',
                              size=(15, 1),
                              font=("Calibri", 11)),
                      sg.InputCombo(['yes', 'no'])
                  ],
                  [
                      sg.Text('Tweet ' + index + ' of ' + total,
                              font=("Calibri", 11))
                  ],
                  [sg.Text('Start from tweet number: ', font=("Calibri", 11))],
                  [sg.Input()], [sg.Submit(), sg.Cancel()]]

        window = sg.Window('Processing tweets')
        button, values = window.LayoutAndRead(layout)

        if button != 'Submit':

            if button == 'Copy Original Tweet':
                pyperclip.copy(text)
            if button == 'Copy Russian translation':
                pyperclip.copy(russian_trans)
            if button == 'Copy English translation':
                pyperclip.copy(english_trans)

            if button == 'Cancel':
                break
示例#8
0
#!/usr/bin/env python
import sys
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg

sg.ChangeLookAndFeel('BlueMono')

# Column layout
col = [[sg.Text('col Row 1', text_color='white', background_color='blue')],
       [sg.Text('col Row 2', text_color='white', background_color='blue'), sg.Input('col input 1')],
       [sg.Text('col Row 3', text_color='white', background_color='blue'), sg.Input('col input 2')]]
# Window layout
layout = [[sg.Listbox(values=('Listbox Item 1', 'Listbox Item 2', 'Listbox Item 3'),
                      select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE, size=(20, 3)),
           sg.Column(col, background_color='blue')],
          [sg.Input('Last input')],
          [sg.OK()]]

# Display the window and get values
button, values = sg.Window('Compact 1-line form with column').Layout(layout).Read()

sg.Popup(button, values, line_width=200)