Мне нужна помощь в поиске скрытой ошибки, скрипт tkinter python3.Python

Программы на Python
Anonymous
Мне нужна помощь в поиске скрытой ошибки, скрипт tkinter python3.

Сообщение Anonymous »

Кнопки на второй вкладке по какой-то причине расположены слишком далеко друг от друга. Я довольно долго пытался исправить это с помощью случайных вещей, таких как конфигурация строк, фреймы и т. д., но это никогда не помогало.

Код: Выделить всё

import tkinter as tk
import tkinter.messagebox
from tkinter import *
from tkinter import ttk
import webbrowser
import time
import os

# Creating all the functions of the program

def Open_Discord():
webbrowser.open(url,new=new)

def biosite():
webbrowser.open(url2,new=new)

def mygithub():
webbrowser.open(url3, new=new)

def taskmgr():
time.sleep(0.3)
os.system("start taskmgr")
time.sleep(0.2)
tkinter.messagebox.showinfo(title="Multi Tool", message="Task Manager is Running!")

def ctrlpanel():
time.sleep(0.3)
os.system("start control")
time.sleep(0.2)
tkinter.messagebox.showinfo(title="Multi Tool", message="Control Panel is Running")

# Main settings of gui(title, size etc)
root = tk.Tk()
root.iconbitmap('C:/users/eac/Pictures/multitool.ico')
root.title("Multi Tool")
root.geometry("500x400")

# Choosing wether to open new tab or window then setting the actual url to goto
new = 1
url = "https://discord.gg/dbApbadrwD"
url2 = "https://fakecrime.bio/eac"
url3 = "https://github.com/BigDawgStepper"

# Creating main notebook
my_notebook = ttk.Notebook(root)
my_notebook.pack(expand=1, fill='both')

# Adding the tabs to the notebook/packing them
my_tab1 = ttk.Frame(my_notebook)
my_notebook.add(my_tab1, text="Welcome")
my_tab2 = ttk.Frame(my_notebook)
my_notebook.add(my_tab2, text="Tools")

# Tab 1 Labels
Label(my_tab1, text= "Welcome to BigDawgSteppers MultiTool", font= ('Helvetica 18 bold underline')).grid(row=0, column=0)
Label(my_tab1, text= "This Multi Tool has many features! Refer to the tabs at the top to locate tools!").grid(row=1, column=0)
Label(my_tab1, text= "Interested in my work or want to talk to me? Join the discord below!").grid(row=2, column=0)
Label(my_tab1, text= "You can join my disc using the button or copying this link! https://discord.gg/dbApbadrwD").grid(row=3, column=0)
Label(my_tab1, text= "Tool currently working for Win11 & Win10", font= ('Helvetica 18 bold')).grid(row=12, column=0)
Label(my_tab1, text= "Who is TheBigDawgStepper? Click the button below for more info...").grid(row=5, column=0)
Label(my_tab1, text= "This isnt the only tool ive made theres multiple version of this and more on my github!").grid(row=7, column=0)
Label(my_tab1, text= "^^^^AS OF 2024-05-22^^^^", font= ('Helvetica 18 bold')).grid(row=13, column=0)

# Tab 2 Labels
Label(my_tab2, text="Hey there this is the Tools Tab, have fun!", font= ('Helvetica 18 bold underline')).grid(row=0, column=0)

# Creating Frames
Frame(my_tab2, width=250, height=250).grid()

# Tab 1 Buttons
Button(my_tab1, text="Join my Discord Server Here!", padx=10, pady=10, command=Open_Discord).grid(row=8, column=0)
Button(my_tab1, text="Who even is TheBigDawgStepper?", padx=10, pady=10, command=biosite).grid(row=9, column=0)
Button(my_tab1, text="My github!", padx=10, pady=10, command=mygithub).grid(row=10, column=0)

# Tab 2 buttons
Button(my_tab2, text="Open Task Manager", command=taskmgr).grid(row=1, column=0)
Button(my_tab2, text="Open Control Panel", command=ctrlpanel).grid(row=2, column=0)

root.mainloop()
Я пытался использовать rowconfigure для установки размера, но он ничего не дал. Я пробовал использовать .pack вместо сетки, тогда программа даже не запускалась, а теперь я попытался создать рамку и поместить ее. в кадр и безуспешно

Подробнее здесь: https://stackoverflow.com/questions/785 ... on3-script

Вернуться в «Python»