Re: [BangPypers] Question on Pattern Matching and Regular Expression

2013-01-07 Thread Dhruv Baldawa
int(group['temperature'])} In [14]: data Out[14]: {'Delhi': {'area': 13000, 'population': 7, 'temperature': 10}, 'Mumbai': {'area': 132000, 'population': 10, 'temperature': 30}} -- Dhruv Baldawa (http://ww

Re: [BangPypers] Question on Pattern Matching and Regular Expression

2013-01-07 Thread Dhruv Baldawa
typecasted the values to int. -- Dhruv Baldawa (http://www.dhruvb.com) On Tue, Jan 8, 2013 at 12:27 AM, Dhruv Baldawa wrote: > regex = """# > #(?P[a-zA-Z]+) > # > Population = (?P\d+)cr > Temperature = (?P\d+) deg cel > Area = (?P\d+) sqft"""

Re: [BangPypers] function parameter query

2013-01-23 Thread Dhruv Baldawa
a': 1, 'b': 2, 'c': 3} def foo(a, b, c): print a, b, c then foo(**d) is equivalent to calling foo(a=1, b=2, c=3) in your test() function above, what you are doing by show(c, **kwargs) is show(c, d=4, e=5) -- Dhruv Baldawa (http://www.dhruvb.com) _

Re: [BangPypers] Interactive shell for python application

2013-01-28 Thread Dhruv Baldawa
, whenever I need such a thing, I just do a: from IPython.core.debugger import Tracer Tracer()() but this will act more like a debugger and you can check values and run python code. -- Dhruv Baldawa (http://www.dhruvb.com) On Mon, Jan 28, 2013 at 8:50 PM, kracekumar ramaraju < kracethekin

Re: [BangPypers] SQLAlchemy and 'non-trivial' default values for a column

2013-02-05 Thread Dhruv Baldawa
print c.consultation_count This way its computed on the fly and you dont need to store it. -- Dhruv Baldawa (http://www.dhruvb.com) On Wed, Feb 6, 2013 at 11:15 AM, Vinod Kumar Narasimhaiah < vinod.narasimha...@gmail.com> wrote: > I am not a python programmer, but how about this l

Re: [BangPypers] SQLAlchemy and 'non-trivial' default values for a column

2013-02-05 Thread Dhruv Baldawa
. Reference<http://docs.sqlalchemy.org/en/rel_0_8/core/schema.html#sqlalchemy.schema.Column.__init__> -- Dhruv Baldawa (http://www.dhruvb.com) On Wed, Feb 6, 2013 at 11:47 AM, Sriram Karra wrote: > On Wed, Feb 6, 2013 at 11:32 AM, Dhruv Baldawa >wrote: > > > I would do a: >

Re: [BangPypers] SQLAlchemy and 'non-trivial' default values for a column

2013-02-11 Thread Dhruv Baldawa
-- Dhruv Baldawa (http://www.dhruvb.com) On Tue, Feb 12, 2013 at 7:13 AM, Sriram Karra wrote: > On Wed, Feb 6, 2013 at 12:05 PM, Dhruv Baldawa >wrote: > > > OK I misread. Let me see if I understood your problem correctly. > > > >1. All the consultations w

Re: [BangPypers] SQLAlchemy and 'non-trivial' default values for a column

2013-02-11 Thread Dhruv Baldawa
try session.query(Consultation).filter_by(), sorry I am actually used to using the above specified syntax because I usually use Flask-SQLAlchemy. -- Dhruv Baldawa (http://www.dhruvb.com) On Tue, Feb 12, 2013 at 11:35 AM, Sriram Karra wrote: > On Tue, Feb 12, 2013 at 9:08 AM, Dhruv Bald

Re: [BangPypers] SQLAlchemy and 'non-trivial' default values for a column

2013-02-11 Thread Dhruv Baldawa
tions can be controlled by an optional command-line argument or environment variable or a flag, its upto you. I run 4 different configurations for my app using command-line arguments. -- Dhruv Baldawa (http://www.dhruvb.com) On Tue, Feb 12, 2013 at 12:05 PM, Sriram Karra wrote: > On Tue, Feb

Re: [BangPypers] Female developer fired after tweeting about men's comments at PyCon 2013 and San Jose.

2013-03-23 Thread Dhruv Baldawa
The headlines are biased and misleading, the event is has been resolved, changes have been made to Code of Conduct. FYI, even one of the male developers was fired. I would suggest you read the following answer. http://www.quora.com/PyCon-Tweet-Controversy-March-2013/Was-it-appropriate-for-SendGrid

Re: [BangPypers] Reorder Dictionary Size in python

2013-04-18 Thread Dhruv Baldawa
http://code.activestate.com/recipes/578375-proof-of-concept-for-a-more-space-efficient-faster/?in=user-178123 -- Dhruv Baldawa (http://www.dhruvb.com) On Thu, Apr 18, 2013 at 2:31 PM, Rahul R wrote: > Afaik, python gc is threshold based. So, gc should trigger after a given > threshold

Re: [BangPypers] Code Extractor in Python

2013-06-12 Thread Dhruv Baldawa
return [nodes.raw('', self.CODE.format( script_contents, ), format='html')] directives.register_directive('image-link', ImageLinkBlock) -- Dhruv Baldawa (http://www.dhruvb.com) On Thu, Jun 13, 2013 at 8:57 AM, Gopalakrishnan Subramani < gopalakrishna

Re: [BangPypers] regarding python

2013-06-19 Thread Dhruv Baldawa
Similar thread on Mumpy group here: https://groups.google.com/forum/#!msg/mumpy/La6I425d8vI/EK3OZPIvygYJ -- Dhruv Baldawa (http://www.dhruvb.com) On Wed, Jun 19, 2013 at 11:58 AM, ashish makani wrote: > I would highly recommend Mark Pilgrim's 'Dive Into Python' ebook

Re: [BangPypers] regarding python

2013-06-20 Thread Dhruv Baldawa
-- Dhruv Baldawa (http://www.dhruvb.com) On Thu, Jun 20, 2013 at 12:36 PM, Vivek Puri wrote: > Hi, > > Please let me know best IDE for python development.. as beginner i am >> writing as Shell scripts. >> > Best IDE is matter of familiarity and personal pr

Re: [BangPypers] regarding python

2013-06-20 Thread Dhruv Baldawa
-- Dhruv Baldawa (http://www.dhruvb.com) On Fri, Jun 21, 2013 at 10:57 AM, स्वक्ष wrote: > On Thu, Jun 20, 2013 at 7:18 AM, Dhruv Baldawa > wrote: > > -- > > Dhruv Baldawa > > (http://www.dhruvb.com) > > > > > > On Thu, Jun 20, 2013 at

Re: [BangPypers] Feedspot Giveaway: Bangpypers get free subscription to Feedspot - A Google Reader+Google Alerts Replacement

2013-08-24 Thread Dhruv Baldawa
I got a personalized mail with a personalized discount code. -- Dhruv Baldawa (http://www.dhruvb.com) On Sat, Aug 24, 2013 at 9:57 PM, Bibhas Ch Debnath wrote: > He sent the same mail to KolPy mailing list. He's sending it everywhere it > seems. > > > Best Regar

Re: [BangPypers] [gsoc-india] Re: A BoF session about Google Summer of Code at PyConIndia tomorrow

2013-09-02 Thread Dhruv Baldawa
Hi, It was awesome meeting everyone at PyCon. Sarup, can you make the spreadsheet you created earlier public ? Everyone can add/update their details accordingly. -- Dhruv Baldawa (http://www.dhruvb.com) On Mon, Sep 2, 2013 at 5:09 PM, Anuj Deshpande wrote: > Could we have the group ph

Re: [BangPypers] Debugging functions/tools/ways

2013-09-13 Thread Dhruv Baldawa
This is what I use for debugging: from IPython.core.debugger import Tracer; Tracer()() works mostly like pdb, with some nice features like tab completions -- Dhruv Baldawa (http://www.dhruvb.com) On Fri, Sep 13, 2013 at 1:34 PM, Saju M wrote: > Hi, > > What are the functions/tools

Re: [BangPypers] need help w.r.t itertools

2013-09-13 Thread Dhruv Baldawa
d = [''.join(x) for x in itertools.product(a, b, c)] -- Dhruv Baldawa (http://www.dhruvb.com) On Fri, Sep 13, 2013 at 4:53 PM, Suyash Bhatt wrote: > Hi all, > > i need help in finding the most optimized way of making a list using > itertools. > > Suppose I have

Re: [BangPypers] Functional testing wih headless browser framework

2013-09-17 Thread Dhruv Baldawa
I have tried setting up PhantomJS, Selenium earlier, but I found ZombieJS<http://zombie.labnotes.org/>far more lightweight and fast in terms of test execution. Some sample test code: https://github.com/dhruvbaldawa/drophere/blob/master/test/test_client.coffee -- Dhruv Baldawa

Re: [BangPypers] What are you using for developing desktop GUIs?

2013-09-26 Thread Dhruv Baldawa
Take a look at PySide? -- Sent from mobile On Sep 27, 2013 9:24 AM, "Noufal Ibrahim" wrote: > Shabda Raaj writes: > > > I am building my first desktop app with Python and I would like to get > > recommendation on what toolkit to use. > > > > I am planning to use either PyGTK or PyQT. > > (Are t

Re: [BangPypers] What are you using for developing desktop GUIs?

2013-09-27 Thread Dhruv Baldawa
Speaking of embedded web apps, https://en.wikipedia.org/wiki/Chromium_Embedded_Framework https://code.google.com/p/chromiumembedded/ -- Dhruv Baldawa (http://www.dhruvb.com) On Fri, Sep 27, 2013 at 7:35 PM, Noufal Ibrahim wrote: > Sriram Karra writes: > > > [...] > > >

Re: [BangPypers] Getting a random record from Database . The best strategy.

2013-10-04 Thread Dhruv Baldawa
not tested the code myself though. -- Dhruv Baldawa (http://www.dhruvb.com) On Thu, Oct 3, 2013 at 10:11 PM, Amit Sethi wrote: > Hi , I am not sure if this question will be considered sufficiently > python related. If its not than I am sorry I will take this somewhere > else > >

Re: [BangPypers] Noob trying to get into python

2013-10-07 Thread Dhruv Baldawa
I started off with solving Project Euler <http://www.projecteuler.net>problems when I first started learning Python (after reading few books on Python). Also have a look at: http://net.tutsplus.com/tutorials/the-best-way-to-learn-python/ -- Dhruv Baldawa (http://www.dhruvb.com) On Mon,

Re: [BangPypers] Object Oriented Programming in python

2013-10-15 Thread Dhruv Baldawa
Also take a look at videos by Raymond Hettinger http://pyvideo.org/speaker/138/raymond-hettinger -- Dhruv Baldawa (http://www.dhruvb.com) On Tue, Oct 15, 2013 at 1:58 PM, T S KAMATH wrote: > Dear Pranav, > > The following video would get you understand better > http://www.sagem

Re: [BangPypers] Best python source browsing tool for Mac + Emacs / Sublime

2013-12-30 Thread Dhruv Baldawa
-- Dhruv Baldawa (http://www.dhruvb.com) On Mon, Dec 30, 2013 at 5:15 PM, ashish makani wrote: > I personally use sublime text > http://www.sublimetext.com/3 > > I use Sublime with Anaconda (https://sublime.wbond.net/packages/Anaconda). PyCharm is also great. > Some of my f

Re: [BangPypers] JSON PARSER (Rajiv)

2014-03-21 Thread Dhruv Baldawa
0 > > From: Jayanth Koushik > > To: lokesh bobby , Bangalore Python Users > > Group - India > > Subject: Re: [BangPypers] JSON PARSER > > Message-ID: > > < > > ca+peiejf+vhmxvch5ef6opvc5mbavxz5weodnz2hugq_-nt...@mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hi Lokesh > > > > The 'problem' that you talk about isn't really a problem. Since the JSON > > specification does not say what is to be done for repeated names, it is > up > > to the implementation to decide. What is your requirement for handling > > repeated names? > > > > Jayanth > > > > > > On Fri, Mar 21, 2014 at 2:30 PM, lokesh bobby > >wrote: > > > > > Hi Noufal, > > > > > > Thanks for your reply. I am not looking for loading the JSON file. > There > > > is a limitation in it. Go thru the links > > > > > > > > > http://docs.python.org/2/library/json.html#repeated-names-within-an-object > > > > > > > > > http://docs.python.org/3.2/library/json.html#repeated-names-within-an-object > > > > > > In order to get rid of that problem, I am looking for some JSON stream > > > parsers. > > > > > > Thanks, > > > Lokesh. > > > > > > > > > > > > On Friday, 21 March 2014 2:09 PM, Noufal Ibrahim KV < > > > nou...@nibrahim.net.in> wrote: > > > > > > On Fri, Mar 21 2014, lokesh bobby wrote: > > > > > > > > > > Hi ALL, > > > > > > > > Can you share your thoughts on how to parse a JSON file by using > > > > python? > > > > > > import json > > > > > > with open("data.json") as f: > > > json.load(f) > > > > > > > > > [...] > > > > > > > > > -- > > > Cordially, > > > Noufal > > > http://nibrahim.net.in > > > ___ > > > BangPypers mailing list > > > BangPypers@python.org > > > https://mail.python.org/mailman/listinfo/bangpypers > > > > > > > > > -- > > > > Subject: Digest Footer > > > > ___ > > BangPypers mailing list > > BangPypers@python.org > > https://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > > > > End of BangPypers Digest, Vol 79, Issue 8 > > * > > > > > > -- > Rajiv M > Software Engineer. > > *DoubleSpring Media (P) Ltd.* #15/1 Robertson Road, Frazer Town, > Bangalore 05, IND. > Office: +91-80-40917126, Mobile: +91 7411 129611, Skype: > rajiv.m1991<http://lightness-rejoice.rhcloud.com>, > Web: www.doublespring.com. > > <http://twitter.com/rajivm1991> <http://facebook.com/rajivm1991> > ___ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/bangpypers > -- Dhruv Baldawa (http://www.dhruvb.com) ___ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] how to override sys.stdin

2014-08-04 Thread Dhruv Baldawa
On Mon, Aug 4, 2014 at 2:38 PM, Nitin Kumar wrote: > def readline(self): > print 'from fn readline',var > Where are you getting 'var' from? Shouldn't the method read as def readline(self, var)? -- Dh

Re: [BangPypers] Rest API testing tool

2014-12-09 Thread Dhruv Baldawa
> https://mail.python.org/mailman/listinfo/bangpypers > -- Dhruv Baldawa (http://www.dhruvb.com) ___ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] How to dynamically load modules in Django/Python

2014-12-17 Thread Dhruv Baldawa
; Thanks > Amit > ___ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/bangpypers > -- Dhruv Baldawa (http://www.dhruvb.com) ___ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] Planning a startup hiring hackathon in Mumbai

2014-12-21 Thread Dhruv Baldawa
ral) please reply to me 1-1. > > Thanks > Parul > > > SlideRule <http://mysliderule.com/>: Learn something new > ___ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/li

Re: [BangPypers] UI less Rest API server with flask

2015-06-22 Thread Dhruv Baldawa
_ > > BangPypers mailing list > > BangPypers@python.org > > https://mail.python.org/mailman/listinfo/bangpypers > > > ___ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/b