Re: [BangPypers] Favorite tips/techniques

2013-09-12 Thread Noufal Ibrahim
I often type this x = "Break this into a list".split() instead of x = ["Break", "this", "into", "a", "list"] The latter is more tedious to type. -- Cordially, Noufal http://nibrahim.net.in ___ BangPypers mailing list BangPypers@python.org https:/

Re: [BangPypers] Favorite tips/techniques

2013-09-12 Thread L Radhakrishna Rao
Not so complex, but the technique which I love is the comprehension, it decreases the code size. On Fri, Sep 13, 2013 at 8:25 AM, Noufal Ibrahim wrote: > Saager Mhatre writes: > > > On Tue, Sep 10, 2013 at 4:54 PM, Noufal Ibrahim >wrote: > > > >> Saju M writes: > >> [...] > >> > > > >> > * Wh

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Dhananjay Nene
On Fri, Sep 13, 2013 at 12:38 AM, Saager Mhatre wrote: > On Thu, Sep 12, 2013 at 6:30 PM, Abdul Muneer wrote: > >> I also pin requirements. But when I do 'pip freeze', I remove the packages >> that are installed as a dependency to main libraries which were explicitly >> installed. >> > > I tend t

Re: [BangPypers] Python "Wat"s

2013-09-12 Thread Dhananjay Nene
On Thu, Sep 12, 2013 at 11:22 PM, Shabda Raaj wrote: >> whole qx business than Python programmers are with os and subprocess. > > That because subprocess and os module have a very bad api. I prefer using > envoy whenevr I can. > > https://github.com/kennethreitz/envoy Interesting. Haven't worked

Re: [BangPypers] Favorite tips/techniques

2013-09-12 Thread Noufal Ibrahim
Saager Mhatre writes: > On Tue, Sep 10, 2013 at 4:54 PM, Noufal Ibrahim wrote: > >> Saju M writes: >> [...] >> > >> > * Why dir(json) not showing "tool" ?? >> >> Because of the __all__ variable in the module. >> http://docs.python.org/2/tutorial/modules.html >> > > Noufal, > Well, not quite, rig

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Saager Mhatre
On Thu, Sep 12, 2013 at 6:16 PM, Aditya Laghate wrote: > On Thu, Sep 12, 2013 at 05:50:27PM +0530, Vineet Naik wrote: > > I always pin requirements. Here is a related article on the topic - > > http://nvie.com/posts/pin-your-packages/ > > Interesting blog link. > > I did like the idea of using '==

[BangPypers] Python "Wat"s

2013-09-12 Thread Shabda Raaj
> whole qx business than Python programmers are with os and subprocess. That because subprocess and os module have a very bad api. I prefer using envoy whenevr I can. https://github.com/kennethreitz/envoy -- Thanks, Shabda Agiliq.com - Building Amazing Apps agiliq.com/blog/ | github.com/agiliq

Re: [BangPypers] Help Required with understanding Python Import

2013-09-12 Thread Saager Mhatre
On Tue, Sep 10, 2013 at 3:39 PM, konark modi wrote: > Hi Jagan, > > This should be of your interest : > http://pyvideo.org/video/1707/how-import-works Jagan, This makes for an interesting read too => http://lucumr.pocoo.org/2009/7/24/singletons-and-their-problems-in-python/ - d __

Re: [BangPypers] Favorite tips/techniques

2013-09-12 Thread Saager Mhatre
On Tue, Sep 10, 2013 at 4:54 PM, Noufal Ibrahim wrote: > Saju M writes: > [...] > > > * Why dir(json) not showing "tool" ?? > > Because of the __all__ variable in the module. > http://docs.python.org/2/tutorial/modules.html > Noufal, Well, not quite, right? I posit it's basically because as per

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Saager Mhatre
On Thu, Sep 12, 2013 at 6:30 PM, Abdul Muneer wrote: > I also pin requirements. But when I do 'pip freeze', I remove the packages > that are installed as a dependency to main libraries which were explicitly > installed. > I tend to avoid using 'pip freeze' as part of my dev flow for just this re

Re: [BangPypers] How to run a block of code just before the interpreter is being exited like END{} in perl ??

2013-09-12 Thread Saager Mhatre
On Mon, Sep 9, 2013 at 7:23 PM, Anand B Pillai wrote: > [...] > > I gave that example as it was given in the Python documentation > for atexit module. > > http://docs.python.org/2/library/atexit.html#module-atexit Wow, hadn't noticed that the example was in the docs. Still, doesn't make too muc

Re: [BangPypers] Favorite tips/techniques

2013-09-12 Thread Saager Mhatre
On Tue, Sep 10, 2013 at 10:39 AM, Shabda Raaj wrote: > > https://github.com/webpy/webpy/blob/master/web/utils.py#L52 > > Wow, thats better than the "bare" bunch impl. Gonna use it now. It's just s much nicer when the map/dict in your platform

Re: [BangPypers] Python "Wat"s

2013-09-12 Thread Saager Mhatre
On Tue, Sep 10, 2013 at 10:14 AM, Shabda Raaj wrote: > This is a popular talk on quircks of ruby/js > > https://www.destroyallsoftware.com/talks/wat > > What are the quircks/unexpected behavior you find in Python? (Aka Python > "wats"). > Wait a second... wasn't there a talk about just this capt

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Abdul Muneer
I also pin requirements. But when I do 'pip freeze', I remove the packages that are installed as a dependency to main libraries which were explicitly installed. Packages from pypi may specify dependency as ">=" and it will fetch the latest. But if you had pinned those too, it can cause conflicts e

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Aditya Laghate
On Thu, Sep 12, 2013 at 05:50:27PM +0530, Vineet Naik wrote: > I always pin requirements. Here is a related article on the topic - > http://nvie.com/posts/pin-your-packages/ Interesting blog link. I did like the idea of using '==' instead of '>=' ___ Ba

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Vineet Naik
I always pin requirements. Here is a related article on the topic - http://nvie.com/posts/pin-your-packages/ On Thu, Sep 12, 2013 at 5:45 PM, BibhasD wrote: > Quick googling suggests pinning = specifying versions. > > I do it. I think that makes more sense if you're depending on 3rd party > pac

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread BibhasD
Quick googling suggests pinning = specifying versions. I do it. I think that makes more sense if you're depending on 3rd party packages. -- Bibhas On Thursday 12 September 2013 05:41 PM, Baishampayan Ghose wrote: > What do you mean by "pin"? ~BG > > On Thu, Sep 12, 2013 at 5:37 PM, Shabda Raaj

Re: [BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Baishampayan Ghose
What do you mean by "pin"? ~BG On Thu, Sep 12, 2013 at 5:37 PM, Shabda Raaj wrote: > Curious how many people are doing/not doing it. > > (We pin our requirements.txt). > > -- > Thanks, > Shabda > > Agiliq.com - Building Amazing Apps > agiliq.com/blog/ | github.com/agiliq > US: +13152854388 | IN:

[BangPypers] Do you pin your requirements.txt ?

2013-09-12 Thread Shabda Raaj
Curious how many people are doing/not doing it. (We pin our requirements.txt). -- Thanks, Shabda Agiliq.com - Building Amazing Apps agiliq.com/blog/ | github.com/agiliq US: +13152854388 | IN: +919949997612 | Skype: shabda.raaj Our Android Apps