Re: problem with sorting

2008-03-27 Thread jwelby
On Mar 28, 5:38 am, [EMAIL PROTECTED] wrote: > >>> dict = {'M':3, 'R':0, 'S':2} > >>> print dict > > {'S': 2, 'R': 0, 'M': 3} > > now if I wanted sorted values in list, i am not able to do this>>> print > dict.values().sort() > > None > > it returns None instead of [0, 2, 3] The sort method works

Re: Looking for a good Python environment

2007-11-10 Thread jwelby
On Nov 7, 12:42 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > jwelby wrote: ... > > > I currently use Python Scripter as a lightweight editor for Windows. > > Could you elaborate on "lightweight" > please? I find PyScripter to be a &

Re: Looking for a good Python environment

2007-11-07 Thread jwelby
On Nov 6, 10:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey, I'm looking for a good Python environment. That is, at least an > editor and a debugger, and it should run on Windows. Does anyone have > any idea? I currently use Python Scripter as a lightweight editor for Windows. For pr

Re: python on window

2007-03-23 Thread jwelby
That should have been: "You should be able edit your PYTHONPATH variable (should you need to)..." Gabiel is right, it's not usually required. -- http://mail.python.org/mailman/listinfo/python-list

Re: python on window

2007-03-23 Thread jwelby
On Mar 23, 7:25 am, "sandeep patil" <[EMAIL PROTECTED]> wrote: > i have install python on window xp os. > C:/program files/python > > i have done print program it working but .py can't working > help me to how i will execute this file this file where i will save > it. > path execution how . > te

Re: returning index of minimum in a list of lists

2006-06-21 Thread jwelby
def minIndexFinder(seq): mins = [] listIndex = 0 result = [] for item in seq: mins.append([listIndex,min(item),item.index(min(item))]) listIndex += 1 lowest = min([x[1] for x in mins]) for item in mins:

Re: Need help removing list elements.

2006-04-29 Thread jwelby
Ooops! Looking at your example a bit closer, change the 'and' in the list comprehension I posted to 'or', and it should do what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help removing list elements.

2006-04-29 Thread jwelby
This looks like a job for list comprehensions: >>> returned_lines= ['Name: John, Value: 12','We don't want this one.','Name: >>> Eric, Value: 24'] >>> [x for x in returned_lines if ('Name' in x and 'Value' in x)] ['Name: John, Value: 12', 'Name: Eric, Value: 24'] List comprehensions are great. I