예제 #1
0
def getting_user_inputs():
    """
        Ask user for all the inputs required

        1. XLSX file with agreement ID
        2. Midway related details

        returns 1. path to XLSX file
                2. midway password
                3. midway usb key
    """
    # Setting Layout
    layout = [
        [
            sg.Text("Select the xlsx file with agreement IDs",
                    font=("Helvetica", 12))
        ],
        [sg.In(key="filepath"), sg.FileBrowse()],
        [
            sg.Text(
                "****************************************************************************************"
            )
        ],
        [
            sg.Text(
                "Enter Midway Authentication Details",
                justification="Centre",
                font=("Helvetica", 15),
            )
        ],
        [
            sg.Text("Enter midway password"),
            sg.InputText(key="mid_pass", default_text="", password_char="*"),
        ],
        [
            sg.Text("Press your usb Token key"),
            sg.InputText(key="mid_usb_key", default_text="",
                         password_char="*"),
        ],
        [
            sg.Text(
                "****************************************************************************************"
            )
        ],
        [
            sg.Button("Submit"),
            sg.Cancel(button_text="Exit"),
            sg.Button("Reset all values"),
        ],
        [
            sg.Text(
                "****************************************************************************************"
            )
        ],
        [
            sg.Text(
                "When this macro is running do not download any zip file or delete any zip file from Downloads folder",
                size=(60, 2),
                font=("Verdana", 8))
        ],
    ]
    # Create the Window
    window = sg.Window("Contra Cogs Invoice Download", layout)
    # Event Loop to process "events"
    while True:
        event, values = window.read()
        if event == "EXIT" or event is None:
            break  # exit button clicked
        elif event == "Submit":
            if (values["filepath"] == "" or values["mid_pass"] == ""
                    or values["mid_usb_key"] == ""):
                sg.popup("You need to fill all three values or Exit")
            else:
                return values["filepath"], values["mid_pass"], values[
                    "mid_usb_key"]
        elif event == "Reset all values":
            window["filepath"].update("")
            window["mid_pass"].update("")
            window["mid_usb_key"].update("")
        else:
            break
예제 #2
0
# coding:utf-8

import PySimpleGUI as sg
from pathlib import Path

sg.theme('DarkBlue2')

path_home = str(Path.home())

layout = [[sg.Text('会場JSON出力ツール', font=('Any', 17))],
          [
              sg.Text('会場CSV'),
              sg.InputText('', key='-file_csv-', enable_events=True),
              sg.FileBrowse('読み込み',
                            target='-file_csv-',
                            file_types=[('CSV ファイル', '*.csv')],
                            initial_folder=rf"{path_home}\Desktop")
          ], [sg.Submit("実行")]]
예제 #3
0

"""

아래는 GUI구성

"""

digit_check = list(("소수점없음", "첫째 자리", "둘째 자리", "셋째 자리", "넷째 자리", "다섯째 자리"))

sg.change_look_and_feel("TanBlue")

