Пример #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 GetFilesToCompare():
    form_rows = [[sg.Text('Enter 2 files to comare')],
                 [
                     sg.Text('File 1', size=(15, 1)),
                     sg.InputText(key='file1'),
                     sg.FileBrowse()
                 ],
                 [
                     sg.Text('File 2', size=(15, 1)),
                     sg.InputText(key='file2'),
                     sg.FileBrowse(target='file2')
                 ], [sg.Submit(), sg.Cancel()]]

    window = sg.Window('File Compare')
    button, values = window.Layout(form_rows).Read()
    return button, values
Пример #3
0
def openFileBox():
    layout = [[sg.T('Source Folder')], [sg.In()],
              [sg.FileBrowse(target=(-1, 0)),
               sg.OK()]]
    window = sg.Window("Choose File", layout)
    event, values = window.Read()
    if event == "OK":
        return values
    else:
        return 0
Пример #4
0
    def PlayerChooseSongGUI(self):

        # ---------------------- DEFINION OF CHOOSE WHAT TO PLAY GUI ----------------------------

        layout = [[
            sg.Text('MIDI File Player',
                    font=("Helvetica", 15),
                    size=(20, 1),
                    text_color='green')
        ], [sg.Text('File Selection', font=("Helvetica", 15), size=(20, 1))],
                  [
                      sg.Text('Single File Playback', justification='right'),
                      sg.InputText(size=(65, 1), key='midifile'),
                      sg.FileBrowse(size=(10, 1),
                                    file_types=(("MIDI files", "*.mid"), ))
                  ],
                  [
                      sg.Text('Or Batch Play From This Folder',
                              auto_size_text=False,
                              justification='right'),
                      sg.InputText(size=(65, 1), key='folder'),
                      sg.FolderBrowse(size=(10, 1))
                  ], [sg.Text('_' * 250, auto_size_text=False, size=(100, 1))],
                  [
                      sg.Text('Choose MIDI Output Device', size=(22, 1)),
                      sg.Listbox(values=self.PortList,
                                 size=(30, len(self.PortList) + 1),
                                 key='device')
                  ], [sg.Text('_' * 250, auto_size_text=False, size=(100, 1))],
                  [
                      sg.SimpleButton('PLAY',
                                      size=(12, 2),
                                      button_color=('red', 'white'),
                                      font=("Helvetica", 15),
                                      bind_return_key=True),
                      sg.Text(' ' * 2, size=(4, 1)),
                      sg.Cancel(size=(8, 2), font=("Helvetica", 15))
                  ]]

        window = sg.Window('MIDI File Player',
                           auto_size_text=False,
                           default_element_size=(30, 1),
                           font=("Helvetica", 12)).Layout(layout)
        self.Window = window
        return window.Read()
Пример #5
0
frm_icon = sg.InputText("", key="icon-file", do_not_clear=True)
frm_follow = sg.InputText("", size=(60, 2), key="follow", do_not_clear=True)
frm_no_follow = sg.InputText("", size=(60, 2), key="no-follow", do_not_clear=True)
frm_packages = sg.InputText("", size=(60, 2), key="packages", do_not_clear=True)
frm_modules = sg.InputText("", size=(60, 2), key="modules", do_not_clear=True)
frm_plugins = sg.InputText("", size=(60, 2), key="plugin-dir", do_not_clear=True)
frm_more = sg.InputText("", key="add-args", size=(60, 2), do_not_clear=True)
form = sg.FlexForm("Nuitka Standalone EXE Generation")

compile_to = pscript = icon_file = ""

layout = [
    [
        sg.Text("Python Script:", size=(13, 1)),
        sg.InputText("", key="py-file", do_not_clear=True),
        sg.FileBrowse(button_text="...", file_types=(("Python Files", "*.py*"),)),
    ],
    [
        sg.Text("Output Folder:", size=(13, 1)),
        frm_output,
        sg.FolderBrowse(button_text="..."),
    ],
    [sg.Text("Icon File:", size=(13, 1)), frm_icon, sg.FileBrowse(button_text="...")],
    [
        sg.Text("App control:", size=(15, 1)),
        sg.Checkbox("Use Console", default=True, key="use-console"),
        sg.Checkbox("Tk Support", default=False, key="tk-support"),
        sg.Checkbox("Qt Support", default=False, key="qt-support"),
        sg.Checkbox("Numpy Support", default=False, key="np-support"),
    ],
    [
Пример #6
0
],
          [
              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(),
              sg.FileBrowse()
          ],
          [
              sg.Text('The Path to Paste File          :', pad=((3, 10), 10)),
              sg.Input(),
              sg.FolderBrowse()
          ],
          [
              sg.Text('1- mkdir name                       :',
                      pad=((3, 10), 10)),
              sg.Input()
Пример #7
0
                            key="packages",
                            do_not_clear=True)
frm_modules = sg.InputText("", size=(60, 2), key="modules", do_not_clear=True)
frm_plugins = sg.InputText("",
                           size=(60, 2),
                           key="plugin-dir",
                           do_not_clear=True)
frm_more = sg.InputText("", key="add-args", size=(60, 2), do_not_clear=True)
form = sg.FlexForm('Nuitka Standalone EXE Generation')

compile_to = pscript = icon_file = ""

layout = [[
    sg.Text("Python Script:", size=(13, 1)),
    sg.InputText("", key="py-file", do_not_clear=True),
    sg.FileBrowse(button_text="...", file_types=(("Python Files", "*.py*"), ))
],
          [
              sg.Text("Output Folder:", size=(13, 1)), frm_output,
              sg.FolderBrowse(button_text="...")
          ],
          [
              sg.Text("Icon File:", size=(13, 1)), frm_icon,
              sg.FileBrowse(button_text="...")
          ],
          [
              sg.Checkbox("Remove <.build>", default=True, key="remove-build"),
              sg.Checkbox("Use UPX-Packer", default=False, key="compress"),
              sg.Checkbox("Rebuild Dep. Cache",
                          text_color="#FF0000",
                          default=False,
Пример #8
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()]])
#!/usr/bin/env python
import sys
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg
import sys
'''
Quickly add a GUI to your script!

This simple script shows a 1-line-GUI addition to a typical Python command line script.

Previously this script accepted 1 parameter on the command line.  When executed, that
parameter is read into the variable fname.

The 1-line-GUI shows a form that allows the user to browse to find the filename. The GUI
stores the result in the variable fname, just like the command line parsing did.
'''

if len(sys.argv) == 1:
    button, (fname, ) = sg.Window('My Script').LayoutAndRead(
        [[sg.T('Document to open')], [sg.In(), sg.FileBrowse()],
         [sg.Open(), sg.Cancel()]])
else:
    fname = sys.argv[1]

if not fname:
    sg.Popup("Cancel", "No filename supplied")
    raise SystemExit("Cancelling: no filename supplied")