Re: [Tutor] Pyduino

2009-09-08 Thread Michael Connors
> > > > You wouldn't want to run python on a 16 mhz processor, the interpreter > would use up all your resources. The Arduino language is not too hard > to learn. > > > I have followed some tutorials in the Arduino playground, for talking to the arduino from Python. You can do things like tell you

Re: [Tutor] Pyduino

2009-09-08 Thread Luke Paireepinart
Yes, this is true, but he was asking to use Python *instead* of the Arduino language. I really don't think it's too hard to learn the language, it's really straightforward. On Tue, Sep 8, 2009 at 9:13 AM, Michael Connors wrote: > >> >> You wouldn't want to run python on a 16 mhz processor, the

Re: [Tutor] Pyduino

2009-09-08 Thread Wayne
On Tue, Sep 8, 2009 at 4:22 AM, Luke Paireepinart wrote: > Yes, this is true, but he was asking to use Python *instead* of the Arduino > language. I really don't think it's too hard to learn the language, it's > really straightforward. I'll echo that sentiment. Just following the tutorials you

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
I am looking at this and wondering: Why does this use collections.defaultdict ? In fact i guess since collections.defaultdict is new to me i am not even sure why it exists and why someone would use this as opposed to using Python's built-in dictionary? and why was it used in this instance

Re: [Tutor] Pyduino

2009-09-08 Thread Douglas Philips
Check out: http://us.pycon.org/2009/conference/schedule/event/73/ which has the video of the talk as well. That was one of the many talks I didn't see in person, and is on my queue to watch. Hmmm, just got bumped a lot higher on the queue since I've also recently been bitten by the Arduino bug

Re: [Tutor] working with multiple sets

2009-09-08 Thread bob gailer
kevin parks wrote: I am looking at this and wondering: Why does this use collections.defaultdict ? In fact i guess since collections.defaultdict is new to me i am not even sure why it exists and why someone would use this as opposed to using Python's built-in dictionary? and why was it use

Re: [Tutor] (no subject)

2009-09-08 Thread Christian Witts
shellc...@juno.com wrote: I want to write a code that allows me to input a phrase and calculate the number of vowels twice. once with the for loop and second with the while loop.I can get the for loop to work but, not the while loop. this is my code and response. #demo for loop, and while lo

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
I also notice that if i do: def foo(): lookup = collections.defaultdict(list) x = range(10) y = range(5, 15) z = range(8, 22) sets = {'x': set(x), 'y': set(y), 'z': set(z)} for key, value in sets.items(): for element in value:

Re: [Tutor] Pyduino

2009-09-08 Thread Douglas Philips
Check out: http://us.pycon.org/2009/conference/schedule/event/73/ which has the video of the talk as well. That was one of the many talks I didn't see in person, and is on my queue to watch. Hmmm, just got bumped a lot higher on the queue since I've also recently been bitten by the Arduino bug

[Tutor] (no subject)

2009-09-08 Thread shellc...@juno.com
I want to write a code that allows me to input a phrase and calculate the number of vowels twice. once with the for loop and second with the while loop.I can get the for loop to work but, not the while loop. this is my code and response. #demo for loop, and while loop phrase = raw_input("

Re: [Tutor] Pyduino

2009-09-08 Thread Kent Johnson
On Tue, Sep 8, 2009 at 10:11 AM, Douglas Philips wrote: >> Check out: >> http://us.pycon.org/2009/conference/schedule/event/73/ >> which has the video of the talk as well. >> That was one of the many talks I didn't see in person, and is on my queue >> to watch. Hmmm, just got bumped a lot higher on

[Tutor] (no subject)

2009-09-08 Thread shellc...@juno.com
I,m trying to get a phrase from a user and print it backwards using the for statement along with the range function, but all I get with range function is integers not alpha. example range(-1) does not work. message = raw_input("enter a message: ") # will produce a back ward message by e

Re: [Tutor] (no subject)

2009-09-08 Thread Lucas Prado Melo
On Tue, Sep 8, 2009 at 10:48 AM, shellc...@juno.com wrote: > > I want to write a code that allows me to input a phrase and calculate the > number of vowels twice. once with the for loop and second with the while > loop.I can get the for loop to work but, not the while loop. this is my code > and r

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
Actually, This seems like it works: lookup[x].sort() in like so: def foo(): lookup = collections.defaultdict(list) x = range(10) y = range(5, 15) z = range(8, 22) sets = {'x': set(x), 'y': set(y), 'z': set(z)} for key, value in s

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
I guess what i honestly want to asks, but am hesitant to since it makes me look like a dork is: What would this look like if i want to use a straight up built-in dictionary type and not the collections.defaultdict. import collections def foo(): lookup = collections.defaultdict(l

Re: [Tutor] (no subject)

2009-09-08 Thread Lucas Prado Melo
On Tue, Sep 8, 2009 at 2:09 PM, shellc...@juno.com wrote: > I,m trying to get a phrase from a user and print it backwards using the for > statement along with the range function, but all I get with range function > is integers not alpha. example range(-1) does not work. > > What about range(0, -n,

Re: [Tutor] working with multiple sets

2009-09-08 Thread Kent Johnson
On Tue, Sep 8, 2009 at 10:07 AM, kevin parks wrote: > I also notice that if i do: > > > def foo(): >        lookup = collections.defaultdict(list) >        x = range(10) >        y = range(5, 15) >        z = range(8, 22) >        sets = {'x': set(x), 'y': set(y), 'z': set(z)} >        for key, val

Re: [Tutor] (no subject)

2009-09-08 Thread Alan Gauld
wrote in message Please specify a meaningful subject line, it makes reading messages in a threaded mailtool or newsreader much easier. #demo for loop, and while loop phrase = raw_input("enter your phrase:") VOWELS = "aeiou" number = 0 for letter in phrase: if letter.lower() in VOWELS:

Re: [Tutor] working with multiple sets

2009-09-08 Thread Alan Gauld
"kevin parks" wrote What would this look like if i want to use a straight up built-in dictionary type and not the collections.defaultdict. Not too different: import collections def foo(): lookup = collections.defaultdict(list) x = range(10) y = range(5, 15) z = range(8, 22) sets = {'x

Re: [Tutor] Pyduino

2009-09-08 Thread Alan Gauld
"Wayne" wrote Yes, this is true, but he was asking to use Python *instead* of the Arduino language. I really don't think it's too hard to learn the language, it's really straightforward. I'll echo that sentiment. Just following the tutorials you can pretty much figure out everything you n

Re: [Tutor] working with multiple sets

2009-09-08 Thread Douglas Philips
On or about 2009 Sep 8, at 1:51 PM, Alan Gauld indited: "kevin parks" wrote What would this look like if i want to use a straight up built-in dictionary type and not the collections.defaultdict. Not too different: import collections def foo(): lookup = collections.defaultdict(list) # Dou

[Tutor] pygtk

2009-09-08 Thread Ajith Gopinath
I will appreciate , if somebody guides me to a proper doc. on pygtk for 2.5/2.6. I am currently unable to find a good doc for the same :o( Thanks and regards ~|| a j i t || ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

[Tutor] use case for graphs and generators?

2009-09-08 Thread Serdar Tumgoren
Hi everyone, I was hoping someone could advise on whether I'm tackling a specific problem in the correct manner. Specifically, I'm trying to use a "clean" set of historical data to fix omissions/errors among a stream of newer data. To do so, I've devised a series of backend SQL statements which ne

Re: [Tutor] pygtk

2009-09-08 Thread Patrick Sabin
The official docs http://www.pygtk.org/pygtk2tutorial/index.html http://library.gnome.org/devel/pygtk/stable/ worked for me. - Patrick Ajith Gopinath schrieb: I will appreciate , if somebody guides me to a proper doc. on pygtk for 2.5/2.6. I am currently unable to find a good doc for the same

Re: [Tutor] working with multiple sets

2009-09-08 Thread Alan Gauld
"Douglas Philips" wrote for element in value: lookup[element] = lookup.get(element, []).append(key) # Doug: That doesn't do what you think it does, it won't insert the new list into the dictionary. Ah, yes I forgot append was one of those annoying python methods t

Re: [Tutor] working with multiple sets

2009-09-08 Thread Lie Ryan
Alan Gauld wrote: "kevin parks" wrote What would this look like if i want to use a straight up built-in dictionary type and not the collections.defaultdict. Not too different: Alternatively: import collections def foo(): lookup = collections.defaultdict(list) x = range(10) y = range(

Re: [Tutor] pygtk

2009-09-08 Thread Ajith Gopinath
Thanks Patrik, this is what i am searching for. || a j i t || On Wed, Sep 9, 2009 at 1:27 AM, Patrick Sabin wrote: > The official docs > > http://www.pygtk.org/pygtk2tutorial/index.html > http://library.gnome.org/devel/pygtk/stable/ > > worked for me. > > - Patrick > > Ajith Gopinath schrieb: >

Re: [Tutor] (no subject)

2009-09-08 Thread Christian Witts
Lucas Prado Melo wrote: On Tue, Sep 8, 2009 at 2:09 PM, shellc...@juno.com > wrote: I,m trying to get a phrase from a user and print it backwards using the for statement along with the range function, but all I get with range fu

Re: [Tutor] (no subject)

2009-09-08 Thread Alan Gauld
"Christian Witts" wrote What about range(0, -n, -1) ? That would need to have a starting value of -1 and an end value of -(len(phrase)+1). Of else you can start at length - 1, end at zero and a step value of -1. Another option, using "normal" range values but negative indexing is fo

Re: [Tutor] working with multiple sets

2009-09-08 Thread Alan Gauld
"Lie Ryan" wrote for key, value in sets.items(): for element in value: try: lookup[element] = lookup[element].append(key) This has the same flaw as mine. it nneeds to be lookup[element].append(key) ie no assignment, othewise