Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-17 Thread Jim Mooney
On 16 June 2013 21:52, eryksun wrote: > In PyScripter you can just type the closing quote/brace over the > auto-inserted one. Ah, the light dawns. One of those things I'd never find in the docs for PyScripter, unless I stopped learning Python and read them all - if that's in the docs. Now I can

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread eryksun
On Sun, Jun 16, 2013 at 4:43 AM, Roel Schroeven wrote: > Jim Mooney schreef: >> I'll get to here: >> >> {'alpha':'beta' >> >> Only my cursor is to the Left of the final quote. Then I have to go >> hunt the Right Arrow or End key In PyScripter you can just type the closing quote/brace over the aut

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Alan Gauld
On 17/06/13 00:12, Jim Mooney wrote: There is also an active community writing third-party plugins for Vim and this is probably where the bulk of significant new features are developed. So as Dr. Frankenstein exclaimed: "It's Alive!" ;') Vim as a project is very much alive but to be honest I u

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Alan Gauld
On 16/06/13 19:55, Joel Goldstick wrote: I think VIM is somehow a descendent of TECO I think your confusing it with emacs which originally stood for EditingMACroS and was just a set of Teco macros which made it easier to use. Then James Gosling and Richard Stallman got their respective hands

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Jim Mooney
> There is also an active community writing third-party plugins for Vim > and this is probably where the bulk of significant new features are > developed. So as Dr. Frankenstein exclaimed: "It's Alive!" ;') -- Jim After indictment the bacon smuggler was put on the no-fry list ___

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Oscar Benjamin
On 16 June 2013 18:49, Jim Mooney wrote: > Although an editor that's been around since the stone age > probably doesn't blow up. I doubt VIM has a constant stream of > upgrades (not always compatible), bug fixes, and security fixes ;') I use Vim pretty much exclusively and work on Linux and Windo

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Joel Goldstick
On Sun, Jun 16, 2013 at 5:01 PM, pyt...@outofoptions.net < pyt...@outofoptions.net> wrote: > On 06/16/2013 01:49 PM, Jim Mooney wrote: > >> VIM sounds good but I don't think there's a version for Windows. > > There definitely is a windows version Keeping different programs open is great if you ha

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread pyt...@outofoptions.net
On 06/16/2013 01:49 PM, Jim Mooney wrote: VIM sounds good but I don't think there's a version for Windows. Keeping different programs open is great if you have dual monitors, which I did when I was webmastering. Alas, some $#@ fooled with my computer and wiped out the dual monitor card. But whe

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Joel Goldstick
On Sun, Jun 16, 2013 at 2:48 PM, Steve Willoughby wrote: > > On 16-Jun-2013, at 11:35, Steven D'Aprano wrote: > > > On 17/06/13 03:59, Steve Willoughby wrote: > >> > >> On 16-Jun-2013, at 10:49, Jim Mooney wrote: > >> > >>> On 16 June 2013 01:43, Roel Schroeven wrote: > >>> > Can't you di

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steve Willoughby
On 16-Jun-2013, at 11:35, Steven D'Aprano wrote: > On 17/06/13 03:59, Steve Willoughby wrote: >> >> On 16-Jun-2013, at 10:49, Jim Mooney wrote: >> >>> On 16 June 2013 01:43, Roel Schroeven wrote: >>> Can't you disable that behavior somewhere in the settings of your IDE? I know IDE

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steven D'Aprano
On 17/06/13 03:59, Steve Willoughby wrote: On 16-Jun-2013, at 10:49, Jim Mooney wrote: On 16 June 2013 01:43, Roel Schroeven wrote: Can't you disable that behavior somewhere in the settings of your IDE? I know IDEs do that to be helpful, but I don't like it and so far I've been able to dis

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steven D'Aprano
On 17/06/13 03:25, Jim Mooney wrote: On 15 June 2013 23:30, Dave Angel wrote: The sort() method doesn't work, but sorted does. How many times have I read you can't sort a dictionary in Python. Was I just misreading or was that true of older Pythons? You can't sort a dictionary, because dic

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Steve Willoughby
On 16-Jun-2013, at 10:49, Jim Mooney wrote: > On 16 June 2013 01:43, Roel Schroeven wrote: > >> Can't you disable that behavior somewhere in the settings of your IDE? I >> know IDEs do that to be helpful, but I don't like it and so far I've been >> able to disable it in all IDEs I've used. >

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Chris “Kwpolska” Warrick
On Sun, Jun 16, 2013 at 7:25 PM, Jim Mooney wrote: > On 15 June 2013 23:30, Dave Angel wrote: > The sort() method doesn't work, but sorted does. > > How many times have I read you can't sort a dictionary in Python. Was > I just misreading or was that true of older Pythons? Dicts have no ord

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Jim Mooney
On 16 June 2013 01:43, Roel Schroeven wrote: > Can't you disable that behavior somewhere in the settings of your IDE? I > know IDEs do that to be helpful, but I don't like it and so far I've been > able to disable it in all IDEs I've used. PyScripter does in Tools > Options > IDE Options > Edito

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Jim Mooney
On 15 June 2013 23:30, Dave Angel wrote: >>> The sort() method doesn't work, but sorted does. How many times have I read you can't sort a dictionary in Python. Was I just misreading or was that true of older Pythons? -- Jim After indictment the bacon smuggler was put on the no-fry list ___

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Roel Schroeven
Jim Mooney schreef: On 15 June 2013 14:55, Alan Gauld wrote: I think your making it harder than it is. Just use the result as you would expect and it will work. I just meant that since I'm learning I'll create a dictionary on the fly to try something out. All goes well except my IDE will typ

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Dave Angel
On 06/16/2013 01:58 AM, Steven D'Aprano wrote: On 16/06/13 11:53, Dave Angel wrote: On 06/15/2013 08:36 PM, Steven D'Aprano wrote: for key in sorted(mydict.keys()): ... works fine. [...] The sort() method doesn't work, but sorted does. [...] for key in sorted(mydict.keys()): Not o

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Steven D'Aprano
On 16/06/13 11:53, Dave Angel wrote: On 06/15/2013 08:36 PM, Steven D'Aprano wrote: for key in sorted(mydict.keys()): ... works fine. [...] The sort() method doesn't work, but sorted does. [...] for key in sorted(mydict.keys()): Not only that, but sorted works too: for key in sort

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Dave Angel
On 06/15/2013 08:36 PM, Steven D'Aprano wrote: On 16/06/13 07:55, Alan Gauld wrote: On 15/06/13 20:54, Jim Mooney wrote: I just like to avoid typing all those odd little-finger characters. The dictionaries are the worst. I think your making it harder than it is. Just use the result as you wo

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Steven D'Aprano
On 16/06/13 07:55, Alan Gauld wrote: On 15/06/13 20:54, Jim Mooney wrote: I just like to avoid typing all those odd little-finger characters. The dictionaries are the worst. I think your making it harder than it is. Just use the result as you would expect and it will work. Don't get hung up

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Jim Mooney
On 15 June 2013 14:55, Alan Gauld wrote: > I think your making it harder than it is. > Just use the result as you would expect and it will work. I just meant that since I'm learning I'll create a dictionary on the fly to try something out. All goes well except my IDE will type two quotes if I ty

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Alan Gauld
On 15/06/13 20:54, Jim Mooney wrote: I just like to avoid typing all those odd little-finger characters. The dictionaries are the worst. I think your making it harder than it is. Just use the result as you would expect and it will work. Don't get hung up over a list versus an iterable. Just u

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Jim Mooney
On 15 June 2013 12:34, Andreas Perstinger wrote: d = {'a': 1, 'b': 2, 'c': 3, 'd': 4} list(d.keys()) > ['a', 'c', 'b', 'd'] Ah, that simplifies it. I probably read that and forgot it - so little time so much to learn ;') Without you guys the memory-fog would do me in . I just like to

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Jim Mooney
On 15 June 2013 11:51, Chris “Kwpolska” Warrick wrote: > The standard use is: > > for k, v in d.items(): >do_stuff_with_dict_items_here() > Yes, they're easy to get keys = [x for x in d], or vals = [d[x] for x in d] It's just that Python usually does what I expect and presents me w

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Steven D'Aprano
On 16/06/13 04:41, Jim Mooney wrote: When I try to get the keys of a dictionary, such as d.keys(), I get the below instead of a plain list, and it's not very usable. How can I use the keys from this like it was a list, or is this basically useless other than to see the keys or values? *** Python

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Andreas Perstinger
Jim Mooney wrote: >When I try to get the keys of a dictionary, such as d.keys(), I get >the below instead of a plain list, and it's not very usable. How can I >use the keys from this like it was a list, or is this basically >useless other than to see the keys or values? If you really need a list

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Joel Goldstick
On Sat, Jun 15, 2013 at 2:41 PM, Jim Mooney wrote: > When I try to get the keys of a dictionary, such as d.keys(), I get > the below instead of a plain list, and it's not very usable. How can I > use the keys from this like it was a list, or is this basically > useless other than to see the keys o

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Chris “Kwpolska” Warrick
On Sat, Jun 15, 2013 at 8:41 PM, Jim Mooney wrote: > When I try to get the keys of a dictionary, such as d.keys(), I get > the below instead of a plain list, and it's not very usable. How can I > use the keys from this like it was a list, or is this basically > useless other than to see the keys o

[Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Jim Mooney
When I try to get the keys of a dictionary, such as d.keys(), I get the below instead of a plain list, and it's not very usable. How can I use the keys from this like it was a list, or is this basically useless other than to see the keys or values? *** Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 201