2

i want to create_oval before nmap and it does nmap before he draw

import tkinter

screen = tkinter.Tk()
print("its me")

def return_target(event):
    global all_canvas
    all_canvas.create_oval(290, 54, 310, 73, fill='yellow')
    os.system("nmap -sV 8.8.8.8")


all_canvas = tkinter.Canvas(screen, width=2000, height=2000, relief=tkinter.FLAT)
all_canvas.create_text(70, 61, fill="white", text="target")
all_canvas.place(x=-1, y=-1)

tkinter.Label(screen, text="target")
target = tkinter.Entry(screen)
target.place(x=100, y=50)
target.bind("<Return>", return_target)

screen.mainloop()

i want to draw yellow circle before nmap start ty for your help

eyal
  • 107
  • 1
  • 7
  • 3
    Add `all_canvas.update()` before `os.system(...)`. – acw1668 May 15 '20 at 04:12
  • ty very mach :) – eyal May 15 '20 at 05:22
  • First you have to understand [Event-driven_programming](https://en.m.wikipedia.org/wiki/Event-driven_programming). Read through [`[tkinter] event driven programming`](https://stackoverflow.com/search?q=is%3Aanswer+%5Btkinter%5D+event+driven+programming+entry) and [Tkinter understanding mainloop](https://stackoverflow.com/a/29158947/7414759). `os.system(...` is blocking. – stovfl May 15 '20 at 09:36

0 Answers0