Re: How to sort over dictionaries

2018-08-30 Thread harish
> > sort = sorted(results, key=lambda res:itemgetter('date')) > > print(sort) > > > > > > I have tried the above code peter but it was showing error like > > TypeError: '<' not supported between instances of 'operator.itemgetter' > > and 'operator.itemgetter' > > lambda res: itemgetter('

Re: How to sort over dictionaries

2018-08-29 Thread harish
> > > On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote: > >> The top-level object you are showing is a list [], not a dictionary {}. > >> It has dictionaries inside of it though. Do you want to sort the list? > >> > >> Python's sorted() function returns a sorted copy of

How to sort over dictionaries

2018-08-29 Thread harish
[, https://getbootstrap.com/', 'author': 'Hari', 'date': '15-08-2018 15:15', 'headline': 'latest news'}>, , https://www.deps.co/blog/google-cloud-platform-good-bad-ugly/', 'author': 'Harish', 'head

Re: How to sort over dictionaries

2018-08-29 Thread harish
On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote: > The top-level object you are showing is a list [], not a dictionary {}. It > has dictionaries inside of it though. Do you want to sort the list? > > Python's sorted() function returns a sorted copy of a sequence. Sort

Detecting if a library has native dependency

2015-08-15 Thread Harish Vishwanath
Hello Is there a reliable way to detect if a python library has native dependency or native code? For ex. can I programmatically determine that "lxml" package has native code and depends on the presence of libxml on the system? Regards, Harish -- https://mail.python.org/mailman/listi

List insert at index that is well out of range - behaves like append that too SILENTLY

2014-09-15 Thread Harish Tech
raised it in stackoverflow I got chance to look at source and found that's the way code is written . Question : 1. Any idea Why it has been designed to silently handle this instead of at least informing the user with an exception(as in java) or attaching null values in empty places (as in ruby) ?

how to fix python logging to not log to stderr

2014-08-05 Thread harish . chilkoti
I am doing this logging.basiConfig(logleve=Logging.Info) then i create a file log handler and attach to it. i also have propagate as True. My logs are going to the stderr as well. How do i fix so that logs don't go to stdout? -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem when applying Patch from issue1424152 to get https over authenticating proxies working with urllib2 in Python 2.5

2013-12-10 Thread harish . barvekar
On Monday, July 20, 2009 11:28:53 PM UTC+5:30, tvashtar wrote: > On Jul 20, 4:42 pm, Nike wrote: > > hi! > >  It's looks like a ssl error . Under the following step to help u : > >   1. takes a simple code to confirm your pupose without ssl protocol. > >   2. to confirm python version and extended

tkinter import problem

2009-12-19 Thread harish anand
Hi, I have Mandriva 2010.0 in my laptop. I installed python3.1 from the repository. But i am unable to import tkinter in python console. When I try to import tkinter I get the following error, `ImportError : No module named _tkinter` Am I doing something wrong? Thanks, -- http://mail.python.

What is ''r'' in python?

2009-01-06 Thread Harish Vishwanath
File "", line 1 ''c'' ^ SyntaxError: invalid syntax >>> ''z'' File "", line 1 ''z'' ^ SyntaxError: invalid syntax Any other character that way is Invalid Syntax. What is so special about character r enclose within a pair of single quotes? Regards, Harish -- http://mail.python.org/mailman/listinfo/python-list

How to get back a list object from its string representation?

2008-12-30 Thread Harish Vishwanath
Hello, Consider : >>> li = [1,2,3] >>> repr(li) '[1, 2, 3]' Is there a standard way to get back li, from repr(li) ? Regards, Harish -- http://mail.python.org/mailman/listinfo/python-list

Check file is

2008-12-20 Thread Harish
Hi Friends Is there any utility in python which will help me to read any pdf files? Regards Harish -- http://mail.python.org/mailman/listinfo/python-list