[Tutor] 3 questions for my port scanner project
Hi list. Here are the questions (-: 1. How do I make a progress bar in Tkinter ? 2. I got a while loop which does the port scan itself. How can I end it while its working ? 3. For some reason the scan is too slow (2-3 seconds for a port). Is there a way to make it faster (other port scanner work allot faster... ) ? Thanks in advance !! -- 1. The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners. 2. Unix is user friendly - it's just picky about it's friends. 3. Documentation is like sex: when it is good, it is very, very good. And when it is bad, it is better than nothing. - Dick Brandon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] 3 questions for my port scanner project
Nr 3. If your using python sockets try socket.settimeout(x) Nick . On Sat, 2005-02-26 at 15:12 +0200, Mark Kels wrote: > Hi list. > > Here are the questions (-: > 1. How do I make a progress bar in Tkinter ? > 2. I got a while loop which does the port scan itself. How can I end > it while its working ? > 3. For some reason the scan is too slow (2-3 seconds for a port). Is > there a way to make it faster (other port scanner work allot faster... > ) ? > > Thanks in advance !! > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] 3 questions for my port scanner project
Mark Kels wrote: Hi list. Hi Mark, 2. I got a while loop which does the port scan itself. How can I end it while its working ? previous message with code: *http://tinyurl.com/3lobo* **I'm not totally sure of this, but you might try adding another conditional to your while loop that can be toggled by a Scan and Stop button in your Tkinter app. global ok_to_scan ok_to_scan = 1 # or True while (start_port <= end_port) and ok_to_scan: # ... do scan ... root.update() then bind a function to a Stop button which toggles 'ok_to_scan' to 0 (or False), also as previously suggested you should close the sockets that find an open port (sk.close()) inside your while loop. HTH, Marty ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Recursive Tkinter buttons
On Fri, 25 Feb 2005 12:21:18 +0100, Michael Lange > > You see, in my example above I called the list "buttonlist" instead of > "button"; maybe this naming > helps avoid confusion . > > Best regards > > Michael Many thanks for the help here. I got all my buttons displayed and stored in the list with: for i in range (1, 11): submittext = ">>> " self.s = Button(text=submittext, command = self.showButton) self.s.grid(column=4, row=i+4) submitlist.append(self.s) - however, when I click the button, I want self.showButton to know which one of them was pressed. I've seen in other gui programming the idea of an id or identifier - I can't see that here. Ideally, I would like to know the value of i in self.showButtons - but when I use self.showButtons(i) showButtons gets called straight at run time. Any ideas? TIA Adam -- http://www.monkeez.org PGP key: 0x7111B833 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor