Esempio n. 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
Esempio n. 2
0
def startup():
    layout = [[sg.Text('Please enter the name of your server:')],
              [sg.InputText()], [sg.Submit(), sg.Cancel()]]
    window = sg.Window('Project0', layout)
    event, values = window.Read()
    window.Close()
    ServerName = values[0]
    return ServerName
Esempio n. 3
0
def addClient():
    layout = [
        [sg.Text('Please enter the IP address and email')],
        [sg.Text('IP Address:', size=(15, 1)),
         sg.InputText('', key='_IP_')],
        [sg.Text('Email:', size=(15, 1)),
         sg.InputText('', key='_EMAIL_')], [sg.Submit(),
                                            sg.Cancel()]
    ]
    window = sg.Window('Add Account', layout)
    event, values = window.Read()
    window.Close()
    if (sg.PopupYesNo("Are you sure?") == "Yes"):
        return values
    else:
        pass
Esempio n. 4
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
Esempio n. 5
0
def addAccount():  #add email account to the "Available" section
    layout = [[sg.Text('Please enter the email address and password')],
              [
                  sg.Text('Email Address:', size=(15, 1)),
                  sg.InputText('', key='_EMAIL_')
              ],
              [
                  sg.Text('Password:'******'', key='_PASSWORD_')
              ], [sg.Submit(), sg.Cancel()]]
    window = sg.Window('Add Account', layout)
    event, values = window.Read()
    window.Close()
    if (sg.PopupYesNo("Are you sure?") == "Yes"):
        return values
    else:
        pass
