Why doesn't the website run?



  • Why doesn't I have a website in this code with pythonping? What's the problem here?

    import tkinter as tk
    from tkinter import *
    from tkinter import messagebox
    from pythonping import ping
    import string
    import secrets
    

    win = Tk()
    win.geometry("375x250")
    win.resizable(0,0)
    win.title("All-in-one")

    defs

    def default():
    def ping():
    def showping():
    try:
    win.geometry("450x200")
    myLabel4 = Label(win, text="Ожидайте...", font=("Montserrat", 11))
    myLabel4.pack()
    win.update()
    myLabel4.destroy()
    win.geometry("450x190")
    tk.messagebox.showinfo("Пинг", "- Результаты пинга:\n" + str(ping(Input1.get(), verbose=True, count=5)))
    except:
    myLabel4.destroy()
    tk.messagebox.showerror("Ошибка", "- Произошла ошибка, проверьте правильность написания IP-адреса или ссылки")
    myLabel1.destroy()
    myButton1.destroy()
    myButton2.destroy()
    myButton3.destroy()
    Input1 = StringVar()
    myLabel2 = Label(win, text="Пинг", font=("Montserrat", 20))
    myLabel2.pack()
    myLabel3 = Label(win, text="Введите ссылку или IP-адрес", font=("Montserrat", 18))
    myLabel3.pack()
    myInput1 = Entry(win, font=("Montserrat", 15), textvariable=Input1, justify=LEFT, width=30, highlightbackground='black', highlightthickness=2)
    myInput1.pack(ipady=2)
    myButton4 = Button(win, text="Принять", font=("Montserrat", 15), command=showping)
    myButton4.pack(ipady=2, pady=12)
    win.geometry("450x190")
    myLabel1 = Label(win, text="Способы", font=("Montserrat", 20))
    myLabel1.pack()
    myButton1 = Button(win, text="Пинг", font=("Montserrat", 16), width=17, command=ping)
    myButton1.pack(pady=6)
    myButton2 = Button(win, text="Длина текста", font=("Montserrat", 16), width=17)
    myButton2.pack(pady=6)
    myButton3 = Button(win, text="Генератор паролей", font=("Montserrat", 16), width=17)
    myButton3.pack(pady=6)

    widgets

    default()

    win.mainloop()

    I want the program to take 5 ping results from the website that made the user Entry into the MessageBox.



  • First, if you remove the Exception:

    ping() got an unexpected keyword argument 'verbose'
    

    From here, you can guess what's in. ping(Input1.get(),...) There's clearly something wrong, and you have two different functions under one name: from pythonping import ping and def ping():

    But even if it's fixed, I get another mistake:

    [WinError 10013] Сделана попытка доступа к сокету методом, запрещенным правами доступа
    

    Um... The transfer of ICMP packages requires the rights of the administrator?



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2