layout = [
    [sg.Text("자동입력용 데이터 선택")],
    [sg.Input(size=(70, 5)),
     sg.FileBrowse(button_text="데이터선택")],
    [sg.Button(button_text="데이터열기", key="OpenData")],
    [sg.Text("한글 탬플릿 선택")],
    [sg.Input(size=(70, 5)),
     sg.FileBrowse(button_text="탬플릿선택")],
    [sg.Button(button_text="탬플릿열기", key="OpenTemp")],
    [
        sg.InputCombo((digit_check), size=(20, 1), default_value="소수점없음"),
        sg.Checkbox("천단위 구분", size=(10, 1), default=True),
    ],
    [sg.Output(size=(80, 20))],
    [sg.ProgressBar(1000, orientation="h", size=(48.5, 20), key="progbar")],
    [
        sg.Button(button_text="굽기", key="OK"),
        sg.Button("테스트페이지", key="Test"),
        sg.Button(button_text="결과물 폴더 열기",
예제 #4
0
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 15 16:31:23 2019

@author: Irving
"""

import PySimpleGUI as sg

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

window = sg.Window('Get filename example', layout)

event, values = window.Read()
예제 #5
0
def scheduleInput():
    msg = "Nothing is currently scheduled. Please create a new schedule."

    time_layout = []

    col_1 = [[
        sg.CalendarButton('Calendar',
                          pad=None,
                          font=('sans-serif', 12, 'bold'),
                          button_color=('green', 'white'),
                          key='_CALENDAR_',
                          format=('%d %B, %Y'))
    ], [sg.T('')],
             [
                 sg.Radio('AM', "AMPM", font=("sans-serif", 12), default=True),
                 sg.Radio('PM', "AMPM", font=("sans-serif", 12))
             ],
             [
                 sg.Slider(range=(0, 12),
                           default_value=0,
                           size=(30, 20),
                           orientation="horizontal",
                           font=("sans-serif", 12),
                           key="hours")
             ], [sg.Text("Hour", font=("sans-serif", 12))],
             [
                 sg.Slider(range=(0, 59),
                           default_value=0,
                           size=(30, 20),
                           orientation="horizontal",
                           font=("sans-serif", 12),
                           key="minutes")
             ], [sg.Text("Minutes", font=("sans-serif", 12))], [sg.T('')],
             [
                 sg.Combo(["Red Ale", "Lager", "Porter"]),
                 sg.Text(" "),
                 sg.FileBrowse()
             ],
             [
                 sg.Text(
                     "Select a recipe from the dropdown or upload a new one.",
                     font=("sans-serif", 12))
             ]]

    col_2 = [[sg.Multiline('', size=(60, 30))]]

    layout_schedule = [[sg.T('')], [sg.Text(msg, font=("sans-serif", 12))],
                       [sg.T('')],
                       [
                           sg.Column(col_1),
                           sg.VerticalSeparator(pad=(0, 0)),
                           sg.Column(col_2)
                       ], [sg.T('')],
                       [
                           sg.Graph(canvas_size=(50, 25),
                                    graph_bottom_left=(0, 0),
                                    graph_top_right=(50, 25),
                                    key="graph_btn_save",
                                    enable_events=True),
                           sg.Text(' '),
                           sg.Graph(canvas_size=(50, 25),
                                    graph_bottom_left=(0, 0),
                                    graph_top_right=(50, 25),
                                    key="graph_btn_cancel",
                                    enable_events=True)
                       ]]

    window_schedule = sg.Window("Schedule Input",
                                layout_schedule,
                                finalize=True)
    graph_btn_save = window_schedule.Element("graph_btn_save")
    graph_btn_cancel = window_schedule.Element("graph_btn_cancel")
    save = graph_btn_save.DrawImage(data=btn_save, location=(0, 25))
    cancel = graph_btn_cancel.DrawImage(data=btn_cancel, location=(0, 25))

    while True:
        event, values = window_schedule.read()
        if event == sg.WIN_CLOSED:  # if user closes window or clicks cancel
            break
        #print(event)
        #print(values)


#         elif event in ('graph_btn_save', 'graph_btn_cancel'):
#             print(values)
#         elif event == "_CALENDAR_":
#             print(values)

    window_schedule.close()
예제 #6
0
import pandas as pd
import PySimpleGUI as sg
#ChannelOrderID	ChannelName	FulfillmentDate	Carrier	ShippingTrackingNumber	ShippingMethod	ShippingTrackingURL	ChannelOrderItemID	MerchantOrderItemID	SKU	Quantity
sg.theme("DarkTeal2")
layout = [[sg.T("")],
          [
              sg.Text("Choose a file: "),
              sg.Input(key="-IN2-", change_submits=True),
              sg.FileBrowse(key="-IN-")
          ], [sg.Button('Submit'), sg.Cancel()]]
window = sg.Window('What File are You Using', layout, size=(600, 150))
while True:
    event, values = window.read()
    #print(values["-IN2-"])
    if event == sg.WIN_CLOSED or event == "Exit" or event == "Cancel":
        break
    elif event == "Submit":
        window.close()
        path = values["-IN-"]
        break

data = pd.read_excel(path)

for label, row in data.iterrows():
    A = row["ChannelOrderID"]
    B = row["ChannelName"]
    C = row["FulfillmentDate"]
    D = row["Carrier"]
    E = row["ShippingTrackingNumber"]
    F = row["ShippingMethod"]
    G = row["ShippingTrackingURL"]
예제 #7
0
def layoutStart():
    layout_start = [[
        sg.Frame(
            layout=[[
                sg.Text('Gene List File',
                        background_color='#343434',
                        text_color='#e4e4e4')
            ], [sg.Input(), sg.FileBrowse()],
                    [
                        sg.Text('Network Structure File',
                                background_color='#343434',
                                text_color='#e4e4e4')
                    ], [sg.Input(), sg.FileBrowse()]],
            title='Import network',
            title_color='#e4e4e4',
            relief=sg.RELIEF_SUNKEN,
            background_color='#343434',
            tooltip=
            'Choose gene list file and network structure file to import a predefined network model'
        )
    ],
                    [
                        sg.Frame(
                            layout=[[
                                sg.Text('Number of nodes',
                                        background_color='#343434',
                                        text_color='#e4e4e4')
                            ],
                                    [sg.Input()],
                                    [
                                        sg.Text('Number of interactions',
                                                background_color='#343434',
                                                text_color='#e4e4e4')
                                    ], [sg.Input()]],
                            title=
                            'Gene network Automated Initiation Algorithm (GAIA)',
                            title_color='#e4e4e4',
                            relief=sg.RELIEF_SUNKEN,
                            background_color='#343434',
                            tooltip='Create a random network to work with')
                    ],
                    [
                        sg.Frame(
                            layout=[[
                                sg.Radio('Batch Computation Mode',
                                         'RADIO1',
                                         default=True,
                                         size=(18, 1),
                                         background_color='#343434',
                                         text_color='#e4e4e4'),
                                sg.Radio('Visual Network Mode',
                                         'RADIO1',
                                         background_color='#343434',
                                         text_color='#e4e4e4')
                            ]],
                            title='Run mode',
                            title_color='#e4e4e4',
                            relief=sg.RELIEF_SUNKEN,
                            background_color='#343434',
                            tooltip=
                            'Batch computation for whole network simulation and genes significance study / Interactive network to quick test hypothesis manually and visually'
                        )
                    ], [sg.CloseButton('Import'),
                        sg.CloseButton('Cancel')]]
    window_start = sg.Window("Initialize Network",
                             alpha_channel=0.95,
                             layout=layout_start)
    return window_start
예제 #8
0
     )
 ],
 [
     sg.Table(values=table_data,
              headings=table_header,
              auto_size_columns=False,
              background_color='light gray',
              hide_vertical_scroll=True,
              justification='center',
              num_rows=1)
 ],
 [sg.Text('')],
 [
     sg.Text('Import Location:', ),
     sg.Text(justification='right', background_color='white', size=[30, 1]),
     sg.FileBrowse(auto_size_button=False)
 ],
 [
     sg.Checkbox('Create Sites (Only unique site IDs will be used)',
                 key='__sites__')
 ],
 [sg.Checkbox('Create Sectors (Grouped by technology)', key='__sectors__')],
 [
     sg.Text('Export Location:', ),
     sg.Text(justification='right', background_color='white', size=[30, 1]),
     sg.FileSaveAs(key='export_location',
                   button_text='Browse',
                   file_types=(('Kml', '*.kml'), ('All Files', '*.*')),
                   auto_size_button=False),
     sg.Ok(button_text='Export', key='__export__', auto_size_button=False),
     sg.Exit(auto_size_button=False)
예제 #9
0
        valor = (int(row[col_cant]) if row[col_cant] is not '' else 0)
        # busco en el diccionario si ya no lo agregue, y lo agrego o actualizo si corresponde
        if uni not in cant:
            cant[uni] = valor
        else:
            cant[uni] += valor
    return cant


#PP
#layout
ancho = 400
alto = 170
menu = [[sg.Text('Archivo')],
        [sg.Input(),
         sg.FileBrowse(),
         sg.OK(), sg.Button('Cancelar')],
        [
            sg.Listbox(values=[], key='Universidad', size=(60, 10)),
            sg.Graph(canvas_size=(ancho, alto),
                     graph_bottom_left=(0, 0),
                     graph_top_right=(ancho, alto),
                     background_color='red',
                     key='grafico')
        ], [sg.ReadButton('Ordenar', key='boton_ordenar', disabled=True)]]
win = sg.Window('Practica_04 | Ejercicio_07', layout=menu, finalize=True)

# ejecucion
while True:
    event, values = win.read()
    #guardo en origen el path del archivo a leer
예제 #10
0
def createLayout():
    layout = [
        [
            sg.Text('Исходный документ'),
            sg.InputText(key='-docfile-', size=(60, 1), pad=((3, 0), 0)),
            sg.FileBrowse("Выбрать..", key='-choicefile-', pad=((5, 0), 0))
        ],
        [
            sg.Frame(layout=[[
                sg.Text('Тип шрифта:'),
                sg.InputCombo(
                    ('Times New Roman', 'Calibri', 'Tahoma',
                     'Franklin Gothic Medium', 'Comic Sans', 'Segoe', 'Align'),
                    size=(23, 1),
                    key='-fontname-',
                    pad=((2, 0), 0)),
                sg.Text('Размер:', pad=((10, 0), 0)),
                sg.Spin([i for i in range(1, 72)],
                        initial_value=12,
                        key='-fontsize-',
                        size=(4, 1)),
                sg.ColorChooserButton("Выберите цвет",
                                      target='-fontcolor-',
                                      key='-color-',
                                      size=(15, 1),
                                      pad=((18, 0), 0)),
                sg.InputText(enable_events=True,
                             key='-fontcolor-',
                             size=(12, 1),
                             pad=((4, 0), 0),
                             justification='center')
            ],
                             [
                                 sg.Text('Выравнивание:'),
                                 sg.InputCombo(
                                     ('По левому краю', 'По центру',
                                      'По правому краю', 'По ширине'),
                                     size=(20, 1),
                                     key='-aligment-',
                                     pad=((6, 0), 0)),
                                 sg.Checkbox('Жирный',
                                             key='-bold-',
                                             font=('Segoe', 10, 'bold'),
                                             pad=((10, 0), 0)),
                                 sg.Checkbox('Курсив',
                                             key='-italic-',
                                             font=('Segoe', 10, 'italic'),
                                             pad=((37, 0), 0)),
                                 sg.Checkbox('Подчёркнутый',
                                             key='-underline-',
                                             font=('Segoe', 10, 'underline'),
                                             pad=((37, 0), 0))
                             ]],
                     title='Текст',
                     font=('Segoe', 12, 'bold'))
        ],
        [
            sg.Frame(layout=[[
                sg.Text('Междустрочный интервал:'),
                sg.InputCombo(('1.5', 'Двойной', 'Одинарный', 'Минимум'),
                              size=(11, 1),
                              key='-linespace-'),
                sg.Text('Интервал перед:', size=(13, 1), pad=((10, 0), 0)),
                sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                        initial_value=0,
                        key='-before-',
                        size=(5, 1)),
                sg.Text('Интервал после:', size=(14, 1), pad=((5, 0), 0)),
                sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                        initial_value=0,
                        key='-after-',
                        size=(5, 1))
            ],
                             [
                                 sg.Text('Начало абзаца:'),
                                 sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                                         initial_value=1.25,
                                         key='-redline-',
                                         size=(5, 1),
                                         pad=((5, 0), 0)),
                                 sg.Text('Интервал cлева:',
                                         size=(13, 1),
                                         pad=((120, 0), 0)),
                                 sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                                         initial_value=0,
                                         key='-intleft-',
                                         size=(5, 1)),
                                 sg.Text('Интервал cправа:',
                                         size=(14, 1),
                                         pad=((5, 0), 0)),
                                 sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                                         initial_value=0,
                                         key='-intright-',
                                         size=(5, 1))
                             ]],
                     title='Абзац',
                     font=('Segoe', 12, 'bold'))
        ],
        [
            sg.Frame(layout=[[
                sg.Text('Верхнее:', size=(7, 1)),
                sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                        initial_value=0,
                        key='-top-',
                        size=(5, 1)),
                sg.Text('Нижнее:', size=(6, 1), pad=((5, 2), 0)),
                sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                        initial_value=0,
                        key='-bottom-',
                        size=(5, 1))
            ],
                             [
                                 sg.Text('Левое:', size=(7, 1)),
                                 sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                                         initial_value=0,
                                         key='-left-',
                                         size=(5, 1)),
                                 sg.Text('Правое:',
                                         size=(6, 1),
                                         pad=((5, 2), 9)),
                                 sg.Spin([str(i) for i in frange(0, 72, 0.25)],
                                         initial_value=0,
                                         key='-right-',
                                         size=(5, 1))
                             ]],
                     title='Поля',
                     font=('Segoe', 12, 'bold')),
            sg.Frame(layout=[[
                sg.FileBrowse("Загрузить шаблон",
                              key='-template-',
                              size=(15, 0)),
                sg.InputText(enable_events=True,
                             key='-example-',
                             size=(31, 0),
                             pad=((3, 0), 0))
            ],
                             [
                                 sg.FileSaveAs("Сохранить шаблон",
                                               file_types=(('ALL Files',
                                                            '*.json'), ),
                                               target='-saved-',
                                               key='-save-',
                                               size=(15, 0),
                                               pad=((1, 1), 5)),
                                 sg.InputText(enable_events=True,
                                              key='-saved-',
                                              size=(31, 0),
                                              pad=((3, 0), 0))
                             ]],
                     title='Шаблоны',
                     font=('Segoe', 12, 'bold'),
                     pad=((5, 0), 0))
        ],
        [
            sg.Button("Применить", size=(14, 2), pad=((0, 5), 4)),
            sg.Button("Закрыть", size=(14, 2), pad=((5, 0), 4))
        ]
    ]
    return layout
예제 #11
0
            ev_Programs, vals_Programs = win_Programs.Read()
            if ev_Programs is None or ev_Programs == 'Exit':
                winActive_Programs = False
                win_Programs.Close()
                win_Main.UnHide()
                break

            # QGIS Label Updates Window
            # If Labels window is not active and the event on the programs page is to press 'QGIS Label Updates'...
            if not winActive_Labels and ev_Programs == 'QGIS Label Updates':
                winActive_Labels = True
                win_Programs.Hide()
                # Note: a key (as seen in the layout below in red) allows you to reference this user input in a fxn (see below)
                layout_Labels = [[sg.Text('Please enter the Working Interest Detail and Ownership Labels')],
                                 [sg.Checkbox("Webscrape these files?", key = '-scrape-')],
                                 [sg.Text("Working Interest Detail: "),sg.FileBrowse('Browse', target = '-wi-'), sg.InputText(key='-wi-', size=(65,1))],
                                 [sg.Text("Ownership Labels: "),sg.FileBrowse('Browse', target = '-or-'), sg.InputText(key='-or-', size=(65,1))],
                                 [sg.Text('', key='-output-', size=(10, 1))],
                                 [sg.Submit()]]
                win_Labels = sg.Window('QGIS Label Updates').Layout(layout_Labels)
                while True:
                    ev_Labels, vals_Labels = win_Labels.Read()
                    if ev_Labels is None or ev_Labels == 'Exit':
                        winActive_Labels = False
                        win_Labels.Close()
                        win_Programs.UnHide()
                        break
                    # This is where it starts getting different again.. pay attention.
                    # If the event/click is on Submit:
                    if ev_Labels == 'Submit':
                        # Start a thread (almost like a separate program), that takes the fxn updateLabels, with the
예제 #12
0
  sg.Input(key='maps_url')],
 [sg.Text('StreetView Pano ID:', size=(18, 1)),
  sg.Input(key='pano_id')],
 [sg.Text('', size=(18, 1)),
  sg.Button('Get Pano ID', size=(12, 1))],
 [sg.Text('Location name:', size=(18, 1)),
  sg.Input(key='location_name')],
 [
     sg.Text('Image type:', size=(18, 1)),
     sg.Radio('360 deg panorama', "RADIO1", default=True, key='pano'),
     sg.Radio('Hemispherical fisheye', "RADIO1", key='fisheye')
 ],
 [
     sg.Text('Select image file:', size=(18, 1)),
     sg.Input(key='img_filepath'),
     sg.FileBrowse(file_types=(("Images", ".jpg .png"), ))
 ],
 [
     sg.Text('Output folder:', size=(18, 1)),
     sg.Input(key='output_folder'),
     sg.FolderBrowse()
 ],
 [
     sg.Text('Sky tracer sensitivity:', size=(18, 1)),
     sg.Slider(range=(1, 700),
               default_value=350,
               size=(20, 15),
               orientation='horizontal',
               key='sensitivity_slider',
               enable_events=True,
               disable_number_display=True),
예제 #13
0
            max_flow += path_flow

            v = sink
            while (v != source):
                u = parent[v]
                self.graph[u][v] -= path_flow
                self.graph[v][u] += path_flow
                v = parent[v]

        return max_flow


if len(sys.argv) == 1:
    event1, values1 = sg.Window(
        'Maximum Flow',
        [[sg.Text('Choose a file')], [sg.In(), sg.FileBrowse()],
         [sg.Open(), sg.Cancel()]]).read(close=True)
    fname = values1[0]

else:
    fname = sys.argv[1]

if not fname:
    raise SystemExit("Cancelling: no filename supplied...")

f = open(fname, "r")
if f.mode == 'r':
    contents = f.read()
    contents = re.split(r'[,\s]\s*', contents)

a = contents[0::6]
예제 #14
0
파일: ileappGUI.py 프로젝트: slad99/iLEAPP
    [sg.Text('https://github.com/abrignoni/iLEAPP',
             font=("Helvetica", 18))],  #added font type and font size
    [
        sg.Text(
            'Select the file type or directory of the target iOS full file system extraction for parsing.',
            font=("Helvetica", 16))
    ],  #added font type and font size
    [
        sg.Radio('.Tar', "rad1", default=True, font=("Helvetica", 14)),
        sg.Radio('Directory', "rad1", font=("Helvetica", 14)),
        sg.Radio('.Zip', "rad1", font=("Helvetica", 14))
    ],  #added font type and font size
    [
        sg.Text('File:', size=(8, 1), font=("Helvetica", 14)),
        sg.Input(),
        sg.FileBrowse(font=("Helvetica", 12))
    ],  #added font type and font size
    [
        sg.Text('Directory:', size=(8, 1), font=("Helvetica", 14)),
        sg.Input(),
        sg.FolderBrowse(font=("Helvetica", 12))
    ],  #added font type and font size
    [sg.Output(size=(100, 40))],  #changed size from (88,20)
    [
        sg.Submit('Process', font=("Helvetica", 14)),
        sg.Button('Close', font=("Helvetica", 14))
    ]
]  #added font type and font size

# Create the Window
window = sg.Window('iLEAPP', layout)
예제 #15
0
import os

import PySimpleGUI as sg
import psutil
import matplotlib.pyplot as plt
import numpy as np

program1 = []
program2 = []
parallel = []
sg.theme('DarkAmber')  # Add a touch of color
# All the stuff inside your window.
layout = [[sg.Text('Insert two python algorithm files')],

          [sg.Text('File 1 /Algo 1')],
          [sg.Input(), sg.FileBrowse()],
          [sg.Text('File 2 /Algo 2')],
          [sg.Input(), sg.FileBrowse()],
          [sg.Button('Begin Comparison'), sg.Button('Cancel')], ]

# Create the Window
window = sg.Window('Algorithm Compare', layout)


# Event Loop to process "events" and get the "values" of the inputs

def runner(val, i):
    print("********************************This is for the file************************************" + val)
    metrics = []
    os.system(val)
    pid = os.getpid()
        )


options = ['XML to Excel and Image Rename',
           'Smartsheet Image Upload']  # Options for the GUI

form_option_1 = sg.FlexForm('XML to Excel and Image Rename'
                            )  # Set up form for XML to Excel and Image Rename
form_option_2 = sg.FlexForm(
    'Smartsheet Image Upload')  # Set up form for Smartsheet Image Upload

layout_option_1 = [  # Set up layout for option 1
    [sg.Text('XML to Excel and Image Rename')],  # Header for window
    [sg.Text('XML File', size=(18, 1)),
     sg.InputText(''),
     sg.FileBrowse()],  # File browse to get the XML file
    [
        sg.Text('Image Folder', size=(18, 1)),
        sg.InputText(''),
        sg.FolderBrowse()
    ],  # Folder browse to get the image folder
    [
        sg.Text('New Excel File Location', size=(18, 1)),
        sg.InputText(''),
        sg.FolderBrowse()
    ],  # Folder browse to select where the new excel file will be saved
    [sg.Text('New Excel File Name', size=(18, 1)),
     sg.InputText('')],  # Input text for the new excel file name
    [sg.Submit(), sg.Cancel()]  # Submit and cancel buttons
]
예제 #17
0
    return soft, srum, sys, wlan


sg.theme("SystemDefault")

layout = [
    [sg.Text('SOFTWARE registry file c:\windows\system32\config\SOFTWARE')],
    [
        sg.Checkbox('',
                    key='_SOFTCHK_',
                    size=(1, 1),
                    default=True,
                    disabled=True),
        sg.Input("REQUIRED", key="_SOFTWARE_"),
        sg.FileBrowse(target="_SOFTWARE_")
    ], [sg.Text('Configuration file with API keys. (.\werejugo.yaml)')],
    [
        sg.Checkbox('', size=(1, 1), default=True, disabled=True),
        sg.Input(config_path, key='_APIKEYS_'),
        sg.FileBrowse(target='_APIKEYS_')
    ], [sg.Text('Output folder for results.')],
    [
        sg.Checkbox('', size=(1, 1), default=True, disabled=True),
        sg.Input(os.getcwd(), key='_OUTDIR_'),
        sg.FolderBrowse(target='_OUTDIR_')
    ],
    [
        sg.Checkbox('', key="_TRIANG_", size=(1, 1), default=False),
        sg.Text(
            "Enable Extensive AP Triangulation (Potentially requires HOURS of processing)"
예제 #18
0
def arg_parse():
    i_vid = r'assets/cars.mp4'
    y_path = r'config/coco.names'
    weight_path = r'weight/yolov3.weights'
    cfg_path = r'config/yolov3.cfg'
    layout = [[
        sg.Text('Pytorch-YOLO Video Player',
                size=(25, 1),
                font=('Any', 18),
                text_color='#1c86ee',
                justification='left')
    ],
              [
                  sg.Text('Path to input video'),
                  sg.In(i_vid, size=(40, 1), key='video'),
                  sg.FileBrowse()
              ],
              [
                  sg.Text('Path to cfg File'),
                  sg.In(cfg_path, size=(40, 1), key='cfg_path'),
                  sg.FileBrowse()
              ],
              [
                  sg.Text('Path to weight File'),
                  sg.In(weight_path, size=(40, 1), key='weight_path'),
                  sg.FileBrowse()
              ],
              [
                  sg.Text('Path to label'),
                  sg.In(y_path, size=(40, 1), key='label_path'),
                  sg.FolderBrowse()
              ],
              [
                  sg.Text('Confidence'),
                  sg.Slider(range=(0, 1),
                            orientation='h',
                            resolution=.1,
                            default_value=.5,
                            size=(15, 15),
                            key='confidence')
              ],
              [
                  sg.Text('NMSThreshold'),
                  sg.Slider(range=(0, 1),
                            orientation='h',
                            resolution=.1,
                            default_value=.4,
                            size=(15, 15),
                            key='nms_threshold')
              ],
              [
                  sg.Text('Resolution'),
                  sg.Radio('320', "resolution", key="small_resol"),
                  sg.Radio('416', "resolution", default=True,
                           key="best_resol"),
                  sg.Radio('512', "resolution", key="large_resol")
              ],
              [
                  sg.Text("Classes to detect"),
                  sg.Listbox(values=class_names,
                             default_values=class_names,
                             select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE,
                             size=(30, 10),
                             key='class_list')
              ], [sg.Text(' ' * 8),
                  sg.Checkbox('Use webcam', key='webcam')],
              [sg.OK(), sg.Cancel()]]
    win = sg.Window('YOLO Video',
                    default_element_size=(14, 1),
                    text_justification='right',
                    auto_size_text=False).Layout(layout)
    event, values = win.Read()

    if event is None or event == 'Cancel':
        exit()
    args = values

    win.Close()

    return args
예제 #19
0
from GeneradorAutomatas import *

sg.theme('GreenTan')
btnSintactico = 'Analizar sintácticamente'
btnCadena = 'Analizar cadena'
txtInput = 'texto entrada'
txtSin = 'Caja de texto Sintac'
archivo = 'FILE'
ll1 = None

# STEP 1 define the layout
layout = [
    [
        sg.Text('Gramática para analizar'),
        sg.In(key=archivo),
        sg.FileBrowse(file_types=(("Archivos de texto plano", "*.txt"), ))
    ],
    [
        sg.Multiline(key=txtSin, default_text='',
                     size=(100, 40))  #análisis sin
    ],
    [
        sg.Text('Analizar cadena'),
        sg.In(key=txtInput),
    ],
    [sg.Button(btnSintactico), sg.Button(btnCadena)]
]

#STEP 2 - create the window
window = sg.Window('My new window', layout, grab_anywhere=True)
예제 #20
0
import os
import PySimpleGUI as sg
from printer import printer
from app_qt import generate_slices, dice_images

default_overlap = 15

# set up frontend GUI

sg.theme("Light Blue 2")

layout = [
    [sg.Text("STL File", size=(16, 1)), sg.InputText(""), sg.FileBrowse(key="path")],
    [
        sg.Text("Layer Thickness (um)", size=(16, 1)),
        sg.InputText(default_text=10, key="thickness"),
    ],
    [
        sg.Checkbox(
            "Advanced Options",
            size=(18, 1),
            default=False,
            change_submits=True,
            key="adv_opts",
        )
    ],
    [
        sg.Text("Image Width (px)", key="width_txt", visible=False, size=(16, 1)),
        sg.Column(
            [
                [
예제 #21
0
def layoutBooleanModelVisu():
    col_visu1 = [
        [
            sg.Text('Input : List of genes',
                    text_color='#e4e4e4',
                    background_color='#343434')
        ],
        [
            sg.Listbox(
                values=genes_names_list,
                select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE,
                size=(20, 35),
                tooltip=
                'Highlighted genes will be set to 1 at the start of each simulation run if the choice of genes initial states parameter is << specified >>'
            )
        ],
    ]

    col_visu2 = [
        [
            sg.Text('Input : Interactions in the network',
                    text_color='#e4e4e4',
                    background_color='#343434')
        ],
        [
            sg.Listbox(
                values=network_as_list,
                select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE,
                size=(30, 35),
                tooltip=
                'Format is [Source gene, interaction (-1: repression, 1 : activation), target gene]'
            )
        ],
    ]

    # col_subbatch3 = [[sg.Listbox(values=model_type_list, select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE, size=(15, 4),
    #                              tooltip='Highlight the models to run through ARGOS'),
    #                   sg.Listbox(values=boundary_model_list, select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE, size=(15, 4),
    #                              tooltip='Highlight the models to run through ARGOS')]]

    col_visu3 = [[
        sg.Frame(layout=[
            [
                sg.Text(
                    'Model type',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip='Choice of rules to apply to the network structure'
                ),
                sg.Combo(values=model_type_list,
                         default_value=model_type_list[0])
            ],
            [
                sg.Text(
                    'Boundary conditions',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip='Choice of behavior for nodes without regulators'),
                sg.Combo(values=boundary_model_list,
                         default_value=boundary_model_list[0])
            ],
            [
                sg.Text(
                    'Genes initial states',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'In <<specified>> mode, use the gene list panel to highlight the genes to be set to 1 at start,\n all other genes will be set to 0 (0 or 1 in <<random-specified>> mode)'
                ),
                sg.Combo(values=initial_states_choice_list,
                         default_value=initial_states_choice_list[0])
            ],
            [
                sg.Text(
                    'Number of initial states :',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'Choice of how many initial states the model will run from'
                ),
                sg.Radio('All possible states',
                         'RADIO2',
                         background_color='#343434',
                         text_color='#e4e4e4'),
                sg.Radio('Given number of states',
                         'RADIO2',
                         background_color='#343434',
                         text_color='#e4e4e4',
                         default=True),
                sg.InputText(size=(10, 1), default_text='1')
            ],
            [
                sg.Text(
                    'KO mutation type',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'Choice of Knocked Out mutation to apply to the network \n- single KO will run the model mutating each chosen genes one at a time'
                    '\n- multiple KO will run the model once with all chosen genes as KO'
                    '\n- combination KO will go through all combinations of double KO for the chosen genes and run the model for each'
                ),
                sg.Combo(values=KO_mutation_type_list,
                         default_value=KO_mutation_type_list[0])
            ],
            [
                sg.Text(
                    'List of KO genes',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'Enter gene names separated by a colon e.g. ABC, LMN, XYZ'
                ),
                sg.InputText()
            ],
            [
                sg.Text(
                    'OA mutation type',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'Choice of Over Activated mutation to apply to the network \n- single OA will run the model mutating each chosen genes one at a time'
                    '\n- multiple OA will run the model once with all chosen genes as KO'
                    '\n- combination OA will go through all combinations of double KO for the chosen genes and run the model for each'
                ),
                sg.Combo(values=OA_mutation_type_list,
                         default_value=OA_mutation_type_list[0])
            ],
            [
                sg.Text(
                    'List of OA genes',
                    text_color='#e4e4e4',
                    background_color='#343434',
                    tooltip=
                    'Enter gene names separated by a colon e.g. ABC, LMN, XYZ'
                ),
                sg.InputText()
            ], [sg.Button('Run HELIOS'),
                sg.Button('Run HELIOS 2')]
        ],
                 title='Predict System Fates',
                 title_color='#e4e4e4',
                 background_color='#343434',
                 relief=sg.RELIEF_GROOVE)
    ],
                 [
                     sg.Frame(layout=[[
                         sg.Text('Source',
                                 text_color='#e4e4e4',
                                 background_color='#343434',
                                 tooltip='Value must a number'),
                         sg.InputText(size=(10, 1)),
                         sg.Text(
                             'Interaction',
                             text_color='#e4e4e4',
                             background_color='#343434',
                             tooltip='1 for activation or -1 for inhibition'),
                         sg.InputText(size=(10, 1)),
                         sg.Text('Target',
                                 text_color='#e4e4e4',
                                 background_color='#343434',
                                 tooltip='Value must a '),
                         sg.InputText(size=(10, 1)),
                         sg.Button('Add element')
                     ]],
                              title='Add element to graph',
                              title_color='#e4e4e4',
                              background_color='#343434',
                              relief=sg.RELIEF_GROOVE)
                 ],
                 [
                     sg.Frame(layout=[[
                         sg.Button('Add element from CSV'),
                         sg.Input(),
                         sg.FileBrowse()
                     ]],
                              title='Add element from CSV',
                              title_color='#e4e4e4',
                              background_color='#343434',
                              relief=sg.RELIEF_GROOVE)
                 ],
                 [
                     sg.Frame(layout=[[
                         sg.Input(),
                         sg.FileBrowse(),
                         sg.Button("Load")
                     ]],
                              title='Load saved graph',
                              title_color='#e4e4e4',
                              background_color='#343434',
                              relief=sg.RELIEF_GROOVE)
                 ], [sg.Text('', background_color='#343434')]]

    layout_visu = [[
        sg.Column(col_visu1, background_color='#343434'),
        sg.Column(col_visu2, background_color='#343434'),
        sg.Column(col_visu3, background_color='#343434')
    ],
                   [
                       sg.Text('Extract core network :',
                               text_color='#e4e4e4',
                               background_color='#343434')
                   ], [sg.Exit()]]

    window_visu = sg.Window("Initialize Network",
                            alpha_channel=0.95,
                            layout=layout_visu)
    return window_visu
예제 #22
0
if platform.system() == 'Windows':
    LAYOUT_SIZES = {
        'column': 26,
        'progress': 38,
        'extract': 16,
        'mark_all': 14,
        'unmark_all': 14,
        'close': 6
    }

layout = [
    [sg.Text('Archivo MBOX')],
    [
        sg.InputText(disabled=True, size=(46, 1)),
        sg.FileBrowse('Seleccionar',
                      file_types=(('MBOX', '*.mbox'), ),
                      key='mboxfile',
                      size=(12, 1))
    ],
    [
        sg.Column([
            [
                sg.Text('Cabecera',
                        size=(LAYOUT_SIZES['column'], 1),
                        justification='center',
                        text_color=sg.BLUES[0])
            ],
            [sg.Checkbox('Incluir Fecha', key='date')],
            [sg.Checkbox('Incluir Destinatario', key='to')],
            [sg.Checkbox('Solo Email', key='to_email_only', pad=(20, 0))],
            [sg.Checkbox('Incluir Remitente', key='from')],
            [sg.Checkbox('Solo Email', key='from_email_only', pad=(20, 0))],
예제 #23
0
 ],
 [
     sg.Text('入力画像',
             size=(8, 1),
             background_color='grey59',
             justification='left',
             pad=(0, 0)),
     sg.Checkbox('閾値の表示',
                 default=False,
                 size=(10, 1),
                 background_color='grey59',
                 key='-thresh_prev-')
 ],
 [
     sg.Input(size=(30, 1), disabled=True),
     sg.FileBrowse(key='-Image_path-'),
 ],
 [
     sg.Text('抽出する色',
             size=(23, 1),
             background_color='grey59',
             justification='center',
             pad=(0, 0)),
     sg.Text('重心の計算方法',
             size=(17, 1),
             background_color='grey63',
             justification='center',
             pad=(0, 0))
 ],
 [
     sg.Radio('R',
예제 #24
0
파일: p3e7.py 프로젝트: pibytes/pythonUNLP
ordeno = []

layout = [[
    sg.Listbox(values=ordeno, size=(50, 15), key='_LIST_', pad=(70, 10))
], [sg.Input(key='_BROWSE_', enable_events=True, visible=False)],
          [
              sg.Graph(canvas_size=CANVAS,
                       graph_bottom_left=(0, 0),
                       graph_top_right=CANVAS,
                       background_color='black',
                       key='graph')
          ],
          [
              sg.Button('Dibujar', key='_CREAR_'),
              sg.FileBrowse('Abrir',
                            target='_BROWSE_',
                            file_types=(("Text Files", "*.txt"), )),
              sg.Button('Convertir', disabled=True, key='_CONV_'),
              sg.Button('Cerrar')
          ]]

window = sg.Window('Mujeres Programadoras GUI').Layout(layout)
window.Finalize()
graph = window.FindElement('graph')

while True:  # Event Loop
    event, val = window.Read()
    #print(event, val)

    archi = open("Todas_las_carreras.csv", "r", encoding='utf-8')
    csvreader = csv.reader(archi)
예제 #25
0
    return EPR_data, EPR_data_norm, EPR_int, EPR_int2, max_values, max_values_field 
#%%

#%% Ask whether the BGR shoulf be subtracted, or the RAW data plotted

layout2 = [[sg.Text("Do you want to subtract the backqround spectrum from your data?")],
           [sg.Button("Yes"), sg.Button("No")]]
window2 = sg.Window("Concerning background spectgrum (1/3)", layout2, size=(800,300))

layout3 = [[sg.Text("Choose whether the BGR spectrum is the 1st file in the selected folder \n or whether you want to select the BGR file manually.")],
           [sg.T("")],
           [sg.Radio("BGR spectrum is the 1st spectrum", "radio1", default=True)],
           [sg.Radio("Manually Choose the BGR spectrum", "radio1", default=False, key="-IN2")]]
window3 = sg.Window("Concerning background spectrum (2/3", laypout3, size=(800,400))

layout4 = [[sg.T("Select the BGR file:")], sg.Input(), sg.FileBrowse(key="-IN3-")], [sg.Button("Submit")]]
window4 = sg.Window("Concerning backgroud spectrum (3/3)", layout4, size=(800,500))

while True:
    event, values = window2.read()
    if event == sg.WIN_CLOSED:
        break
    elif event == "Yes":
        event, values = window3.read()
        if event == sg.WIN_CLOSED:
            break
        
        elif values["-IN2-"] == True:
            event, values = windows4.read()
            if event == sg.WIN_CLOSED:
                break
예제 #26
0
    doc_id = UUID('{FDD39AD0-238F-46AF-ADB4-6C85480369C7}')
    doc_path = get_path(doc_id)
    prefix_path = doc_path + "\\" + 'filled'
else:
    doc_path = str(os.path.join(Path.home(), 'Documents'))
    prefix_path = doc_path + "/" + 'filled'


layout = [[sg.Text('输入日期 (如:190520): ', font=("Helvetica", 15)), 
            sg.Input(default_text=date_digit, font=("Helvetica", 15), key='-date-', enable_events=True, size=(6, 1)),
            sg.CalendarButton('选择日期', font=("Helvetica", 15), auto_size_button=True, target='-date-', format='%d%m%y', default_date_m_d_y=(6,19,2020) )],
            # sg.StatusBar(text='默认今天', font=("Helvetica", 13), key='date_update', size=(12, 1))],
            # sg.Checkbox('合并PDF', default=False, size=(10, 1), key='-merge-', font=("Helvetica", 15))],
            [sg.Text('导入Excel/CSV: ', font=("Helvetica", 15)), 
            sg.Input(key='-file-', enable_events=True, font=("Helvetica", 13), size=(30, 1)), 
            sg.FileBrowse(button_text='打开文件', font=("Helvetica", 15))],
            [sg.Text('输出文件夹', font=("Helvetica", 15)), 
            sg.Input(default_text=prefix_path, size=(35, 1), font=("Helvetica", 13), key='-output-', enable_events=True),
            sg.FolderBrowse(button_text='打开文件夹', font=("Helvetica", 15))],
            [sg.Button('批量生成PDF', font=("Helvetica", 15)), sg.Button('Exit', font=("Helvetica", 15)),
            sg.StatusBar(text='就绪', key='file_update', font=("Helvetica", 15), size=(12, 1), 
            justification='center', auto_size_text=True, pad=(10, 7)),
            sg.Button('打开生成文件夹', font=("Helvetica", 15), key='-view-', visible=False)],
            [sg.Text('总额所在列:', font=("Helvetica", 15)),
            sg.Combo(values=['L', 'K', 'J', 'I', 'H', 'G', 'F', 'E', 'D', 'C'], default_value='L', 
            font=("Helvetica", 13), pad=(3, 3), key='-col-', size=(2, 1), enable_events=True),
            # sg.Input(default_text="L", font=("Helvetica", 13), key='-col-', enable_events=True, size=(2, 1)),
            sg.ProgressBar(max_value=10, orientation='h', size=(40, 22), key='progress', visible=False, pad=(10, 1))]]

window = sg.Window('Cheque Excel to PDF Converting System', layout, location=(250, 40))
progress_bar = window['progress']
예제 #27
0
# All this inside window
layout = [[sg.Text("PyBeats", font="Any 24", text_color=PRI_PURP)],
          [
              sg.Listbox(ls,
                         size=(30, 26),
                         font="Any 14",
                         key='-File Path-',
                         background_color=PRI_PURP),
              sg.Canvas(size=(figure_w, figure_h), key='-CANVAS-')
          ], [sg.Text("What file do you want to modify?", font="Any 14")],
          [
              sg.Input(size=(45, 1),
                       background_color="white",
                       text_color=PRI_PURP,
                       font="Any 14"),
              sg.FileBrowse(file_types=(("ALL Files", "*.wav"), ),
                            font="Any 14"),
              sg.Button('Play',
                        button_color=("white", PRI_PURP),
                        font="Any 14"),
              sg.Button('Base Boost',
                        button_color=("white", PRI_PURP),
                        font="Any 14"),
              sg.Button('Mid Boost',
                        button_color=("white", PRI_PURP),
                        font="Any 14"),
              sg.Button('Cancel', font="Any 14")
          ]]

# Create the window
win_name = "Py Beats (" + os.getcwd() + ")"
window = sg.Window(win_name, layout, finalize=True, button_color=PRI_PURP)
def settings_window():
    """
    Show the settings window.
    This is where the folder paths and program paths are set.
    Returns True if settings were changed

    :return: True if settings were changed
    :rtype: (bool)
    """

    explorer_program = get_explorer()
    try:
        global_editor = sg.pysimplegui_user_settings.get('-editor program-')
    except:
        global_editor = ''
    try:
        global_explorer = sg.pysimplegui_user_settings.get('-explorer program-')
    except:
        global_explorer = ''


    layout = [[sg.T('Program Settings', font='DEFAULT 25')],
              [sg.T('Path to Tree',  font='_ 16')],
               [sg.Combo(sorted(sg.user_settings_get_entry('-folder names-', [])), default_value=sg.user_settings_get_entry('-demos folder-', get_demo_path()), size=(50, 1), key='-FOLDERNAME-'),
               sg.FolderBrowse('Folder Browse', target='-FOLDERNAME-'), sg.B('Clear History')],
              [sg.T('Editor Program',  font='_ 16')],
              [sg.T('Leave blank to use global default'), sg.T(global_editor)],
                [ sg.In(sg.user_settings_get_entry('-editor program-', ''),k='-EDITOR PROGRAM-'), sg.FileBrowse()],
              [sg.T('File Explorer Program',  font='_ 16')],
              [sg.T('Leave blank to use global default'), sg.T(global_explorer)],
              [ sg.In(sg.user_settings_get_entry('-explorer program-'), k='-EXPLORER PROGRAM-'), sg.FileBrowse()],
               [sg.T('Theme (leave blank to use global default)', font='_ 16')],
              [sg.Combo(['']+sg.theme_list(),sg.user_settings_get_entry('-theme-', ''), readonly=True,  k='-THEME-')],
              [sg.CB('Use Advanced Interface', default=advanced_mode() ,k='-ADVANCED MODE-')],
              [sg.B('Ok', bind_return_key=True), sg.B('Cancel')],
              ]

    window = sg.Window('Settings', layout)

    settings_changed = False

    while True:
        event, values = window.read()
        if event in ('Cancel', sg.WIN_CLOSED):
            break
        if event == 'Ok':
            sg.user_settings_set_entry('-demos folder-', values['-FOLDERNAME-'])
            sg.user_settings_set_entry('-editor program-', values['-EDITOR PROGRAM-'])
            sg.user_settings_set_entry('-theme-', values['-THEME-'])
            sg.user_settings_set_entry('-folder names-', list(set(sg.user_settings_get_entry('-folder names-', []) + [values['-FOLDERNAME-'], ])))
            sg.user_settings_set_entry('-explorer program-', values['-EXPLORER PROGRAM-'])
            sg.user_settings_set_entry('-advanced mode-', values['-ADVANCED MODE-'])
            settings_changed = True
            break
        elif event == 'Clear History':
            sg.user_settings_set_entry('-folder names-', [])
            sg.user_settings_set_entry('-last filename-', '')
            window['-FOLDERNAME-'].update(values=[], value='')

    window.close()
    return settings_changed
예제 #29
0
import datetime
import shutil
import fileinput

def run(command, print_command=True):
    with Sultan.load() as s:
        s.commands = [command]
        out = s.run()
        stdout = '\n'.join(out.stdout)
        stderr = '\n'.join(out.stderr)
        stdout = "" if stdout == "" else "STDOUT:\n" + stdout
        stderr = "" if stderr == "" else "\nSTDERR:\n" + stderr
        ret = stdout + stderr
    return ret

event, (filename,) = sg.Window('Get iPython notebook file'). Layout([[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()] ]).Read()
if filename.endswith(".ipynb"):
    convert = "ipython nbconvert --to markdown "+filename+" --output-dir "+"./_posts/"
    d = datetime.datetime.today()
    d_text = d.strftime('%Y-%m-%d')
    if os.name == 'nt':
        base = filename.split("\\")[-1]
    else:
        base = base = filename.split("/")[-1]
    print(run(convert))
    shutil.move("./_posts/"+base[:-5]+"md", "./_posts/"+d_text+"-"+base[:-5]+".md")
    shutil.move("./_posts/"+base[:-6]+"_files", "assets/"+base[:-6]+"_files")
    st = open("./_posts/"+d_text+"-"+base[:-5]+".md").read()
    st = st.replace(base[:-6]+"_files", "assets/"+base[:-6]+"_files")
    f = open("./_posts/"+d_text+"-"+base[:-5]+".md", 'w')
    f.write(st)
예제 #30
0





#scaler, clf, scaleF, modelF = generateSVMOneClass(X_train)


# In[27]:


err = 0
sg.ChangeLookAndFeel("Reddit")
layout = [[sg.Text('Pick your data file', font=("Helvetica", 15))],      
                 [sg.Input(), sg.FileBrowse(), sg.Text('', size=(16,1), key='_ERROR_', text_color='red', font=("Helvetica", 12))], 
                 [sg.Text('Info', font=("Helvetica", 12))],
                [sg.Text('', size=(32,5), key='_SCORE_', font=("Helvetica", 12))],
                 [sg.Button('Submit', font=("Helvetica", 12)), sg.Button('Cancel', font=("Helvetica", 12))]]
window = sg.Window('Simple SVM Trainer', layout)    

while True:
    
    event, values = window.Read()    
    
    if event == None or event == 'Cancel':
          break

    if event == 'Submit':
        if values[0]:
            file_path = values[0]