DearPyGUI sending a request

60 Views Asked by At
Path = ""

def open_cheat():
    with zipfile.ZipFile(Path, "r") as zip_ref:
        zip_ref.extractall('D:\\1.exe\\LOL CHEAT\\AUTORUN')

    os.startfile("D:\\1.exe\\LOL CHEAT\\AUTORUN\\aksvndv.exe")


dpg.create_context()

window_width = 300
window_height = 150

dpg.create_viewport(title="LOL CHEAT", decorated=False)
dpg.configure_viewport(1, x_pos=100, y_pos=100, width=window_width, height=window_height)
dpg.set_viewport_max_height(window_height)
dpg.set_viewport_width(window_width)
big_let_start = 0x00C0  # Capital "A" in cyrillic alphabet
big_let_end = 0x00DF  # Capital "Я" in cyrillic alphabet
small_let_end = 0x00FF  # small "я" in cyrillic alphabet
remap_big_let = 0x0410  # Starting number for remapped cyrillic alphabet
alph_len = big_let_end - big_let_start + 1  # adds the shift from big letters to small
alph_shift = remap_big_let - big_let_start  # adds the shift from remapped to non-remapped
with dpg.font_registry():
    with dpg.font("C:\\Users\\FLEIZY\\Documents\\pythonProject\\fonts\\sf.ttf", 18) as default_font:
        dpg.add_font_range_hint(dpg.mvFontRangeHint_Default)
        dpg.add_font_range_hint(dpg.mvFontRangeHint_Cyrillic)
        biglet = remap_big_let  # Starting number for remapped cyrillic alphabet
        for i1 in range(big_let_start, big_let_end + 1):  # Cycle through big letters in cyrillic alphabet
            dpg.add_char_remap(i1, biglet)  # Remap the big cyrillic letter
            dpg.add_char_remap(i1 + alph_len, biglet + alph_len)  # Remap the small cyrillic letter
            biglet += 1  # choose next letter

with dpg.window() as main_menu_window:
    # with dpg.group(horizontal=True):
    dpg.add_text("      LOL CHEAT")
    dpg.add_button(label="Запустить чит", callback=open_cheat)
    dpg.add_button(label="Запустить игру", callback=open_game)
    dpg.add_input_text(label="Path")

dpg.bind_font(default_font)
dpg.set_primary_window(window=main_menu_window, value=True)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

How to make it so that when you enter your path in dpg.add_input_text(label="Path") it is sent to with zipfile.ZipFile(Path, "r") as zip_ref: I need that when I enter the path into the field it goes to a variable

0

There are 0 best solutions below