Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
-- Forwarded message -- Date: Thu, 6 Oct 2005 23:55:26 -0700 (PDT) From: Mike Cheponis <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Simple Tkinter question Danny, I got it: from Tkinter import * from time import * def my_update(): for i in rang

Re: [Tutor] Tutor Digest, Vol 20, Issue 22

2005-10-07 Thread Danny Yoo
On Thu, 6 Oct 2005, sanjay sinha wrote: > Is there any work done in language convirsion from endlish to hindi and > vice versa Hi Sanjay, Machine Translation (MT) is Hard. I believe you're asking for some kind of automatic language translator, and I'm sure there is work being done, but it's

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
> Danny, I got it: > > from Tkinter import * > from time import * > > def my_update(): >for i in range(3): > tv.set("Now it's %d"%i) > root.update() > sleep(1) > > root=Tk() > tv=StringVar() > Entry(textvariable=tv).pack() > tv.set("Initial Value of StringVar") > Button(text="Upd

Re: [Tutor] Simple Tkinter question

2005-10-07 Thread Alan Gauld
> def my_update(): > for i in range(3): > tv.set("Now it's %d"%i) > sleep(1) > > Button(text="Update", command=my_update).pack() > root.mainloop() > > > What happens when I hit the Update button is a 3-second pause, then "Now > it's 2" is displayed. This is a common gotcha in GUI progra

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Alan Gauld
>> The problem is that the GUI needs control back to be able to update the >> GUI display. > > Thanks, but what I don't understand is: > > Why doesn't the call tv.set("string") update what's on the screen. > Clearly, > Tkinter has control at that point, and there's no reason to delay updating > t

Re: [Tutor] [Fwd: Re: Consistant Overhead Byte Stuffing (COBS)algorithm help]

2005-10-07 Thread Kent Johnson
Michael Cotherman wrote: >>... is the decoding code, it does what you >>describe below. It is adding the zeros back in, that >>is the dst.append('\0') >> >>Kent > > Really??? I am a noob, but it looks like it only puts > a \0 at the end if code (the length) is less than 255, > as the if statem

Re: [Tutor] Making a character jump with pygame

2005-10-07 Thread Lee Harr
> I've edited the aliens.py example to make my character just move >back and forth. However I can't make him jump! It is not really clear to me from your code where you expect the character to jump. I do not see the word "jump" anywhere. I do see the word "bounce" and one reference to the to

Re: [Tutor] Matching dictionary entries by partial key

2005-10-07 Thread Kent Johnson
Danny Yoo wrote: > But as Kent mentioned, though, perhaps the easiest thing to implement is a > simple linear scan across all your key-values, and not worry until we know > this is a performance hotspot. *grin* It really depends on how many > entries we're searching against. Another alternative i

Re: [Tutor] Importing Modules Within Classes

2005-10-07 Thread Eric Walker
That was me using the import within the class. I only did it due to my ignorance. I am not advanced enough to use it like that and know what I am doing, so as suggested I just moved all of my imports to the top. Python Newbie. On Thursday 06 October 2005 08:21 pm, Kent Johnson wrote: > Danie

Re: [Tutor] Matching dictionary entries by partial key

2005-10-07 Thread William O'Higgins Witteman
On Thu, Oct 06, 2005 at 10:28:23PM -0400, Kent Johnson wrote: >William O'Higgins Witteman wrote: >> I'm trying to traverse a dictionary looking for partial matches of the >> key, and I'm not sure how. Here's a sample dictionary: >> >> dict = {1234 : value1, 20051234 : value2, 20071234 : value

Re: [Tutor] Importing Modules Within Classes

2005-10-07 Thread Pierre Barbier de Reuille
Kent Johnson a écrit : > Daniel Watkins wrote: > >[...] > >>However, someone (I don't recall who) said that there were occasions >>when it would be appropriate to import modules the former way. I was >>just wondering under what circumstances importing should be done this >>way? > > > That was

[Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Suranga Sarukkali
All this could look mostly like any of a question of a idiot! sorry for that. I've heard that Python is good for hacking and when I ask how to here on python tutor mailing list answers were all about reading some article I've already read before, it's not hacking I'm into now but a similar t

Re: [Tutor] Matching dictionary entries by partial key

2005-10-07 Thread Kent Johnson
William O'Higgins Witteman wrote: > On Thu, Oct 06, 2005 at 10:28:23PM -0400, Kent Johnson wrote: >> if key.startswith('') or key.startswith('2005'): > > > This is perfect! Where do I read about things like this? I've been > spending a bunch of time with the python.org documentation, "A Byt

Re: [Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Kent Johnson
Suranga Sarukkali wrote: > All this could look mostly like any of a question of a idiot! sorry for > that. > I've heard that Python is good for hacking and when I ask how to here on > python tutor mailing list answers were all about reading some article > I've already read before, it's not hacki

Re: [Tutor] Importing Modules Within Classes

2005-10-07 Thread Kent Johnson
Pierre Barbier de Reuille wrote: > (never import > a module in a small function likely to be called in an inner-loop !) That's good advice, but I would say "in a *time-critical* inner-loop". After the first import, importing a module is fast, it is just a few dictionary lookups (looking up the m

Re: [Tutor] FW: Is it Posible? To Crack And HowTo

2005-10-07 Thread Daniel Watkins
> > I've already read before, it's not hacking I'm into now but a > similar thing, Cracking Hacking and cracking are two completely different things. Hacking is a developer with some real talent actually making a contribution to computing by writing something of use. Cracking is a jackass who's too

Re: [Tutor] FW: Is it Posible? To Crack And HowTo

2005-10-07 Thread Kent Johnson
Daniel Watkins wrote: >>No, you can't get help cracking proprietary software on this list. >>Many of us are professional software developers who make a living as >>"greedy people having fun licensing software". > > How do you sleep at night? ;) On a good day the fun of creating all those licenses

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
[Keeping Tutor in CC] -- Forwarded message -- Date: Fri, 7 Oct 2005 01:25:26 -0700 (PDT) From: Mike Cheponis <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Simple Tkinter question (fwd) On Fri, 7 Oct 2005, Danny Yoo wrote: > Ok, that works too. Anothe

Re: [Tutor] pylibpcap

2005-10-07 Thread Danny Yoo
On Fri, 7 Oct 2005, Servando Garcia wrote: > I need to use pylibpcap. I am looking for any documentation at > all, tutorial would be nice. Hi Servando, Have you looked at the python-libpcap forum? That's probably be a better place to ask questions on pylibpcap: http://sourceforge.n

Re: [Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Danny Yoo
On Fri, 7 Oct 2005, Suranga Sarukkali wrote: > I've heard that Python is good for hacking and when I ask how to here on > python tutor mailing list answers were all about reading some article > I've already read before, [text cut] Here, read a little more. ESR has written an article on the ki

Re: [Tutor] Importing Modules Within Classes

2005-10-07 Thread Bill Campbell
On Fri, Oct 07, 2005, Kent Johnson wrote: >Pierre Barbier de Reuille wrote: >> (never import >> a module in a small function likely to be called in an inner-loop !) > >That's good advice, but I would say "in a *time-critical* inner-loop". After >the first import, importing a module is fast, it is

Re: [Tutor] Did anyone get the Kamaelia "Conversing" chapter 5 to work?

2005-10-07 Thread Michael Sparks
On Friday 07 October 2005 03:04, R. Alan Monroe wrote: > > I've just double checked what happens when running the contents of that > > page, and it works as expected (here at least), so I suspect the problems > > you're seeing are simply due to "code being in HTML" issues. > > Yeah I was writing as

Re: [Tutor] New Python book

2005-10-07 Thread Michael Sparks
On Wednesday 05 October 2005 19:20, Kent Johnson wrote: > This seems to be an update to his previous book, "Practical Python", rather > than a completely new book. The TOC is almost identical. I haven't read the > earlier book, either, so I don't have an opinion. The same sample chapter > is availa

[Tutor] Config Parser question

2005-10-07 Thread Alberto Troiano
Hey tutors   I’m trying to make a configuration file   I know how to read the sections and options (using ConfigParser module from Python 2.3.4 on Win XP)   What I wanted to know is that eventually I will need to add sections and options or change values or erase options or , etc  

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Alan Gauld
> I wish I understood Tkinter better; I've looked at most of the on-line > stuff, ... > well, after I deliver this one program with Tk, I think I'm going to > switch > to wxPython for future GUI front-ends. Most of the issues discssed on this thread apply to every GUI environment. They all basic

Re: [Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Michael Sparks
On Friday 07 October 2005 10:20, Suranga Sarukkali wrote: > All this could look mostly like any of a question of a idiot! sorry for > that. I've heard that Python is good for hacking and when I ask how to here > on python tutor mailing list answers were all about reading some article > I've already

Re: [Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Alan Gauld
> Suranga Sarukkali wrote: >> thing, Cracking and I've got lots of software by these we call >> proprietary software developers who are some greedy people having fun >> licensing software. Define greedy. Is it reasonable to get paid for the several years worth of effort that goes into creating

Re: [Tutor] Config Parser question

2005-10-07 Thread Kent Johnson
Alberto Troiano wrote: > I’m trying to make a configuration file > > I know how to read the sections and options (using ConfigParser module > from Python 2.3.4 on Win XP) > > What I wanted to know is that eventually I will need to add sections and > options or change values or erase options or

Re: [Tutor] Config Parser question

2005-10-07 Thread Alberto Troiano
Hey Kent Thank you for the reply Let me get this straight.. In order to store the new configuration I would have to make something like this? import ConfigParser f=open("config.ini","w+") c=ConfigParser.ConfigParser() c.add_section("foo") c.write(f) Please let me know if this is correct Thank

Re: [Tutor] Is it Posible? To Crack And HowTo

2005-10-07 Thread Danny Yoo
> > I've heard that Python is good for hacking and when I ask how to here > > on python tutor mailing list answers were all about reading some > > article I've already read before, Hi Suranga, I thought I already read this before too. http://mail.python.org/pipermail/tutor/2005-July/040002

Re: [Tutor] Config Parser question

2005-10-07 Thread Kent Johnson
Alberto Troiano wrote: > Let me get this straight.. In order to store the new configuration I would > have to make something like this? > > import ConfigParser > > f=open("config.ini","w+") I would use 'w' but to tell the truth I'm not to clear on the difference between 'w' and 'w+' > c=ConfigP

Re: [Tutor] [Fwd: Re: Consistant Overhead Byte Stuffing (COBS)algorithm help]

2005-10-07 Thread Michael Cotherman
The c code seems to be walking through the list moving bytes from src to dst, but the python code below seems to take one byte from src, start counitng up to the value from 1 and appending each and every value along the way to dst, no? -mike --- Alan Gauld <[EMAIL PROTECTED]> wrote: > > I am a

[Tutor] subclass problem: __names and type-checking

2005-10-07 Thread Brian van den Broek
Hi all, I'm having an issue which resists my attempts to give a snappy label to it. I have a solution that doesn't feel entirely correct, and which I cannot actual apply to my original case. The Issue: I have a class which I want to subclass. The subclass adds some additional arguments to __ini