Esempio n. 6
0
def gui():

    #  Gui to get dates from the user
    dates = []
    layout = [[sg.Text('GBO Master Calibration Finder', font=('Helvetica', 25), justification='center')],
              [sg.Text('_' * 100, size=(65, 1))],
              [sg.Text('Enter the dates of science images', font=('Helvetica', 14))],
              [sg.T('Format: 20180715'), sg.T('Added Date', size=(19,1), justification='right')],
              [sg.InputText('', size=(12, 1), key='datein'),
              sg.T('', size=(20, 1), justification='right', key='dateout')],
              [sg.Submit('Add Date')],
              [sg.Button('Next'), sg.Button('Exit')]]

    window = sg.Window('Window Title').Layout(layout)

    while True:  # Event Loop
        event, values = window.Read()
        print event, values
        if event is None or event == 'Exit':
            print '\nClosing program based on "Exit" command'
            sys.exit(1)
            break
        if event == 'Next':
            break
        if event == 'Add Date':
            dates.append(values['datein'])
            window.Element('dateout').Update(values['datein'])

    window.Close()


    #  Gui to get Path, Binning, and Temp from user
    layout = [[sg.Text('GBO Master Calibration Finder', font=('Helvetica', 25), justification='center')],
              [sg.Text('_' * 100, size=(65, 1))],
              [sg.Text('Enter output path for your files', font=('Helvetica', 12))],
              [sg.InputText(outdir, size=(45, 1), key='path'), sg.Text('Leave as is for default')],
              [sg.Text('_' * 100, size=(65, 1))],
              [sg.Text('Select the type of master frames to find', font=('Helvetica', 14))],
              [sg.Checkbox('Bias', default=True, size=(12, 1), key='Bias'),
               sg.Checkbox('Dark', default=True, size=(12, 1), key='Dark'),
               sg.Checkbox('Flat', default=True, size=(12, 1), key='Flat')],
              [sg.Text('_' * 100, size=(65, 1))],
              [sg.Text('Select the Binning', font=('Helvetica', 14))],
              [sg.Radio('1X1', "RADIO1", default=True, key='1X1'), sg.Radio('2X2', "RADIO1", key='2X2'),
               sg.Radio('3X3', "RADIO1", key='3X3'), sg.Radio('4X4', "RADIO1", key='4X4')],
              [sg.Text('_' * 100, size=(65, 1))],
              [sg.Text('Select the Temp', font=('Helvetica', 14))],
              [sg.Radio('-25', "RADIO2", default=True, key='-25'), sg.Radio('-30', "RADIO2", key='-30'),
               sg.Radio('-35', "RADIO2", key='-35')],
              [sg.Submit(), sg.Button('Exit')]]

    window = sg.Window('GBO Master Calibration Finder', font=("Helvetica", 12)).Layout(layout)

    event, values = window.Read()
    if event == 'Exit':
        print '\nClosing program based on "Exit" command'
        sys.exit(2)

    window.Close()

    types = ['Bias', 'Dark', 'Flat']
    types = [x for x in types if values[x] == True]
    binning = [x for x in bins if values[x] == True]
    binning = binning[0]
    temp = [x for x in temps if values[x] == True]
    temp = temp[0]

    outpath = values['path']
    if not outpath.endswith('\\'):
        outpath = outpath + '\\'


    #  Gui to get dark exposure times from the user
    if 'Dark' in types:
        darkbin = dark_files.where(done_files['binning'] == binning)
        darkbin.dropna(how='all', inplace=True)
        darktemp = darkbin.where(darkbin['temp'] == temp)
        darktemp.dropna(how='all', inplace=True)

        exposures = np.sort(darktemp['exp'].unique())

        layout = [[sg.Text('GBO Master Calibration Finder', font=('Helvetica', 25), justification='center')],
                  [sg.Text('Your Binning is:'), sg.Text(binning)],
                  [sg.Text('Your Temp is:', size=(12,1)), sg.Text(temp)],
                  [sg.Text('',size=(15,1)), sg.Text('Available Exposures')],
                  [sg.Text('', size=(16,1)),
                   sg.Listbox(exposures, size=(10,12), select_mode='multiple', key='exposures')],
                  [sg.Submit(), sg.Button('Exit')]]

        window = sg.Window('GBO Master Calibration Finder', font=("Helvetica", 12)).Layout(layout)

        event, values = window.Read()

        window.Close()

        if event == 'Exit':
            print '\nClosing program based on "Exit" command'
            sys.exit(3)

        exposures = values['exposures']
    else:
        exposures = []

    #  Gui to get filters from the user
    if 'Flat' in types:
        flatbin = flat_files.where(done_files['binning'] == binning)
        flatbin.dropna(how='all', inplace=True)
        flattemp = flatbin.where(flatbin['temp'] == temp)
        flattemp.dropna(how='all', inplace=True)

        filters = np.sort(flattemp['filter'].unique())

        layout = [[sg.Text('GBO Master Calibration Finder', font=('Helvetica', 25), justification='center')],
                  [sg.Text('Your Binning is:'), sg.Text(binning)],
                  [sg.Text('Your Temp is:', size=(12,1)), sg.Text(temp)],
                  [sg.Text('',size=(15,1)), sg.Text('Available Filters')],
                  [sg.Text('', size=(16,1)),
                   sg.Listbox(filters, size=(10,12), select_mode='multiple', key='filters')],
                  [sg.Submit(), sg.Button('Exit')]]

        window = sg.Window('GBO Master Calibration Finder', font=("Helvetica", 12)).Layout(layout)

        event, values = window.Read()

        window.Close()

        if event == 'Exit':
            print '\nClosing program based on "Exit" command'
            sys.exit(4)

        filters = values['filters']
    else:
        filters = []

    return types, outpath, binning, temp, dates, exposures, filters
        sg.InputCombo(('none', 'minmax', 'l1 norm', 'l2 norm', 'z score'),
                      size=(20, 3))
    ],
    [
        sg.Text('Select Filter', size=(22, 1)),
        sg.InputCombo(('none', 'remove hotels', 'remove users', 'remove both'),
                      size=(20, 3))
    ],
    [
        sg.Text('Select Feature', size=(22, 1)),
        sg.InputCombo(
            ('ratings', 'all features', 'no ratings', 'rating+date+total',
             'rating+date+word', 'rating+total+word', 'rating+date',
             'rating+total', 'rating+word', 'all normal'),
            size=(20, 3))
    ], [sg.Submit('Search'), sg.Cancel()]
]

window = sg.Window('Hotel Finder').Layout(layout)

# keep the window persistent
while True:
    button, values = window.Read()
    if button == 'Cancel':
        window.Close()
    elif button == 'Search':
        id_input = int(values[0])
        country_input = values[1]
        travel_input = values[2]
        stay_input = values[3]
        room_input = values[4]
import sys
from Tkinter import *
import Pmw, sys
import PySimpleGUI27 as sg

boyut = [
    [sg.Text('Boyut Seciniz')],  #GUI
    [
        sg.Text('Row Sayisi', size=(15, 1)),
        sg.InputText(size=(15, 1)),
    ],
    [
        sg.Text('Col Sayisi', size=(15, 1)),
        sg.InputText(size=(15, 1)),
    ],
    [sg.Submit('BULMACA OLUSTUR')]
]

window2 = sg.Window('Boyut Belirle', boyut)

event, values = window2.read()

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

header = [
    [
        sg.Text(
            'Harf Girilmesini Istemediginiz\nKutucuklara "*" Karakterini Giriniz'
        )
    ],  #GUI
Esempio n. 9
0
    [sg.Text('Strength of Similarity P:', size=(25, 1)),
     sg.InputText()],  # 6
    [sg.Text('Similarity of Chunks:', size=(25, 1)),
     sg.InputText()],  # 7
    [sg.Text('Advanced parameters for the Production Module:')],  #
    [sg.Text('Production Utility Noise e:', size=(25, 1)),
     sg.InputText()],  # 8
    [sg.Text('Production Utility Success:', size=(25, 1)),
     sg.InputText()],  # 9
    [sg.Text('Production Utility Fail:', size=(25, 1)),
     sg.InputText()],  # 10
    [sg.Text('Physical help factor:', size=(25, 1)),
     sg.InputText()],  # 11
    [sg.Text('Verbal help factor:', size=(25, 1)),
     sg.InputText()],  # 12
    [sg.Submit(button_text='Run'), sg.Cancel()]  #
]

my_font = ("Arial", 13)
window = sg.Window('Simulation of daily activities',
                   layout,
                   element_justification='c',
                   size=(700, 550),
                   font=my_font)
event, values = window.read()
window.close()
print(event)

if values[0] == 'Tea Preparation Activity': activity = 1
if values[0] == 'Washing Hands Activity': activity = 2
if values[0] == 'Dressing Activity': activity = 3
#!/usr/bin/env python
import sys
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg
"""
    Simple Form showing how to use keys on your input fields
"""

layout = [[sg.Text('Please enter your Name, Address, Phone')],
          [sg.Text('Name', size=(15, 1)),
           sg.InputText('1', key='name')],
          [sg.Text('Address', size=(15, 1)),
           sg.InputText('2', key='address')],
          [sg.Text('Phone', size=(15, 1)),
           sg.InputText('3', key='phone')], [sg.Submit(),
                                             sg.Cancel()]]

window = sg.Window('Simple Data Entry Window').Layout(layout)
button, values = window.Read()

sg.Popup(button, values, values['name'], values['address'], values['phone'])
Esempio n. 11
0
                      orientation='v',
                      size=(5, 20),
                      default_value=75),
            sg.Slider(range=(1, 100),
                      orientation='v',
                      size=(5, 20),
                      default_value=10),
            sg.Column(column1, background_color='#F7F3EC')
        ]])
    ], [sg.Text('_' * 80)], [sg.Text('Choose A Folder', size=(35, 1))],
    [
        sg.Text('Your Folder',
                size=(15, 1),
                auto_size_text=False,
                justification='right'),
        sg.InputText('Default Folder'),
        sg.FolderBrowse()
    ], [sg.Submit(tooltip='Click to submit this form'),
        sg.Cancel()]
]

window = sg.Window('Everything bagel',
                   default_element_size=(40, 1),
                   grab_anywhere=False).Layout(layout)

button, values = window.Read()

sg.Popup('Title', 'The results of the window.',
         'The button clicked was "{}"'.format(button), 'The values are',
         values)
Esempio n. 12
0
    [
        sg.Text("Dep. cache control:", size=(15, 1)),
        sg.Checkbox("Ignore", text_color="#FF0000", default=False, key="ignore-cache"),
        sg.Checkbox("Recurse", text_color="#FF0000", default=False, key="int-depend"),
        sg.Checkbox(
            "Rebuild", text_color="#FF0000", default=False, key="rebuild-cache"
        ),
    ],
    [sg.Text("No recurse into:", text_color="#FF0000", size=(13, 1)), frm_no_follow],
    [sg.Text("Recurse into:", size=(13, 1)), frm_follow],
    [sg.Text("Include packages:", size=(13, 1)), frm_packages],
    [sg.Text("Include modules:", size=(13, 1)), frm_modules],
    [sg.Text("Include plugin-dir:", size=(13, 1)), frm_plugins],
    [sg.Text("More Nuitka args:", size=(13, 1)), frm_more],
    [message],
    [sg.Submit(), sg.Cancel()],
]

form.Layout(layout)
while True:
    frm_input.Update(pscript)
    frm_output.Update(compile_to)
    frm_icon.Update(icon_file)
    btn, val = form.Read()
    if btn in (None, "Cancel"):
        break

    pscript = os.path.abspath(val["py-file"])
    if not os.path.exists(pscript):
        message.Update("Python script '%s' does not exist!" % pscript)
        pscript = ""
Esempio n. 13
0
          ],
          [
              sg.Text('1- mkdir name                       :',
                      pad=((3, 10), 10)),
              sg.Input()
          ],
          [
              sg.Text('2- mkfile name                      :',
                      pad=((3, 10), 10)),
              sg.Input()
          ],
          [
              sg.Text("3- Search file                      :",
                      pad=((3, 10), 20)),
              sg.Input()
          ], [sg.Submit(), sg.Exit()],
          [sg.Text("By Miss.Robot", pad=((3, 10), 20))]]

window = sg.Window('File Manager', layout)
while True:
    event, values = window.Read()
    if event == 'Exit':
        break
    elif values[0] != '' and values[5] != '':
        folder = values[0]
        name = values[5]
        os.system(('mkdir ' + (folder + "/" + name)))
        print(folder + "," + name)
    elif values[0] != '' and values[6] != '':
        folder = values[0]
        name = values[6]
Esempio n. 14
0
#master=tk.Tk()
#tk.Label(master, text=" finestra 1").grid(row=0)
#tk.Label(master, text=" finestra 2").grid(row=1)

#e1=tk.Entry(master)
#e2=tk.Entry(master)

#e1.grid(row=0, column=1)
#e2.grid(row=1, column=1)

#master.mainloop()
# continue from https://www.python-course.eu/tkinter_entry_widgets.php
#_______________________________________
# GUI
layout = [[sg.Text('Insert Company Name, name of the job, link')],
          [sg.Text('Company Name', size=(15, 1)),
           sg.InputText('name')],
          [sg.Text('Name of the job', size=(15, 1)),
           sg.InputText('address')],
          [sg.Text('link', size=(15, 1)),
           sg.InputText('phone')], [sg.Submit(), sg.Cancel()]]

window = sg.Window('Job Apllications').Layout(layout)
button, values = window.Read()

print(button, values[0], values[1], values[2])

#__________________________
#workbook = xlwt.Workbook()
#sheet = workbook.add_sheet("Sheet Name")
Esempio n. 15
0
def MachineLearningGUI():
    sg.SetOptions(text_justification='right')

    flags = [
        [
            sg.Checkbox('Normalize', size=(12, 1), default=True),
            sg.Checkbox('Verbose', size=(20, 1))
        ],
        [
            sg.Checkbox('Cluster', size=(12, 1)),
            sg.Checkbox('Flush Output', size=(20, 1), default=True)
        ],
        [
            sg.Checkbox('Write Results', size=(12, 1)),
            sg.Checkbox('Keep Intermediate Data', size=(20, 1))
        ],
        [
            sg.Checkbox('Normalize', size=(12, 1), default=True),
            sg.Checkbox('Verbose', size=(20, 1))
        ],
        [
            sg.Checkbox('Cluster', size=(12, 1)),
            sg.Checkbox('Flush Output', size=(20, 1), default=True)
        ],
        [
            sg.Checkbox('Write Results', size=(12, 1)),
            sg.Checkbox('Keep Intermediate Data', size=(20, 1))
        ],
    ]

    loss_functions = [
        [
            sg.Radio('Cross-Entropy', 'loss', size=(12, 1)),
            sg.Radio('Logistic', 'loss', default=True, size=(12, 1))
        ],
        [
            sg.Radio('Hinge', 'loss', size=(12, 1)),
            sg.Radio('Huber', 'loss', size=(12, 1))
        ],
        [
            sg.Radio('Kullerback', 'loss', size=(12, 1)),
            sg.Radio('MAE(L1)', 'loss', size=(12, 1))
        ],
        [
            sg.Radio('MSE(L2)', 'loss', size=(12, 1)),
            sg.Radio('MB(L0)', 'loss', size=(12, 1))
        ],
    ]

    command_line_parms = [
        [
            sg.Text('Passes', size=(8, 1)),
            sg.Spin(values=[i for i in range(1, 1000)],
                    initial_value=20,
                    size=(6, 1)),
            sg.Text('Steps', size=(8, 1), pad=((7, 3))),
            sg.Spin(values=[i for i in range(1, 1000)],
                    initial_value=20,
                    size=(6, 1))
        ],
        [
            sg.Text('ooa', size=(8, 1)),
            sg.In(default_text='6', size=(8, 1)),
            sg.Text('nn', size=(8, 1)),
            sg.In(default_text='10', size=(10, 1))
        ],
        [
            sg.Text('q', size=(8, 1)),
            sg.In(default_text='ff', size=(8, 1)),
            sg.Text('ngram', size=(8, 1)),
            sg.In(default_text='5', size=(10, 1))
        ],
        [
            sg.Text('l', size=(8, 1)),
            sg.In(default_text='0.4', size=(8, 1)),
            sg.Text('Layers', size=(8, 1)),
            sg.Drop(values=('BatchNorm', 'other'), auto_size_text=True)
        ],
    ]

    layout = [[
        sg.Frame('Command Line Parameteres',
                 command_line_parms,
                 title_color='green',
                 font='Any 12')
    ], [sg.Frame('Flags', flags, font='Any 12', title_color='blue')],
              [
                  sg.Frame('Loss Functions',
                           loss_functions,
                           font='Any 12',
                           title_color='red')
              ], [sg.Submit(), sg.Cancel()]]

    window = sg.Window('Machine Learning Front End',
                       font=("Helvetica", 12)).Layout(layout)
    button, values = window.Read()
    sg.SetOptions(text_justification='left')

    print(button, values)
Esempio n. 16
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