From anandology at gmail.com Mon Aug 1 02:38:24 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 06:08:24 +0530 Subject: [BangPypers] parsing xml In-Reply-To: References: <1311846517.1742.73.camel@xlquest.web> Message-ID: > Hang around in #django or #python. The most elegant code that you *should* > write would invariably be pretty fast (am not ref to asm). That doesn't mean that any code that is faster is elegant. IIRC, in python, map function runs slightly faster than list comprehensions, but list comprehensions is considered elegant. Anand From abpillai at gmail.com Mon Aug 1 07:56:19 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 11:26:19 +0530 Subject: [BangPypers] parsing xml In-Reply-To: References: <1311846517.1742.73.camel@xlquest.web> Message-ID: On Mon, Aug 1, 2011 at 6:08 AM, Anand Chitipothu wrote: > > Hang around in #django or #python. The most elegant code that you > *should* > > write would invariably be pretty fast (am not ref to asm). > > That doesn't mean that any code that is faster is elegant. > > IIRC, in python, map function runs slightly faster than list > comprehensions, but list comprehensions is considered elegant. > It is more subtler than that. List comprehensions are faster than map functions when the latter needs to invoke a user-defined function call or a lambda. Maps score over list comprehensions in most cases where the function is a Python built-in and when no lambda is used. Example of former: >>> def f1(): map(sqr, range(1, 100)) ... >>> def f2(): [sqr(x) for x in range(1, 100)] ... >>> mytimeit.Timeit(f1) '37.91 usec/pass' >>> mytimeit.Timeit(f2) '37.50 usec/pass' Example of latter: >>> def f1(): map(hex, range(1, 100)) ... >>> def f2(): [hex(x) for x in range(1, 100)] ... >>> mytimeit.Timeit(f1) '49.41 usec/pass' >>> mytimeit.Timeit(f2) '55.29 usec/pass' > > Anand > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From lawgon at gmail.com Mon Aug 1 08:24:45 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Mon, 01 Aug 2011 11:54:45 +0530 Subject: [BangPypers] parsing xml In-Reply-To: References: <1311846517.1742.73.camel@xlquest.web> <1311849103.1742.74.camel@xlquest.web> <87y5zheibg.fsf@sanitarium.localdomain> <87d3gteg24.fsf@sanitarium.localdomain> <87fwlpcwtk.fsf@sanitarium.localdomain> Message-ID: <1312179888.14046.4.camel@xlquest.web> On Sun, 2011-07-31 at 19:57 +0530, Anand Balachandran Pillai wrote: > > xml parsing in the case when all that you need from the string is a > simple > > numeric value(not a string), then good luck; unlike esr i will not > use > > adjectives; but i would not use your code either. > > > > To be fair here, I think what he is saying is that Kenneth's problem > (getting > at the particular value) can be solved by using an aptly written > regular > expression which might be the fastest - not in terms of CPU cycles > alone, > but in terms of time to code it up - solution. right now I need one value - but that will probably change. -- regards Kenneth Gonsalves From abpillai at gmail.com Mon Aug 1 08:38:41 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 12:08:41 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > What if I have two lists for both minimum and maximum values > > Minimum Maximum > 0 10 > 11 20 > 21 30 > 31 40 > > > Now how should I check if actual result is not laying between above ranges > > if not minimum<=actual_result and not maximum>=actual_result: > > Any suggestions? > > Use zip. >>> minl=(0,11,21,31) >>> maxl=(10,20,30,40) >>> x = 5 >>> for r in zip(minl, maxl): ... if x in range(r[0], r[1]): print 'Found in range',r ... Found in range (0, 10) > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From dhananjay.nene at gmail.com Mon Aug 1 09:48:31 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 13:18:31 +0530 Subject: [BangPypers] parsing xml In-Reply-To: <878vreqn55.fsf@sanitarium.localdomain> References: <1311846517.1742.73.camel@xlquest.web> <878vreqn55.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 12:43 AM, Noufal Ibrahim wrote: > Dhananjay Nene writes: > > > [...] > > > re.search("\s*(\d+)\s*",data).group(1) > > > > would appear to be the most succinct and quite fast. Adjust for > whitespace > > as and if necessary. > > Whitespace (including newlines), mixed cases etc. > > Actually newlines are handled in the regex above. (so no longer sure why I even mentioned it), XML (assuming it is as per spec) is not mixed case. > [...] > > > As far as optimisation goes - I can see at least 3 options > > > > a. the minidom performance is acceptable - no further optimisation > required > > b. minidom performance is not acceptable - try the regex one > > c. python library performance is not acceptable - switch to 'c' > > I'd switch b and c. If elementree is not fast enough, I'd switch to > celementree and if that's not fast enough, I'd try some hand parsing. > +1 Dhananjay From jace at pobox.com Mon Aug 1 09:55:40 2011 From: jace at pobox.com (Kiran Jonnalagadda) Date: Mon, 1 Aug 2011 13:25:40 +0530 Subject: [BangPypers] parsing xml In-Reply-To: References: <1311846517.1742.73.camel@xlquest.web> Message-ID: <752B4147-6775-40AB-BF9B-B54F4F5CE607@pobox.com> On 31-Jul-2011, at 11:33 PM, Venkatraman S wrote: > A regex is the simplest IMHO, because you need not know the syntax of the > minidom parser. > But, again i have seen this quiet often that lack of knowledge of regexp has > led people to other solutions (the grapes are sour!) In the eternal words of Jamie Zawinski: """ Some people, when confronted with a problem, think ?I know, I'll use regular expressions.? Now they have two problems. """ http://regex.info/blog/2006-09-15/247 Please resist the temptation to use regexps for XML, for down that path lies only pain. It always starts with "oh, only one token? Let me use a regex and get done with it," and soon enough you have a little forest of random-looking characters. Kiran -- Kiran Jonnalagadda http://jace.zaiki.in/ http://hasgeek.in/ From dhananjay.nene at gmail.com Mon Aug 1 09:59:51 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 13:29:51 +0530 Subject: [BangPypers] #lazyweb - How would the wsgi lite proposal help in .. Message-ID: After Armin Ronacher's post http://lucumr.pocoo.org/2011/7/27/the-pluggable-pipedream/ P. J. Eby responded with http://dirtsimple.org/2011/07/wsgi-is-dead-long-live-wsgi-lite.html with an implementation at https://bitbucket.org/pje/wsgi_lite/ While I could potentially read up the details and find the answers - wondering if I can lazily wait to find their way into my inbox :) How could the above proposal (if it does) help in a) Creating simpler, lighter frameworks (eg. flask) b) Help support greater asynchronicity (a la tornado, node.js etc.) Dhananjay -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From abpillai at gmail.com Mon Aug 1 10:13:26 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 13:43:26 +0530 Subject: [BangPypers] parsing xml In-Reply-To: <752B4147-6775-40AB-BF9B-B54F4F5CE607@pobox.com> References: <1311846517.1742.73.camel@xlquest.web> <752B4147-6775-40AB-BF9B-B54F4F5CE607@pobox.com> Message-ID: On Mon, Aug 1, 2011 at 1:25 PM, Kiran Jonnalagadda wrote: > On 31-Jul-2011, at 11:33 PM, Venkatraman S wrote: > > > A regex is the simplest IMHO, because you need not know the syntax of the > > minidom parser. > > But, again i have seen this quiet often that lack of knowledge of regexp > has > > led people to other solutions (the grapes are sour!) > > In the eternal words of Jamie Zawinski: > > """ > Some people, when confronted with a problem, think > ?I know, I'll use regular expressions.? Now they have two problems. > """ > > http://regex.info/blog/2006-09-15/247 > I had fun reading the following "quotes" :) ?Give a man a regular expression and he?ll match a string? teach him to make his own regular expressions and you?ve got a man with problems.? ?me_da_clever_one ?Give a man a regular expression and he?ll match a string? but by teaching him how to create them, you?ve given him enough rope to hang himself? ? Andy Hood > > Please resist the temptation to use regexps for XML, for down that path > lies only pain. It always starts with "oh, only one token? Let me use a > regex and get done with it," and soon enough you have a little forest of > random-looking characters. > Using regular expression to parse XML converts what is inherently hierarchical data to linear, flat data. Therein lies all its problems. > > Kiran > > -- > Kiran Jonnalagadda > http://jace.zaiki.in/ > http://hasgeek.in/ > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From smrutilekha at gmail.com Mon Aug 1 10:25:20 2011 From: smrutilekha at gmail.com (Smrutilekha Swain) Date: Mon, 1 Aug 2011 13:55:20 +0530 Subject: [BangPypers] parsing xml In-Reply-To: References: <1311846517.1742.73.camel@xlquest.web> <752B4147-6775-40AB-BF9B-B54F4F5CE607@pobox.com> Message-ID: by using lxml...for example-: from lxml import etree content = etree.iterparse( *name of the xml file*, events=('start', 'end')) for event, elem in content: if elem.tag == 'distance': print elem.text Hope it will work.................. On Mon, Aug 1, 2011 at 1:43 PM, Anand Balachandran Pillai < abpillai at gmail.com> wrote: > On Mon, Aug 1, 2011 at 1:25 PM, Kiran Jonnalagadda wrote: > > > On 31-Jul-2011, at 11:33 PM, Venkatraman S wrote: > > > > > A regex is the simplest IMHO, because you need not know the syntax of > the > > > minidom parser. > > > But, again i have seen this quiet often that lack of knowledge of > regexp > > has > > > led people to other solutions (the grapes are sour!) > > > > In the eternal words of Jamie Zawinski: > > > > """ > > Some people, when confronted with a problem, think > > ?I know, I'll use regular expressions.? Now they have two problems. > > """ > > > > http://regex.info/blog/2006-09-15/247 > > > > I had fun reading the following "quotes" :) > > ?Give a man a regular expression and he?ll match a string? > teach him to make his own regular expressions and you?ve got a man with > problems.? > ?me_da_clever_one > > ?Give a man a regular expression and he?ll match a string? but by teaching > him how to create them, you?ve given him enough rope to hang himself? ? > Andy > Hood > > > > > > Please resist the temptation to use regexps for XML, for down that path > > lies only pain. It always starts with "oh, only one token? Let me use a > > regex and get done with it," and soon enough you have a little forest of > > random-looking characters. > > > > Using regular expression to parse XML converts what is inherently > hierarchical data to linear, flat data. Therein lies all its problems. > > > > > > Kiran > > > > -- > > Kiran Jonnalagadda > > http://jace.zaiki.in/ > > http://hasgeek.in/ > > > > > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > --Anand > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dhananjay.nene at gmail.com Mon Aug 1 10:36:35 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 14:06:35 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > What if I have two lists for both minimum and maximum values > > Minimum ?Maximum > 0 ? ? ? ? ? ? ? 10 > 11 ? ? ? ? ? ? ?20 > 21 ? ? ? ? ? ? ?30 > 31 ? ? ? ? ? ? ?40 > > > Now how should I check if actual result is not laying between above ranges > > if not minimum<=actual_result and ?not maximum>=actual_result: > > Any suggestions? def in_range(number) : return any(map(lambda (x,y) : x <= number <= y, ((0,10),(11,20), (21,30), (31,40)))) assert in_range(-5) == False assert in_range(0) == True assert in_range(5) == True assert in_range(10) == True assert in_range(10.5) == False assert in_range(11) == True assert in_range(40) == True assert in_range(41) == False If the above test cases (asserts) don't match your expectations, the code may need to be changed correspondingly. From rajeev.sebastian at gmail.com Mon Aug 1 10:38:32 2011 From: rajeev.sebastian at gmail.com (Rajeev J Sebastian) Date: Mon, 1 Aug 2011 14:08:32 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 12:08 PM, Anand Balachandran Pillai wrote: > On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > >> What if I have two lists for both minimum and maximum values >> >> Minimum ?Maximum >> 0 ? ? ? ? ? ? ? 10 >> 11 ? ? ? ? ? ? ?20 >> 21 ? ? ? ? ? ? ?30 >> 31 ? ? ? ? ? ? ?40 >> >> >> Now how should I check if actual result is not laying between above ranges >> >> if not minimum<=actual_result and ?not maximum>=actual_result: >> >> Any suggestions? >> >> > Use zip. > >>>> minl=(0,11,21,31) >>>> maxl=(10,20,30,40) >>>> x = 5 >>>> for r in zip(minl, maxl): > ... ? ? if x in range(r[0], r[1]): print 'Found in range',r flag = False for min, max in zip(minl, maxl): if min <= x <= max: flag = True return not flag From dhananjay.nene at gmail.com Mon Aug 1 11:34:42 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 15:04:42 +0530 Subject: [BangPypers] parsing xml In-Reply-To: <8739hmqn0p.fsf@sanitarium.localdomain> References: <1311846517.1742.73.camel@xlquest.web> <8739hmqn0p.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 12:46 AM, Noufal Ibrahim wrote: > Venkatraman S writes: > > >> Hang around in #django or #python. The most elegant code that you >> *should* write would invariably be pretty fast (am not ref to asm). > > I agree with you here. Pythonicity is best defined as what the > experienced python core devs do and the stuff they use the most is > optimised a lot. Pythonic python code is often the fastest python code. This is one aspect of python that I am not a fan of. Because being pythonic conflates the idioms for expression and idioms for performance. There are situations when the needs of performance overshadow the needs of expression. As an example creating classes with attributes - and setting them is more expensive than creating a dict, and writing a bigger block of sequential code is preferable (again due to performance considerations) rather than breaking it into multiple functions and especially when calling functions along with map, filter, reduce or other itertool constructs (as opposed to say list comprehensions). Other languages also have situations where one has to do such tradeoffs, but these are more in python, and especially alternative styles of expression imo get buried under the label pythonic. So yes there is a lot of importance associated with what is pythonic, but I would've felt more comfortable if these were influence by expression, rather than performance. Dhananjay From anandology at gmail.com Mon Aug 1 12:47:31 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 16:17:31 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: 2011/8/1 Dhananjay Nene : > On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: >> What if I have two lists for both minimum and maximum values >> >> Minimum ?Maximum >> 0 ? ? ? ? ? ? ? 10 >> 11 ? ? ? ? ? ? ?20 >> 21 ? ? ? ? ? ? ?30 >> 31 ? ? ? ? ? ? ?40 >> >> >> Now how should I check if actual result is not laying between above ranges >> >> if not minimum<=actual_result and ?not maximum>=actual_result: >> >> Any suggestions? > > def in_range(number) : > ? ?return any(map(lambda (x,y) : x <= number <= y, > ? ? ? ? ? ? ? ? ?((0,10),(11,20), (21,30), (31,40)))) How about this? def in_range(number, min_max_pairs): return any(x <= number <=y for x, y in min_max_pairs) List comprehensions and generation expressions are usually more readable and expressive than using map. Anand From dhananjay.nene at gmail.com Mon Aug 1 13:08:59 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 16:38:59 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : >> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: >>> What if I have two lists for both minimum and maximum values >>> >>> Minimum ?Maximum >>> 0 ? ? ? ? ? ? ? 10 >>> 11 ? ? ? ? ? ? ?20 >>> 21 ? ? ? ? ? ? ?30 >>> 31 ? ? ? ? ? ? ?40 >>> >>> >>> Now how should I check if actual result is not laying between above ranges >>> >>> if not minimum<=actual_result and ?not maximum>=actual_result: >>> >>> Any suggestions? >> >> def in_range(number) : >> ? ?return any(map(lambda (x,y) : x <= number <= y, >> ? ? ? ? ? ? ? ? ?((0,10),(11,20), (21,30), (31,40)))) > > How about this? > > def in_range(number, min_max_pairs): > ? ?return any(x <= number <=y for x, y in min_max_pairs) Definitely better > > List comprehensions and generation expressions are usually more > readable and expressive than using map. Thats probably truer for the python and python trained eyes than any other (in other words its both subjective and contextual and a bit to do with syntax). Allow me to illustrate : If I want to double all elements in a list and then increment them by one, here's how I would use a map in python def double(x) : return x * 2 def increment(x) : return x + 1 print map(increment,map(double,range(5))) and here's how I would do it in scala - notice the last (third) line and consider its readability (I'm sure a scala non-novice will offer something even superior) def double(n: Int) = n * 2 def increment(n: Int) = n + 1 println(0 to 4 map double map increment) so readability is often a function of what one's eyes are trained ot read and also the syntactic capabilities in the language I also find map much more atomic and portable construct to think in - after all every list comprehension is syntactic sugar around map + filter, and map/reduce/filter are far more omnipresent than list comprehensions. From b.ghose at gmail.com Mon Aug 1 13:11:32 2011 From: b.ghose at gmail.com (Baishampayan Ghose) Date: Mon, 1 Aug 2011 16:41:32 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene wrote: > I also find map much more atomic and portable construct to think in - > after all every list comprehension is syntactic sugar around map + > filter, and map/reduce/filter are far more omnipresent than list > comprehensions. The above will especially make sense to someone who programs in multiple programming languages in his day job. Regards, BG -- Baishampayan Ghose b.ghose at gmail.com From anandology at gmail.com Mon Aug 1 13:37:53 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 17:07:53 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: 2011/8/1 Dhananjay Nene : > On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: >> 2011/8/1 Dhananjay Nene : >>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: >>>> What if I have two lists for both minimum and maximum values >>>> >>>> Minimum ?Maximum >>>> 0 ? ? ? ? ? ? ? 10 >>>> 11 ? ? ? ? ? ? ?20 >>>> 21 ? ? ? ? ? ? ?30 >>>> 31 ? ? ? ? ? ? ?40 >>>> >>>> >>>> Now how should I check if actual result is not laying between above ranges >>>> >>>> if not minimum<=actual_result and ?not maximum>=actual_result: >>>> >>>> Any suggestions? >>> >>> def in_range(number) : >>> ? ?return any(map(lambda (x,y) : x <= number <= y, >>> ? ? ? ? ? ? ? ? ?((0,10),(11,20), (21,30), (31,40)))) >> >> How about this? >> >> def in_range(number, min_max_pairs): >> ? ?return any(x <= number <=y for x, y in min_max_pairs) > > Definitely better >> >> List comprehensions and generation expressions are usually more >> readable and expressive than using map. > > Thats probably truer for the python and python trained eyes than any > other (in other words its both subjective and contextual and a bit to > do with syntax). Allow me to illustrate : > > If I want to double all elements in a list and then increment them by > one, here's how I would use a map in python > > def double(x) : return x * 2 > def increment(x) : return x + 1 > print map(increment,map(double,range(5))) > > and here's how I would do it in scala - notice the last (third) line > and consider its readability (I'm sure a scala non-novice will offer > something even superior) > > def double(n: Int) = n * 2 > def increment(n: Int) = n + 1 > println(0 to 4 map double map increment) > > so readability is often a function of what one's eyes are trained ot > read and also the syntactic capabilities in the language This is just the prefix/postfix thing. Yes, prefix style is difficult to read if there are too many nested levels. Look at lisp code for example. Yes, it feel it awkward when I have to do range(len(x)). Unix pipes and chaining methods are postfix. What you are doing in scala is just that. If map was a list method, I could do this: range(0, 4).map(douple).map(increment) And as unix pipe: seq 0 4 | double | increment > I also find map much more atomic and portable construct to think in - > after all every list comprehension is syntactic sugar around map + > filter, and map/reduce/filter are far more omnipresent than list > comprehensions. Recently, I was thinking about converting a list comprehension to map/filter calls and It turned out that list comprehensions are more than map+filter. [i * i for i in range(10)] ~ map(lambda i*i, range(10)) [i * i for i in range(10) if i % 2 == 0] ~ map(lambda i*i, filter(lambda i%2 == 0, range(10))) But the situation gets tricky when there are multiple loop items in the list comprehension. Here is a list comprehension to find all Pythagorean triplets below 100. [(x, y, z) for x in range(1, 50) for y in range(x, 100) for z in range(y, 100) if x*x + y*y == z*z] Try converting this into map/filter and you'll understand the difference. Anand From anandology at gmail.com Mon Aug 1 13:39:47 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 17:09:47 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: 2011/8/1 Baishampayan Ghose : > On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene wrote: >> I also find map much more atomic and portable construct to think in - >> after all every list comprehension is syntactic sugar around map + >> filter, and map/reduce/filter are far more omnipresent than list >> comprehensions. > > The above will especially make sense to someone who programs in > multiple programming languages in his day job. I envy them. :) Anand From b.ghose at gmail.com Mon Aug 1 13:45:08 2011 From: b.ghose at gmail.com (Baishampayan Ghose) Date: Mon, 1 Aug 2011 17:15:08 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 5:09 PM, Anand Chitipothu wrote: >>> I also find map much more atomic and portable construct to think in - >>> after all every list comprehension is syntactic sugar around map + >>> filter, and map/reduce/filter are far more omnipresent than list >>> comprehensions. >> >> The above will especially make sense to someone who programs in >> multiple programming languages in his day job. > > I envy them. :) Why envy them when you can join them ;-) Regards, BG -- Baishampayan Ghose b.ghose at gmail.com From anandology at gmail.com Mon Aug 1 14:11:37 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 17:41:37 +0530 Subject: [BangPypers] #lazyweb - How would the wsgi lite proposal help in .. In-Reply-To: References: Message-ID: 2011/8/1 Dhananjay Nene : > After Armin Ronacher's post > http://lucumr.pocoo.org/2011/7/27/the-pluggable-pipedream/ P. J. Eby > responded with http://dirtsimple.org/2011/07/wsgi-is-dead-long-live-wsgi-lite.html > with an implementation at https://bitbucket.org/pje/wsgi_lite/ > > While I could potentially read up the details and find the answers - > wondering if I can lazily wait to find their way into my inbox :) > > How could the above proposal (if it does) help in > > a) Creating simpler, lighter frameworks (eg. flask) > b) Help support greater asynchronicity (a la tornado, node.js etc.) WSGILite looks just like a syntactic sugar for changing: def app(env, start_response): ... start_response(status, headers) ... return body to @lite def app(env): return status, headers, body I don't see how it is solving the async problem. There was PEP-444 to replace WSGI (called WEB3), but that is still in Draft stage. Quoting the async support from it: "If the origin server advertises that it has the web3.async capability, a Web3 application callable used by the server is permitted to return a callable that accepts no arguments. When it does so, this callable is to be called periodically by the origin server until it returns a non-None response, which must be a normal Web3 response tuple." This is not really async. The server has to keep pooling the app to see if it is ready to return more data. Anand From dhananjay.nene at gmail.com Mon Aug 1 14:14:16 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 17:44:16 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : >> On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: >>> 2011/8/1 Dhananjay Nene : >>>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: >>>>> What if I have two lists for both minimum and maximum values >>>>> >>>>> Minimum ?Maximum >>>>> 0 ? ? ? ? ? ? ? 10 >>>>> 11 ? ? ? ? ? ? ?20 >>>>> 21 ? ? ? ? ? ? ?30 >>>>> 31 ? ? ? ? ? ? ?40 >>>>> >>>>> >>>>> Now how should I check if actual result is not laying between above ranges >>>>> >>>>> if not minimum<=actual_result and ?not maximum>=actual_result: >>>>> >>>>> Any suggestions? >>>> >>>> def in_range(number) : >>>> ? ?return any(map(lambda (x,y) : x <= number <= y, >>>> ? ? ? ? ? ? ? ? ?((0,10),(11,20), (21,30), (31,40)))) >>> >>> How about this? >>> >>> def in_range(number, min_max_pairs): >>> ? ?return any(x <= number <=y for x, y in min_max_pairs) >> >> Definitely better >>> >>> List comprehensions and generation expressions are usually more >>> readable and expressive than using map. >> >> Thats probably truer for the python and python trained eyes than any >> other (in other words its both subjective and contextual and a bit to >> do with syntax). Allow me to illustrate : >> >> If I want to double all elements in a list and then increment them by >> one, here's how I would use a map in python >> >> def double(x) : return x * 2 >> def increment(x) : return x + 1 >> print map(increment,map(double,range(5))) >> >> and here's how I would do it in scala - notice the last (third) line >> and consider its readability (I'm sure a scala non-novice will offer >> something even superior) >> >> def double(n: Int) = n * 2 >> def increment(n: Int) = n + 1 >> println(0 to 4 map double map increment) >> >> so readability is often a function of what one's eyes are trained ot >> read and also the syntactic capabilities in the language > > This is just the prefix/postfix thing. > > Yes, prefix style is difficult to read if there are too many nested > levels. Look at lisp code for example. Yes, it feel it awkward when I > have to do range(len(x)). Unix pipes and chaining methods are postfix. > What you are doing in scala is just that. > > If map was a list method, I could do this: > > range(0, 4).map(douple).map(increment) > > And as unix pipe: > > seq 0 4 | double | increment > >> I also find map much more atomic and portable construct to think in - >> after all every list comprehension is syntactic sugar around map + >> filter, and map/reduce/filter are far more omnipresent than list >> comprehensions. > > Recently, I was thinking about converting a list comprehension to > map/filter calls and It turned out that list comprehensions are more > than map+filter. > > [i * i for i in range(10)] ?~ map(lambda i*i, range(10)) > > [i * i for i in range(10) if i % 2 == 0] ~ ?map(lambda i*i, > filter(lambda i%2 == 0, range(10))) > > But the situation gets tricky when there are multiple loop items in > the list comprehension. > > Here is a list comprehension to find all Pythagorean triplets below 100. > > [(x, y, z) for x in range(1, 50) for y in range(x, 100) for z in > range(y, 100) if x*x + y*y == z*z] > > Try converting this into map/filter and you'll understand the difference. > Well, I cheated - there's one more important function (which at least I haven't seen in the python library - flatmap) I constructed my own version I also constructed my own append_to_list since I didn't know how to implement it as a lambda Here's the code def append_to_list(first,second) : l = first l.extend(second) return l def flatmap(func, val) : return reduce(append_to_list, map(func,val),[]) print filter(lambda (x,y,z,pred) : pred, flatmap(lambda x: flatmap(lambda y: flatmap(lambda z: [[x,y,z,x*x + y*y == z*z]],range(y,100)), range(x,100)), range(1,50))) -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From dhananjay.nene at gmail.com Mon Aug 1 14:23:31 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 17:53:31 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 4:41 PM, Baishampayan Ghose wrote: > On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene wrote: >> I also find map much more atomic and portable construct to think in - >> after all every list comprehension is syntactic sugar around map + >> filter, and map/reduce/filter are far more omnipresent than list >> comprehensions. > > The above will especially make sense to someone who programs in > multiple programming languages in his day job. > > Regards, > BG > Actually there was one more aspect I didn't touch upon - why atomic functions are helpful. So its easier to construct bigger building smaller building blocks. And one doesn't need to work in different languages - its doable in python as well. Functions compose. I stole a python compose function from http://en.wikipedia.org/wiki/Function_composition_%28computer_science%29#First-class_composition (though I reversed the order of functions to help it make a little easier on the eyes) If we take the earlier functions double, increment and then want to also sum up the results, here's how it looks in python using function compositon (note the [::-1] - thats the only change I made) from functools import partial def compose(*funcs, **kfuncs): return reduce(lambda f, g: lambda *args, **kaargs: f(g(*args, **kaargs)), funcs[::-1]) def double(x) : return x * 2 def increment(x) : return x + 1 print compose(partial(map,double), partial(map,increment), partial(reduce,lambda x,y : x + y))(range(5)) Notice the sequential application of the double, increment and then a sum operator The same again in scala (since it is easier in syntax - it will help relate what the function above is doing println(0 to 4 map {_ * 2} map {_ + 1} reduce {_ + _}) (the _ refer to the arguments passed to the function - point free programming). Dhananjay From dhananjay.nene at gmail.com Mon Aug 1 14:51:21 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 18:21:21 +0530 Subject: [BangPypers] #lazyweb - How would the wsgi lite proposal help in .. In-Reply-To: References: Message-ID: On Mon, Aug 1, 2011 at 5:41 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : >> [..] >> >> How could the above proposal (if it does) help in >> >> a) Creating simpler, lighter frameworks (eg. flask) >> b) Help support greater asynchronicity (a la tornado, node.js etc.) > > WSGILite looks just like a syntactic sugar for changing: > > def app(env, start_response): > ? ?... > ? ?start_response(status, headers) > ? ?... > ? ?return body > > to > > @lite > def app(env): > ? ?return status, headers, body > > I don't see how it is solving the async problem. > Thanks. That will probably save me some time :) Dhananjay From abpillai at gmail.com Mon Aug 1 15:56:02 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 19:26:02 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : > > On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu > wrote: > >> 2011/8/1 Dhananjay Nene : > >>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar < > asif.jamadar at rezayat.net> wrote: > >>>> What if I have two lists for both minimum and maximum values > >>>> > >>>> Minimum Maximum > >>>> 0 10 > >>>> 11 20 > >>>> 21 30 > >>>> 31 40 > >>>> > >>>> > >>>> Now how should I check if actual result is not laying between above > ranges > >>>> > >>>> if not minimum<=actual_result and not maximum>=actual_result: > >>>> > >>>> Any suggestions? > >>> > >>> def in_range(number) : > >>> return any(map(lambda (x,y) : x <= number <= y, > >>> ((0,10),(11,20), (21,30), (31,40)))) > >> > >> How about this? > >> > >> def in_range(number, min_max_pairs): > >> return any(x <= number <=y for x, y in min_max_pairs) > > > > Definitely better > >> > >> List comprehensions and generation expressions are usually more > >> readable and expressive than using map. > > > > Thats probably truer for the python and python trained eyes than any > > other (in other words its both subjective and contextual and a bit to > > do with syntax). Allow me to illustrate : > > > > If I want to double all elements in a list and then increment them by > > one, here's how I would use a map in python > > > > def double(x) : return x * 2 > > def increment(x) : return x + 1 > > print map(increment,map(double,range(5))) > > > > and here's how I would do it in scala - notice the last (third) line > > and consider its readability (I'm sure a scala non-novice will offer > > something even superior) > > > > def double(n: Int) = n * 2 > > def increment(n: Int) = n + 1 > > println(0 to 4 map double map increment) > > > > so readability is often a function of what one's eyes are trained ot > > read and also the syntactic capabilities in the language > > This is just the prefix/postfix thing. > > Yes, prefix style is difficult to read if there are too many nested > levels. Look at lisp code for example. Yes, it feel it awkward when I > have to do range(len(x)). Unix pipes and chaining methods are postfix. > What you are doing in scala is just that. > > If map was a list method, I could do this: > > range(0, 4).map(douple).map(increment) > > And as unix pipe: > > seq 0 4 | double | increment > > > I also find map much more atomic and portable construct to think in - > > after all every list comprehension is syntactic sugar around map + > > filter, and map/reduce/filter are far more omnipresent than list > > comprehensions. > > Recently, I was thinking about converting a list comprehension to > map/filter calls and It turned out that list comprehensions are more > than map+filter. > > [i * i for i in range(10)] ~ map(lambda i*i, range(10)) > > [i * i for i in range(10) if i % 2 == 0] ~ map(lambda i*i, > filter(lambda i%2 == 0, range(10))) > > But the situation gets tricky when there are multiple loop items in > the list comprehension. > > Here is a list comprehension to find all Pythagorean triplets below 100. > > [(x, y, z) for x in range(1, 50) for y in range(x, 100) for z in > range(y, 100) if x*x + y*y == z*z] > > Try converting this into map/filter and you'll understand the difference. > +1. IMHO, map/filter/reduce and the inevitable companion lambda were added on to Python when it was still trying to find its identity on where it stood in the pantheon of dynamic typed languages - since it wanted to be everything for everyone it borrowed some of these constructs from Lisp or other functional languages. With addition of list comps, generators etc, these right now stand out like sore thumbs in the language and should be got ridden of at the earliest. Also, using any of the m/f/r trio with lambda is a performance killer. See an earlier post in a different thread for more on this. > > Anand > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From dhananjay.nene at gmail.com Mon Aug 1 15:57:37 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 19:27:37 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 5:44 PM, Dhananjay Nene wrote: > On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: >> 2011/8/1 Dhananjay Nene : >>> On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: >>>> 2011/8/1 Dhananjay Nene : >>>>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: >>>>>> What if I have two lists for both minimum and maximum values >>>>>> >>>>>> Minimum ?Maximum >>>>>> 0 ? ? ? ? ? ? ? 10 >>>>>> 11 ? ? ? ? ? ? ?20 >>>>>> 21 ? ? ? ? ? ? ?30 >>>>>> 31 ? ? ? ? ? ? ?40 >>>>>> >>>>>> >>>>>> Now how should I check if actual result is not laying between above ranges >>>>>> >>>>>> if not minimum<=actual_result and ?not maximum>=actual_result: >>>>>> >>>>>> Any suggestions? >>>>> >>>>> def in_range(number) : >>>>> ? ?return any(map(lambda (x,y) : x <= number <= y, >>>>> ? ? ? ? ? ? ? ? ?((0,10),(11,20), (21,30), (31,40)))) >>>> >>>> How about this? >>>> >>>> def in_range(number, min_max_pairs): >>>> ? ?return any(x <= number <=y for x, y in min_max_pairs) >>> >>> Definitely better >>>> >>>> List comprehensions and generation expressions are usually more >>>> readable and expressive than using map. >>> >>> Thats probably truer for the python and python trained eyes than any >>> other (in other words its both subjective and contextual and a bit to >>> do with syntax). Allow me to illustrate : >>> >>> If I want to double all elements in a list and then increment them by >>> one, here's how I would use a map in python >>> >>> def double(x) : return x * 2 >>> def increment(x) : return x + 1 >>> print map(increment,map(double,range(5))) >>> >>> and here's how I would do it in scala - notice the last (third) line >>> and consider its readability (I'm sure a scala non-novice will offer >>> something even superior) >>> >>> def double(n: Int) = n * 2 >>> def increment(n: Int) = n + 1 >>> println(0 to 4 map double map increment) >>> >>> so readability is often a function of what one's eyes are trained ot >>> read and also the syntactic capabilities in the language >> >> This is just the prefix/postfix thing. >> >> Yes, prefix style is difficult to read if there are too many nested >> levels. Look at lisp code for example. Yes, it feel it awkward when I >> have to do range(len(x)). Unix pipes and chaining methods are postfix. >> What you are doing in scala is just that. >> >> If map was a list method, I could do this: >> >> range(0, 4).map(douple).map(increment) >> >> And as unix pipe: >> >> seq 0 4 | double | increment >> >>> I also find map much more atomic and portable construct to think in - >>> after all every list comprehension is syntactic sugar around map + >>> filter, and map/reduce/filter are far more omnipresent than list >>> comprehensions. >> >> Recently, I was thinking about converting a list comprehension to >> map/filter calls and It turned out that list comprehensions are more >> than map+filter. >> >> [i * i for i in range(10)] ?~ map(lambda i*i, range(10)) >> >> [i * i for i in range(10) if i % 2 == 0] ~ ?map(lambda i*i, >> filter(lambda i%2 == 0, range(10))) >> >> But the situation gets tricky when there are multiple loop items in >> the list comprehension. >> >> Here is a list comprehension to find all Pythagorean triplets below 100. >> >> [(x, y, z) for x in range(1, 50) for y in range(x, 100) for z in >> range(y, 100) if x*x + y*y == z*z] >> >> Try converting this into map/filter and you'll understand the difference. >> > > Well, I cheated - there's one more important function (which at least > I haven't seen in the python library - flatmap) > > I constructed my own version > > I also constructed my own append_to_list since I didn't know how to > implement it as a lambda > > Here's the code > I knew there was a way to better implement flatmap - its a combination of itertools.chain.from_iterable and map. Here's a much cleaner code from itertools import chain print filter(lambda (x,y,z) : x*x + y*y == z*z, chain.from_iterable(map( lambda x: chain.from_iterable(map( lambda y: chain.from_iterable(map( lambda z: [[x,y,z]], range(y,100))), range(x,100))), range(1,50)))) PS: There are no more functions required (that I cheated about :)) map, reduce, filter, flatmap equivalent should do it. From dhananjay.nene at gmail.com Mon Aug 1 16:21:33 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 19:51:33 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai wrote: > ?IMHO, map/filter/reduce and the inevitable companion lambda were > ?added on to Python when it was still trying to find its identity on where > ?it stood in the pantheon of dynamic typed languages - since it wanted > ?to be everything for everyone it borrowed some of these constructs > ?from Lisp or other functional languages. > > ?With addition of list comps, generators etc, these right now stand > ?out like sore thumbs in the language and should be got ridden > ?of at the earliest. I am certain there are contrary opinions, even though the BDFL has weighed in. So yes, python is unlikely to be the playground for these constructs. I find a degree of elegance and utility to these constructs, though it is as well likely that these may seem like sore thumbs to others. > ?Also, using any of the m/f/r trio with lambda is a performance killer. > ?See an earlier post in a different thread for more on this. Its a performance killer only for cPython - its a function of runtime not the construct. cPython is likely to stay a poorly performing runtime for these. I do hope PyPy will fare much better - but that remains to be seen. These constructs also help parallelisation (but only when combined with immutability), and thats a feature python is likely to be therefore unable to implement as far as I can imagine. Is this a big deal - frankly no, since the sweet spot of python is pretty broad. From noufal at gmail.com Mon Aug 1 16:21:29 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Mon, 01 Aug 2011 19:51:29 +0530 Subject: [BangPypers] parsing xml In-Reply-To: (Anand Balachandran Pillai's message of "Mon, 1 Aug 2011 11:26:19 +0530") References: <1311846517.1742.73.camel@xlquest.web> Message-ID: <87livdp5zq.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: > On Mon, Aug 1, 2011 at 6:08 AM, Anand Chitipothu wrote: [...] > It is more subtler than that. > > List comprehensions are faster than map functions when > the latter needs to invoke a user-defined function call or a lambda. > > Maps score over list comprehensions in most cases where the function > is a Python built-in and when no lambda is used. > > Example of former: > >>>> def f1(): map(sqr, range(1, 100)) > ... >>>> def f2(): [sqr(x) for x in range(1, 100)] > ... >>>> mytimeit.Timeit(f1) > '37.91 usec/pass' >>>> mytimeit.Timeit(f2) > '37.50 usec/pass' > > Example of latter: > >>>> def f1(): map(hex, range(1, 100)) > ... >>>> def f2(): [hex(x) for x in range(1, 100)] > ... >>>> mytimeit.Timeit(f1) > '49.41 usec/pass' >>>> mytimeit.Timeit(f2) > '55.29 usec/pass' This is confusing. Why is map(sqr, range(1, 100)) faster than map(hex, range(1, 100)) Assuming sqr is implemented in python, it should be slower than hex which is implemented in C. [...] -- ~noufal http://nibrahim.net.in She used to diet on any kind of food she could lay her hands on. -- Arthur Baer, American comic and columnist From director at guruprevails.com Mon Aug 1 16:48:26 2011 From: director at guruprevails.com (director guruprevails) Date: Mon, 1 Aug 2011 20:18:26 +0530 Subject: [BangPypers] [Python Workshop] in Bangalore Message-ID: Dear Python Community, This is to inform you that GuRu Prevails is conducting a Python workshop starting 3rd August 2011. The timings are as follows 3rd August 2011 - 6 P.M. - 10 P.M 4th August 2011 - 6 P.M. - 10 P.M. 10th August 2011 - 4 P.M. - 10 P.M. 11th August 2011 - 5 P.M. - 10 P.M. The syllabus of the workshop is @ http://www.guruprevails.com/python.html Interested candidates may touch-base with us @ 9972952810 ASAP. -Thanks GuRu Prevails Labs From dhananjay.nene at gmail.com Mon Aug 1 16:54:49 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Mon, 1 Aug 2011 20:24:49 +0530 Subject: [BangPypers] parsing xml In-Reply-To: <87livdp5zq.fsf@sanitarium.localdomain> References: <1311846517.1742.73.camel@xlquest.web> <87livdp5zq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 7:51 PM, Noufal Ibrahim wrote: > Anand Balachandran Pillai writes: > >> On Mon, Aug 1, 2011 at 6:08 AM, Anand Chitipothu wrote: > > [...] > >> It is more subtler than that. >> >> List comprehensions are faster than map functions when >> the latter needs to invoke a user-defined function call or a lambda. >> >> Maps score over list comprehensions in most cases where the function >> is a Python built-in and when no lambda is used. >> >> Example of former: >> >>>>> def f1(): map(sqr, range(1, 100)) >> ... >>>>> def f2(): [sqr(x) for x in range(1, 100)] >> ... >>>>> mytimeit.Timeit(f1) >> '37.91 usec/pass' >>>>> mytimeit.Timeit(f2) >> '37.50 usec/pass' >> >> Example of latter: >> >>>>> def f1(): map(hex, range(1, 100)) >> ... >>>>> def f2(): [hex(x) for x in range(1, 100)] >> ... >>>>> mytimeit.Timeit(f1) >> '49.41 usec/pass' >>>>> mytimeit.Timeit(f2) >> '55.29 usec/pass' > > This is confusing. Why is > > map(sqr, range(1, 100)) > > faster than > > map(hex, range(1, 100)) > > Assuming sqr is implemented in python, it should be slower than hex > which is implemented in C. Here's what I get (note: sqrt is faster than hex - not sqr) Program ======= from math import sqrt from timeit import Timer def sqr(x) : x * x print "Simple sqr", Timer("sqr(50)","from __main__ import sqr").timeit() print "Simple sqrt", Timer("sqrt(50)","from math import sqrt").timeit() print "Simple hex", Timer("hex(50)").timeit() print "Map sqr", Timer("map(sqr,range(1,100))","from __main__ import sqr").timeit() print "Map sqrt", Timer("map(sqrt,range(1,100))","from math import sqrt").timeit() print "Map hex", Timer("map(hex,range(1,100))").timeit() Output ====== Simple sqr 0.185955047607 Simple sqrt 0.108409881592 Simple hex 0.143438816071 Map sqr 21.4051530361 Map sqrt 12.3786129951 Map hex 13.8608310223 From anandology at gmail.com Mon Aug 1 17:00:15 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Mon, 1 Aug 2011 20:30:15 +0530 Subject: [BangPypers] List Comprehensions Vs. map/filter (Was: if not with comparision statement in python) Message-ID: > I knew there was a way to better implement flatmap - its a combination > of itertools.chain.from_iterable and map. Here's a much cleaner code > > from itertools import chain > > print filter(lambda (x,y,z) : x*x + y*y == z*z, > ? ?chain.from_iterable(map( > ? ? ? ?lambda x: chain.from_iterable(map( > ? ? ? ? ? ?lambda y: chain.from_iterable(map( > ? ? ? ? ? ? ? ?lambda z: [[x,y,z]], > ? ? ? ? ? ? ? ?range(y,100))), > ? ? ? ? ? ?range(x,100))), > ? ? ? ?range(1,50)))) > Impressive. But having to return [[x, y, z]] instead of [x, y,z] is a compromise. I was trying to translate Python list-comprehensions into Javascript and here is what I've come up with. $pyjs.listcomp( function(x, y, z) { return [x, y, z]}, [ range(1, 100), function(x) { return range(x, 100)}, function(x, y) { return range(y, 100)}, ], function(x, y, z) { return x*x + y*y == z*z;} ) I haven't worked out the $pyjs.listcomp function implementation yet. Anand From abpillai at gmail.com Mon Aug 1 17:49:28 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 21:19:28 +0530 Subject: [BangPypers] Map vs List comprehensions (was Re: parsing xml) Message-ID: On Mon, Aug 1, 2011 at 7:51 PM, Noufal Ibrahim wrote: > Anand Balachandran Pillai writes: > > > On Mon, Aug 1, 2011 at 6:08 AM, Anand Chitipothu >wrote: > > [...] > > > It is more subtler than that. > > > > List comprehensions are faster than map functions when > > the latter needs to invoke a user-defined function call or a lambda. > > > > Maps score over list comprehensions in most cases where the function > > is a Python built-in and when no lambda is used. > > > > Example of former: > > > >>>> def f1(): map(sqr, range(1, 100)) > > ... > >>>> def f2(): [sqr(x) for x in range(1, 100)] > > ... > >>>> mytimeit.Timeit(f1) > > '37.91 usec/pass' > >>>> mytimeit.Timeit(f2) > > '37.50 usec/pass' > > > > Example of latter: > > > >>>> def f1(): map(hex, range(1, 100)) > > ... > >>>> def f2(): [hex(x) for x in range(1, 100)] > > ... > >>>> mytimeit.Timeit(f1) > > '49.41 usec/pass' > >>>> mytimeit.Timeit(f2) > > '55.29 usec/pass' > > This is confusing. Why is > > map(sqr, range(1, 100)) > > faster than > > map(hex, range(1, 100)) > > Assuming sqr is implemented in python, it should be slower than hex > which is implemented in C. > Maybe I should have rephrased it like this. - If using anonymous functions, prefer list comps over map. - If using built-in functions (C functions), prefer map over list comps. - If using pythonic user functions, there is nothing much to choose among these two, since the difference is not much. The reason - List comprehensions perform best, if all the calculations are inline within the two square brackets. Hence it scores over map in the lambda use-case but doesn't differ much if the function is declared outside. >>> def f1(): [lambda x: x*x for x in range(100)] ... >>> def f2(): map(lambda x: x*x, range(100)) ... >>> mytimeit.Timeit(f1) '24.80 usec/pass' >>> mytimeit.Timeit(f2) '37.44 usec/pass' The gain is significant. Whereas , >>> def sqr(x): return x*x ... >>> def f1(): [sqr(x) for x in range(100)] ... >>> def f2(): map(sqr, range(100)) ... >>> mytimeit.Timeit(f1) '37.23 usec/pass' >>> mytimeit.Timeit(f2) '36.72 usec/pass' The gain is minuscule, barely noticeable. This is generally perceived as a performance trick with Python. http://www.ardendertat.com/2011/05/30/python-optimization/ > > [...] > > > > > -- > ~noufal > http://nibrahim.net.in > > She used to diet on any kind of food she could lay her hands on. -- Arthur > Baer, American comic and columnist > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From abpillai at gmail.com Mon Aug 1 17:54:18 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Mon, 1 Aug 2011 21:24:18 +0530 Subject: [BangPypers] Map vs List comprehensions (was Re: parsing xml) In-Reply-To: References: Message-ID: > >>>> mytimeit.Timeit(f1) >> > '37.91 usec/pass' >> >>>> mytimeit.Timeit(f2) >> > '37.50 usec/pass' >> >> Btw (shameless plug) - To clarify, the mytimeit module I am referring to in these posts is my own wrapper over timeit. http://code.activestate.com/recipes/389767-timeit-module-wrapper/ -- --Anand From noufal at gmail.com Mon Aug 1 20:36:17 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Tue, 02 Aug 2011 00:06:17 +0530 Subject: [BangPypers] Map vs List comprehensions In-Reply-To: (Anand Balachandran Pillai's message of "Mon, 1 Aug 2011 21:19:28 +0530") References: Message-ID: <87oc09nfmm.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: [...] > Maybe I should have rephrased it like this. > > - If using anonymous functions, prefer list comps over map. > - If using built-in functions (C functions), prefer map over list comps. > - If using pythonic user functions, there is nothing much to choose among > these two, since the difference is not much. This is useful rule of thumb. I still don't understand how in your original email, the map using a user defined function (sqr) was faster than mapping using an inbuilt C function (hex). My tests show the opposite. > The reason - List comprehensions perform best, if all the calculations > are inline within the two square brackets. Hence it scores over map > in the lambda use-case but doesn't differ much if the function is > declared outside. > >>>> def f1(): [lambda x: x*x for x in range(100)] > ... >>>> def f2(): map(lambda x: x*x, range(100)) > ... >>>> mytimeit.Timeit(f1) > '24.80 usec/pass' >>>> mytimeit.Timeit(f2) > '37.44 usec/pass' This is kind of weird. Your numbers are correct. I disassembled the 2 functions and see this >>> dis.dis(f1) 1 0 BUILD_LIST 0 3 DUP_TOP 4 STORE_FAST 0 (_[1]) 7 LOAD_GLOBAL 0 (range) 10 LOAD_CONST 1 (100) 13 CALL_FUNCTION 1 16 GET_ITER >> 17 FOR_ITER 16 (to 36) 20 STORE_FAST 1 (x) 23 LOAD_FAST 0 (_[1]) 26 LOAD_CONST 2 ( at 0x7fc29eea7378, file "", line 1>) 29 MAKE_FUNCTION 0 32 LIST_APPEND 33 JUMP_ABSOLUTE 17 >> 36 DELETE_FAST 0 (_[1]) 39 POP_TOP 40 LOAD_CONST 0 (None) 43 RETURN_VALUE The loop as far as I understand is between 17 and 36. The function is "made" in every iteration. I don't know if there's an optimiser that pulls this out before it's run but in this way, it looks pretty inefficient. Am I correct here? With f2. >>> dis.dis(f2) 1 0 LOAD_GLOBAL 0 (map) 3 LOAD_CONST 1 ( at 0x7fc29eebe378, file "", line 1>) 6 MAKE_FUNCTION 0 9 LOAD_GLOBAL 1 (range) 12 LOAD_CONST 2 (100) 15 CALL_FUNCTION 1 18 CALL_FUNCTION 2 21 POP_TOP 22 LOAD_CONST 0 (None) 25 RETURN_VALUE it looks much more simple, load the functions, create the lambda and then just delegate to map and pop/return the result. This intuitively seems like it should be faster. > The gain is significant. > > Whereas , > >>>> def sqr(x): return x*x > ... >>>> def f1(): [sqr(x) for x in range(100)] > ... >>>> def f2(): map(sqr, range(100)) > ... >>>> mytimeit.Timeit(f1) > '37.23 usec/pass' >>>> mytimeit.Timeit(f2) > '36.72 usec/pass' > > The gain is minuscule, barely noticeable. This is reasonable. There's a LOAD_GLOBAL that happens in each iteration which looks up the function outside the scope of the comprehension. I remember reading how slow this is and so it would kill the performance of the list comprehension. [...] -- ~noufal http://nibrahim.net.in The first condition of immortality is death. -Stanislaw Lec From dhananjay.nene at gmail.com Tue Aug 2 06:20:29 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Tue, 2 Aug 2011 09:50:29 +0530 Subject: [BangPypers] List Comprehensions Vs. map/filter (Was: if not with comparision statement in python) In-Reply-To: References: Message-ID: On Mon, Aug 1, 2011 at 8:30 PM, Anand Chitipothu wrote: >> I knew there was a way to better implement flatmap - its a combination >> of itertools.chain.from_iterable and map. Here's a much cleaner code >> >> from itertools import chain >> >> print filter(lambda (x,y,z) : x*x + y*y == z*z, >> ? ?chain.from_iterable(map( >> ? ? ? ?lambda x: chain.from_iterable(map( >> ? ? ? ? ? ?lambda y: chain.from_iterable(map( >> ? ? ? ? ? ? ? ?lambda z: [[x,y,z]], >> ? ? ? ? ? ? ? ?range(y,100))), >> ? ? ? ? ? ?range(x,100))), >> ? ? ? ?range(1,50)))) >> > > Impressive. But having to return [[x, y, z]] instead of [x, y,z] is a > compromise. No longer. It was there to compensate for an extra chain.from_iterable (which is not required for the innermost map) print filter(lambda (x,y,z) : x*x + y*y == z*z, chain.from_iterable(map( lambda x: chain.from_iterable(map( lambda y: map( lambda z: [x,y,z], range(y,100)), range(x,100))), range(1,50)))) From dhananjay.nene at gmail.com Tue Aug 2 06:29:30 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Tue, 2 Aug 2011 09:59:30 +0530 Subject: [BangPypers] List Comprehensions Vs. map/filter (Was: if not with comparision statement in python) In-Reply-To: References: Message-ID: On Mon, Aug 1, 2011 at 8:30 PM, Anand Chitipothu wrote: > I was trying to translate Python list-comprehensions into Javascript > and here is what I've come up with. > > $pyjs.listcomp( > ? ?function(x, y, z) { return [x, y, z]}, > ? ?[ > ? ? ? ?range(1, 100), > ? ? ? ?function(x) { return range(x, 100)}, > ? ? ? ?function(x, y) { return range(y, 100)}, > ? ?], > ? ?function(x, y, z) { return x*x + y*y == z*z;} > ) > > I haven't worked out the $pyjs.listcomp function implementation yet. > There's another one you might want to take a look at http://rosettacode.org/wiki/List_comprehensions#JavaScript From abpillai at gmail.com Tue Aug 2 07:42:10 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Tue, 2 Aug 2011 11:12:10 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Mon, Aug 1, 2011 at 7:51 PM, Dhananjay Nene wrote: > On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai > wrote: > > IMHO, map/filter/reduce and the inevitable companion lambda were > > added on to Python when it was still trying to find its identity on > where > > it stood in the pantheon of dynamic typed languages - since it wanted > > to be everything for everyone it borrowed some of these constructs > > from Lisp or other functional languages. > > > > With addition of list comps, generators etc, these right now stand > > out like sore thumbs in the language and should be got ridden > > of at the earliest. > > I am certain there are contrary opinions, even though the BDFL has > weighed in. So yes, python is unlikely to be the playground for these > constructs. I find a degree of elegance and utility to these > constructs, though it is as well likely that these may seem like sore > thumbs to others. > I also used to think likewise when I first encountered these functions when I was playing around with Python many years back. However, I think the "elegancy" is actually a myth and is perhaps a pseudonym for being cryptic. For example, look at these competing solutions for summing the squares of first 10 integers. 1. List comp >>> sum([x*x for x in range(10)]) 285 2. Map >>> sum(map(lambda x: x*x, range(10))) 285 3. Reduce >>> reduce(lambda x,y: x + y*y, range(10)) 285 I dont think there will be much disagreement that the listing is also in the order of decreasing readability. The list comp solution is graspable at one look, the map one takes one step of mental computation and the reduce one takes a few mental hoops to jump through and is utterly confusing to anyone not familiar with list/functional programming. The reduce one is also very error prone. For example, a small mistake such as, >>> reduce(lambda x,y: x*x + y, range(10)) 2818129390158170901506703075470572449397357853477615482257305306043465L Produces a monstrosity instead of the expected answer. Perhaps those with a LISP/functional background find some mathematical elegance with these solutions. But from a pure Python perspective, they lack any elegance whatsoever. > > > Also, using any of the m/f/r trio with lambda is a performance killer. > > See an earlier post in a different thread for more on this. > > Its a performance killer only for cPython - its a function of runtime > not the construct. cPython is likely to stay a poorly performing > runtime for these. I do hope PyPy will fare much better - but that > remains to be seen. These constructs also help parallelisation (but > only when combined with immutability), and thats a feature python is > likely to be therefore unable to implement as far as I can imagine. Is > this a big deal - frankly no, since the sweet spot of python is pretty > broad. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From noufal at gmail.com Tue Aug 2 08:24:45 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Tue, 02 Aug 2011 11:54:45 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: (Anand Balachandran Pillai's message of "Tue, 2 Aug 2011 11:12:10 +0530") References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: <87wrewmitu.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: [...] > 1. List comp > > >>> sum([x*x for x in range(10)]) > 285 > > 2. Map > > >>> sum(map(lambda x: x*x, range(10))) > 285 > > 3. Reduce > > >>> reduce(lambda x,y: x + y*y, range(10)) > 285 A quote from Guido "filter(P, S) is almost always written clearer as [x for x in S if P(x)]" I'm not sure about that but what the heck. Also, The first one should be sum(x*x for x in xrange(10)) >>> def f1(): return sum([x*x for x in range(1,10)]) ... >>> def f2(): return sum([x*x for x in xrange(1,10)]) ... >>> def f3(): return sum(x*x for x in xrange(1,10)) ... >>> import timeit >>> timeit.timeit(f1, number = 100000) 0.20368003845214844 >>> timeit.timeit(f2, number = 100000) 0.17799496650695801 >>> timeit.timeit(f3, number = 100000) 0.17561507225036621 [...] -- ~noufal http://nibrahim.net.in I must follow the people. Am I not their leader? -Benjamin Disraeli From dhananjay.nene at gmail.com Tue Aug 2 09:13:38 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Tue, 2 Aug 2011 12:43:38 +0530 Subject: [BangPypers] if not with comparision statement in python In-Reply-To: References: <87pqksp3eq.fsf@sanitarium.localdomain> Message-ID: On Tue, Aug 2, 2011 at 11:12 AM, Anand Balachandran Pillai wrote: > On Mon, Aug 1, 2011 at 7:51 PM, Dhananjay Nene wrote: > >> On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai >> wrote: >> > ?IMHO, map/filter/reduce and the inevitable companion lambda were >> > ?added on to Python when it was still trying to find its identity on >> where >> > ?it stood in the pantheon of dynamic typed languages - since it wanted >> > ?to be everything for everyone it borrowed some of these constructs >> > ?from Lisp or other functional languages. >> > >> > ?With addition of list comps, generators etc, these right now stand >> > ?out like sore thumbs in the language and should be got ridden >> > ?of at the earliest. >> >> I am certain there are contrary opinions, even though the BDFL has >> weighed in. So yes, python is unlikely to be the playground for these >> constructs. I find a degree of elegance and utility to these >> constructs, though it is as well likely that these may seem like sore >> thumbs to others. >> > > ?I also used to think likewise when I first encountered these functions > ?when I was playing around with Python many years back. > > ?However, I think the "elegancy" is actually a myth and is perhaps > ?a pseudonym for being cryptic. > > ?For example, look at these competing solutions for summing > ?the squares of first 10 integers. > > ?1. List comp > > ?>>> sum([x*x for x in range(10)]) > ?285 > > ?2. Map > > ?>>> sum(map(lambda x: x*x, range(10))) > ?285 > > ?3. Reduce > > ?>>> reduce(lambda x,y: x + y*y, range(10)) > ?285 > > I dont think there will be much disagreement that the listing is also in the > order > of decreasing readability. There is a risk of conflating three different aspects together a. Syntax b. Runtime c. Concepts It is understandable that these get conflated in a mailing list specific to one language and thats fine. But I need to elaborate on the difference, since that difference is important given that the elegance is being contested. a. Syntax : I am pretty darned sure - in python the syntax when using functions like map reduce, can sometimes be quite odd. The List comprehension syntax is succinct and natural. To that end, I immediately clarified in the thread earlier where I suggested that
def in_range(number, min_max_pairs): return any(x <= number <=y for x, y in min_max_pairs)
was syntactically superior to
def in_range(number) : return any(map(lambda (x,y) : x <= number <= y, ((0,10),(11,20), (21,30), (31,40))))
2. Runtime : There's a discussion on the mailing list about how the runtime influences the performance. Thats adequate reference to the topic 3. Concepts : I insist the concepts are extremely elegant (which is what I meant when I referred to elegance earlier). I mentioned another example from scala :
println(0 to 4 map {_ * 2} map {_ + 1} reduce {_ + _})
It would be interesting to contrast the above in terms of syntax (expressivity), runtime (absolute runtime performance) and concepts with
print sum(n * 2 + 1 for n in range(5))
It is my perception that both are readable. The python version is a bit more concise as well. The key part (which I emphasised a bit earlier) is composition. While the python version is based out of a particular syntax which assembles the entire logic as one construct, the scala version is based on composition of smaller constructs, each being an independent function (FWIW scala also has an equivalent which is referred to as the for comprehension). This is but one reason why I find functional constructs more elegant. This elegance is not a myth, and I find the ability to compose a program out of smaller building blocks appealing. As the problems become bigger (than few liners), this elegance starts becoming quite powerful. And I think it helps all programmers python or otherwise to use these constructs in their thought process. Which is where I again meant functions like map are quite atomic and portable. So the entire reason why I lay this out in great detail is that I believe - some programmers will be better served as they start understanding these constructs. > > The list comp solution is graspable at one look, the map one takes one > step of mental computation and the reduce one takes a few mental hoops > to jump through and is utterly confusing to anyone not familiar with > list/functional programming. Absolutely. But just take a look at the scala version - that is not true. So the issue isn't with the concepts. Its not even an issue with prefix/postfix or object being a destination of a method call (a la ruby blocks). Since haskell has a nice syntax for composing functions without making map an operator/method or making any changes from a prefix/postfix perspective. > The reduce one is also very error prone. For example, a small mistake > such as, > >>>> reduce(lambda x,y: x*x + y, range(10)) > 2818129390158170901506703075470572449397357853477615482257305306043465L > > Produces a monstrosity instead of the expected answer. (umm .. so would an equivalent list comprehension) .. perhaps I didn't understand. > Perhaps those with a LISP/functional background find some mathematical > elegance with these solutions. But from a pure Python perspective, > they lack any elegance whatsoever. But that doesn't need to stop python programmers thinking using such constructs and using them as appropriate. I still continue to find use cases where I prefer using them in python. FWIW I tend to end up using list comprehensions more frequently. Dhananjay From senthil at uthcode.com Wed Aug 3 02:21:56 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Wed, 3 Aug 2011 08:21:56 +0800 Subject: [BangPypers] Python Game Programming Challenge 13 (September 2011) is coming! In-Reply-To: References: Message-ID: <20110803002156.GG2542@mathmagic> Let me know if anyone is interested in this. Noufal, if cannot do the game during pycon, I think this would be good idea.. On Fri, Jul 22, 2011 at 02:13:10PM +1000, Richard Jones wrote: > The 13th Python Game Programming Challenge (PyWeek) is coming. It'll > run from the 11th to the 18th of September. > > The PyWeek challenge: > > - Invites entrants to write a game in one week from scratch either as > an individual or in a team, > - Is intended to be challenging and fun, > - Will hopefully increase the public body of game tools, code and expertise, > - Will let a lot of people actually finish a game, and > - May inspire new projects (with ready made teams!) > > > Richard > http://pyweek.org/13/ > -- > http://mail.python.org/mailman/listinfo/python-announce-list > > Support the Python Software Foundation: > http://www.python.org/psf/donations/ From noufal at gmail.com Wed Aug 3 07:06:39 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Wed, 03 Aug 2011 10:36:39 +0530 Subject: [BangPypers] Python Game Programming Challenge 13 (September 2011) is coming! In-Reply-To: <20110803002156.GG2542@mathmagic> (Senthil Kumaran's message of "Wed, 3 Aug 2011 08:21:56 +0800") References: <20110803002156.GG2542@mathmagic> Message-ID: <87livbkrs0.fsf@sanitarium.localdomain> Senthil Kumaran writes: > Let me know if anyone is interested in this. > > Noufal, if cannot do the game during pycon, I think this would be good > idea.. [...] Sounds like fun but this month won't work for me. -- ~noufal http://nibrahim.net.in I tripped over a hole that was sticking up out of the ground. From noufal at gmail.com Wed Aug 3 09:20:34 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Wed, 03 Aug 2011 12:50:34 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark Message-ID: <87oc072c71.fsf@sanitarium.localdomain> PyPy outperforms C in a little benchmark capitalising on gcc's inability to optimise across files. http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html -- ~noufal http://nibrahim.net.in Of course I can keep secrets. It's the people I tell them to that can't keep them. -Anthony Haden-Guest From abpillai at gmail.com Wed Aug 3 09:47:11 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Wed, 3 Aug 2011 13:17:11 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <87oc072c71.fsf@sanitarium.localdomain> References: <87oc072c71.fsf@sanitarium.localdomain> Message-ID: On Wed, Aug 3, 2011 at 12:50 PM, Noufal Ibrahim wrote: > > PyPy outperforms C in a little benchmark capitalising on gcc's inability > to optimise across files. > > > http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html > Not sure if that is the only factor playing here. I am pretty sure the malloc/free every cycle is killing the C program. > > -- > ~noufal > http://nibrahim.net.in > > Of course I can keep secrets. It's the people I tell them to that can't > keep them. -Anthony Haden-Guest > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From noufal at gmail.com Wed Aug 3 09:52:46 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Wed, 03 Aug 2011 13:22:46 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: (Anand Balachandran Pillai's message of "Wed, 3 Aug 2011 13:17:11 +0530") References: <87oc072c71.fsf@sanitarium.localdomain> Message-ID: <87r5530w4x.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: > On Wed, Aug 3, 2011 at 12:50 PM, Noufal Ibrahim wrote: > >> >> PyPy outperforms C in a little benchmark capitalising on gcc's inability >> to optimise across files. >> >> >> http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html >> > > Not sure if that is the only factor playing here. I am pretty sure > the malloc/free every cycle is killing the C program. [...] Well, the original benchmark without dynamic allocation is slower that the PyPy version too. Your point however is sound. -- ~noufal http://nibrahim.net.in If I could drop dead right now, I'd be the happiest man alive! -- Samuel Goldwyn From dhananjay.nene at gmail.com Wed Aug 3 17:50:58 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 3 Aug 2011 21:20:58 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <87r5530w4x.fsf@sanitarium.localdomain> References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> Message-ID: On Wed, Aug 3, 2011 at 1:22 PM, Noufal Ibrahim wrote: > Anand Balachandran Pillai writes: > >> On Wed, Aug 3, 2011 at 12:50 PM, Noufal Ibrahim wrote: >> >>> >>> PyPy outperforms C in a little benchmark capitalising on gcc's inability >>> to optimise across files. >>> >>> >>> http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html >>> >> >> ?Not sure if that is the only factor playing here. I am pretty sure >> ?the malloc/free every cycle is killing the C program. > > [...] > > Well, the original benchmark without dynamic allocation is slower that > the PyPy version too. Your point however is sound. > In this case its the difficulty with inlining rather than malloc (though there could be other situations where a C program could appear not as fast as others due to malloc/free taking time). Java hotspot depends to a fair extent on inlining and I presume the same is true for pypy. Given that hotspot can inline method calls, while gcc is unable to inline calls into a different library (unless declared as inline in the headers) thats clearly an area where bytecode based runtimes can perform superior optimisation. Yet some of it are advantages that may not remain under code written a little differently. I sometimes find people falsely assuming that because some of the newer JVM based languages compile to byte code they will be as fast as java - yet sometimes code slows down by orders of magnitude, because the generated bytecode is difficult to inline. For an interesting detailed account of the inlining matter see http://www.azulsystems.com/blog/cliff/2011-04-04-fixing-the-inlining-problem I would imagine, similar questions will crop up in the context of PyPy VM and what constructs of python lend themselves to easy inlining (functions ??) vs. which ones don't (dynamic dispatch calls on a deep object tree ??) Good to see pypy being able to inline well at least in a specific context. I am sure a well designed garbage collector will also often outperform naively written free/malloc. So I do hope to see lots of performance improvements thanks to pypy over a period of time (I actually am even more keen to see the non-GIL implementation, though thats likely to be some time away). Definitely exciting developments (this is but one amongst many other benchmarks they've been publishing lately). Dhananjay From gopalakrishnan.subramani at gmail.com Wed Aug 3 18:28:37 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 3 Aug 2011 10:28:37 -0600 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> Message-ID: I could not understand the PyPy intention in having another run-time. Can we see having PyPy running Python programs, 1. As a challenge? (A language can have its own runtime with little improved performance) or 2. Potential for future to replace/co-exists CPython forever with strong community support? I like to understand, nowhere I am arguing. I don't code full time in Python, but I do code till I sleep like reading. -- Gopalakrishnan On Wed, Aug 3, 2011 at 9:50 AM, Dhananjay Nene wrote: > On Wed, Aug 3, 2011 at 1:22 PM, Noufal Ibrahim wrote: > > Anand Balachandran Pillai writes: > > > >> On Wed, Aug 3, 2011 at 12:50 PM, Noufal Ibrahim > wrote: > >> > >>> > >>> PyPy outperforms C in a little benchmark capitalising on gcc's > inability > >>> to optimise across files. > >>> > >>> > >>> > http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html > >>> > >> > >> Not sure if that is the only factor playing here. I am pretty sure > >> the malloc/free every cycle is killing the C program. > > > > [...] > > > > Well, the original benchmark without dynamic allocation is slower that > > the PyPy version too. Your point however is sound. > > > In this case its the difficulty with inlining rather than malloc > (though there could be other situations where a C program could appear > not as fast as others due to malloc/free taking time). Java hotspot > depends to a fair extent on inlining and I presume the same is true > for pypy. Given that hotspot can inline method calls, while gcc is > unable to inline calls into a different library (unless declared as > inline in the headers) thats clearly an area where bytecode based > runtimes can perform superior optimisation. Yet some of it are > advantages that may not remain under code written a little > differently. > > I sometimes find people falsely assuming that because some of the > newer JVM based languages compile to byte code they will be as fast as > java - yet sometimes code slows down by orders of magnitude, because > the generated bytecode is difficult to inline. For an interesting > detailed account of the inlining matter see > > http://www.azulsystems.com/blog/cliff/2011-04-04-fixing-the-inlining-problem > I would imagine, similar questions will crop up in the context of PyPy > VM and what constructs of python lend themselves to easy inlining > (functions ??) vs. which ones don't (dynamic dispatch calls on a deep > object tree ??) > > Good to see pypy being able to inline well at least in a specific > context. I am sure a well designed garbage collector will also often > outperform naively written free/malloc. So I do hope to see lots of > performance improvements thanks to pypy over a period of time (I > actually am even more keen to see the non-GIL implementation, though > thats likely to be some time away). Definitely exciting developments > (this is but one amongst many other benchmarks they've been publishing > lately). > > Dhananjay > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dhananjay.nene at gmail.com Wed Aug 3 19:10:10 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 3 Aug 2011 22:40:10 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> Message-ID: On Wed, Aug 3, 2011 at 9:58 PM, Gopalakrishnan Subramani wrote: > I could not understand the PyPy intention in having another run-time. > > Can we see having PyPy running Python programs, > > 1. ?As a challenge? (A language can have its own runtime with little > improved performance) or > 2. ?Potential for future to replace/co-exists CPython forever with strong > community support? > > I like to understand, nowhere I am arguing. I don't code full time in > Python, but I do code till I sleep like reading. For starters, you might want to check out http://stackoverflow.com/questions/2970108/pypy-what-is-all-the-buzz-about (I thought I had seen a much more detailed articulation of the reasons for pypy, but couldn't quickly enough google for it). A Virtual Machine based approach is a rather different approach which has over the last decade started to show strong benefits (especially thanks to the JVM really making strong advances in the area of virtual machine engineering, and advanced memory management / garbage collection algorithms). There is often a chain of thought that manually handcrafted code is superior to generated code (in many ways higher level languages often logically generate low level languages). However as the amount of code that is written starts getting substantial, the sheer amount of logic we implement often overwhelms any ability to micro-optimise by carefully handcrafting code. Moreover as some control is taken away from programmers (eg, malloc/free), eventually good machine optimised algorithms can outperform manual code especially when done on a large scale (eg. generational garbage collectors do a wonderful job on the JVM). Most importantly the ability of virtual machines to dynamically monitor program execution and then generate native code for only the most frequently used parts of the code allows a wonderful balance. eg. in the article that set of this thread sprintf could not be inlined. Assuming it was feasible to inline it - it would effectively get inlined everywhere resulting in a much larger code bloat. Dynamic VMs can generate native inlined code only for the most frequently used call-sites (places where sprintf is called) of sprintf (as a arbitrary hypothetical case say only 5 out of 200 locations in the code - but these 5 effectively make up 99% of the runtime number of calls to sprintf). Finally because virtual machines can inspect the actual code behaviour at runtime make optimisations at runtime which are virtually impossible at compile or link time (eg. see http://en.wikipedia.org/wiki/Inline_caching for optimising dispatch to virtual methods). All put together there are a number of advantages that this approach has the potential to offer. In many ways PyPy is starting to show promise of delivering on these advantages now. However the design of a virtual machine based approach cannot be an incremental bolt-on to traditional runtimes, for all practical purposes, it needs a complete rewrite. From gopalakrishnan.subramani at gmail.com Wed Aug 3 23:05:47 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 3 Aug 2011 15:05:47 -0600 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> Message-ID: Thanks Dhananjay for detailed explanation. I spent some more time googling and their website. Seems to be extended from Psyco project. Based on my understanding, I may not need PyPy for general programming and small websites experiments as of now. Thanks & Regards, Gopal On Wed, Aug 3, 2011 at 11:10 AM, Dhananjay Nene wrote: > On Wed, Aug 3, 2011 at 9:58 PM, Gopalakrishnan Subramani > wrote: > > I could not understand the PyPy intention in having another run-time. > > > > Can we see having PyPy running Python programs, > > > > 1. As a challenge? (A language can have its own runtime with little > > improved performance) or > > 2. Potential for future to replace/co-exists CPython forever with strong > > community support? > > > > I like to understand, nowhere I am arguing. I don't code full time in > > Python, but I do code till I sleep like reading. > > For starters, you might want to check out > http://stackoverflow.com/questions/2970108/pypy-what-is-all-the-buzz-about > (I thought I had seen a much more detailed articulation of the reasons > for pypy, but couldn't quickly enough google for it). A Virtual > Machine based approach is a rather different approach which has over > the last decade started to show strong benefits (especially thanks to > the JVM really making strong advances in the area of virtual machine > engineering, and advanced memory management / garbage collection > algorithms). > > There is often a chain of thought that manually handcrafted code is > superior to generated code (in many ways higher level languages often > logically generate low level languages). However as the amount of code > that is written starts getting substantial, the sheer amount of logic > we implement often overwhelms any ability to micro-optimise by > carefully handcrafting code. Moreover as some control is taken away > from programmers (eg, malloc/free), eventually good machine optimised > algorithms can outperform manual code especially when done on a large > scale (eg. generational garbage collectors do a wonderful job on the > JVM). Most importantly the ability of virtual machines to dynamically > monitor program execution and then generate native code for only the > most frequently used parts of the code allows a wonderful balance. eg. > in the article that set of this thread sprintf could not be inlined. > Assuming it was feasible to inline it - it would effectively get > inlined everywhere resulting in a much larger code bloat. Dynamic VMs > can generate native inlined code only for the most frequently used > call-sites (places where sprintf is called) of sprintf (as a arbitrary > hypothetical case say only 5 out of 200 locations in the code - but > these 5 effectively make up 99% of the runtime number of calls to > sprintf). Finally because virtual machines can inspect the actual code > behaviour at runtime make optimisations at runtime which are virtually > impossible at compile or link time (eg. see > http://en.wikipedia.org/wiki/Inline_caching for optimising dispatch to > virtual methods). > > All put together there are a number of advantages that this approach > has the potential to offer. In many ways PyPy is starting to show > promise of delivering on these advantages now. However the design of a > virtual machine based approach cannot be an incremental bolt-on to > traditional runtimes, for all practical purposes, it needs a complete > rewrite. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From senthil at uthcode.com Thu Aug 4 14:39:36 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Thu, 4 Aug 2011 20:39:36 +0800 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> Message-ID: <20110804123935.GA2354@mathmagic> On Wed, Aug 03, 2011 at 03:05:47PM -0600, Gopalakrishnan Subramani wrote: > Based on my understanding, I may not need PyPy for general programming and > small websites experiments as of now. Just try it! Install pypy and symlink your /usr/local/bin/python to pypy interpreter. The whole point is, you won't see the difference. -- Senthil From noufal at gmail.com Thu Aug 4 14:42:37 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Thu, 04 Aug 2011 18:12:37 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <20110804123935.GA2354@mathmagic> (Senthil Kumaran's message of "Thu, 4 Aug 2011 20:39:36 +0800") References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> <20110804123935.GA2354@mathmagic> Message-ID: <87ipqde4aq.fsf@sanitarium.localdomain> Senthil Kumaran writes: > On Wed, Aug 03, 2011 at 03:05:47PM -0600, Gopalakrishnan Subramani wrote: >> Based on my understanding, I may not need PyPy for general programming and >> small websites experiments as of now. > > Just try it! Install pypy and symlink your /usr/local/bin/python to > pypy interpreter. The whole point is, you won't see the difference. Unless you use C extensions. :) -- ~noufal http://nibrahim.net.in A little pain never hurt anyone. From senthil at uthcode.com Thu Aug 4 14:57:40 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Thu, 4 Aug 2011 20:57:40 +0800 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <87ipqde4aq.fsf@sanitarium.localdomain> References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> <20110804123935.GA2354@mathmagic> <87ipqde4aq.fsf@sanitarium.localdomain> Message-ID: <20110804125739.GB2354@mathmagic> On Thu, Aug 04, 2011 at 06:12:37PM +0530, Noufal Ibrahim wrote: > Senthil Kumaran writes: > > Just try it! Install pypy and symlink your /usr/local/bin/python to > > pypy interpreter. The whole point is, you won't see the difference. > > Unless you use C extensions. :) > Depends upon which one again. :) http://morepypy.blogspot.com/2010/04/using-cpython-extension-modules-with.html From gopalakrishnan.subramani at gmail.com Fri Aug 5 01:35:33 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Thu, 4 Aug 2011 17:35:33 -0600 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <20110804125739.GB2354@mathmagic> References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> <20110804123935.GA2354@mathmagic> <87ipqde4aq.fsf@sanitarium.localdomain> <20110804125739.GB2354@mathmagic> Message-ID: I want to tryout Tornado with MongoDB (AsyncMongo).. I would try pypy as a runtime. Thanks for explanation!! Thanks & Regards, Gopal On Thu, Aug 4, 2011 at 6:57 AM, Senthil Kumaran wrote: > On Thu, Aug 04, 2011 at 06:12:37PM +0530, Noufal Ibrahim wrote: > > Senthil Kumaran writes: > > > Just try it! Install pypy and symlink your /usr/local/bin/python to > > > pypy interpreter. The whole point is, you won't see the difference. > > > > Unless you use C extensions. :) > > > Depends upon which one again. :) > > > http://morepypy.blogspot.com/2010/04/using-cpython-extension-modules-with.html > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From baiju.m.mail at gmail.com Fri Aug 5 05:16:29 2011 From: baiju.m.mail at gmail.com (Baiju M) Date: Fri, 5 Aug 2011 08:46:29 +0530 Subject: [BangPypers] PyPy outperforms C in microbenchmark In-Reply-To: <87ipqde4aq.fsf@sanitarium.localdomain> References: <87oc072c71.fsf@sanitarium.localdomain> <87r5530w4x.fsf@sanitarium.localdomain> <20110804123935.GA2354@mathmagic> <87ipqde4aq.fsf@sanitarium.localdomain> Message-ID: On Thu, Aug 4, 2011 at 6:12 PM, Noufal Ibrahim wrote: > Senthil Kumaran writes: > >> On Wed, Aug 03, 2011 at 03:05:47PM -0600, Gopalakrishnan Subramani wrote: >>> Based on my understanding, I may not need PyPy for general programming ?and >>> small websites experiments as of now. >> >> Just try it! Install pypy and symlink your /usr/local/bin/python to >> pypy interpreter. The whole point is, you won't see the difference. > > Unless you use C extensions. :) Support for C extension is improving in PyPy. Here is a small list which is known to work with PyPy: https://bitbucket.org/pypy/compatibility/wiki/CCompatible They have made progress on a complex C extension like wxPython: http://morepypy.blogspot.com/2010/05/running-wxpython-on-top-of-pypy.html Here is a big list of libraries/frameworks which works in PyPy: https://bitbucket.org/pypy/compatibility/wiki/Home Now a days I prefer to use 'ctypes' based extensions, so that it will work across CPython,PyPy,Jython & IronPython. Regards, Baiju M From apurvd2001 at yahoo.com Fri Aug 5 07:40:34 2011 From: apurvd2001 at yahoo.com (apurvd) Date: Thu, 4 Aug 2011 22:40:34 -0700 (PDT) Subject: [BangPypers] New to Python Message-ID: <1312522834.54886.YahooMailNeo@web120218.mail.ne1.yahoo.com> Hello Everyone! Does anyone know about the Python training course for beginner (or trainer's name, contact) in Pune area? Thanks. ? ------- Regards, Apurv From subhodipbiswas at gmail.com Fri Aug 5 12:18:52 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Fri, 5 Aug 2011 15:48:52 +0530 Subject: [BangPypers] [Error] AttributeError: Document instance has no attribute Message-ID: Hi all, I am using suds as a WSDL Consumption client. I get proper response in suds.sax.document format. For testing purpose I tried parsing the received document and get some specific items by getElementsByTagName style. However instead every time i try to do something I get this error : AttributeError: Document instance has no attribute someMethod SomeMethod can be toxml(), tostring() anything. I read this may be due to I am trying to invoke a private class. My invoke goes generally like : response = requestMethod(xmlfile) I am kind of stuck with this. Where am I going wrong here ? P.S : Request method accepts only the request xml as parameter. ------------- Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas From amit.pureenergy at gmail.com Fri Aug 5 12:37:03 2011 From: amit.pureenergy at gmail.com (Amit Sethi) Date: Fri, 5 Aug 2011 16:07:03 +0530 Subject: [BangPypers] [Error] AttributeError: Document instance has no attribute In-Reply-To: References: Message-ID: On Fri, Aug 5, 2011 at 3:48 PM, Subhodip Biswas wrote: > Hi all, > > I am using suds as a WSDL Consumption client. I get proper response in > suds.sax.document format. I am not exactly sure what you are trying to do but isn't sax supposed to be read on the fly , I do not think toxml,tostring etc functions should be there . I think you are supposed to specify handler for each tag and i don't think you can do a getElementsByTagName kind of thing. Although I think you need to give more detail as to what you are trying to do. -- A-M-I-T S|S From subhodipbiswas at gmail.com Fri Aug 5 18:29:55 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Fri, 5 Aug 2011 21:59:55 +0530 Subject: [BangPypers] [Error] AttributeError: Document instance has no attribute In-Reply-To: References: Message-ID: Hi, What I was trying to do is parse the suds response. The response is a sax document. I need some specific values from that xml document. I didn't wanted to use sax as I am using minidom somewhere else. I managed to convert the whole stuff in a string using str(myresponse). Still stuck but thats a suds related issue i guess. is there a better way of parsing suds response or sax document? any pointer or document will help. ------------- Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas On Fri, Aug 5, 2011 at 4:07 PM, Amit Sethi wrote: > On Fri, Aug 5, 2011 at 3:48 PM, Subhodip Biswas > wrote: >> Hi all, >> >> I am using suds as a WSDL Consumption client. I get proper response in >> suds.sax.document format. > > I am not exactly sure what you are trying to do but isn't sax supposed > to be read on the fly , I do not think toxml,tostring etc functions > should be there . I think you are supposed to specify handler for each > tag and i don't think you can ?do a > getElementsByTagName kind ?of thing. Although I think you need to give > more detail as to what you are trying to do. > > > > -- > A-M-I-T S|S > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From abhilash.pin2 at gmail.com Sun Aug 7 08:16:37 2011 From: abhilash.pin2 at gmail.com (=?UTF-8?B?YcOfbOC5gM6vbM6xc2zguYA=?=) Date: Sun, 7 Aug 2011 11:46:37 +0530 Subject: [BangPypers] windows(Access Denied Error) Message-ID: Hi, I am using shutil.rmtree() to delete folders & all its files(windows), getting Access Denied Error. Yes, the folder set to be readonly by default but can delete these manually from my login. More over python is installed by Admin login. Let me know a way to solve it. -- a?l??l?sl? From madhav.bnk at gmail.com Sun Aug 7 08:21:26 2011 From: madhav.bnk at gmail.com (B.Nanda Kishore) Date: Sun, 7 Aug 2011 11:51:26 +0530 Subject: [BangPypers] windows(Access Denied Error) In-Reply-To: References: Message-ID: I had a similar problem and solved it after using win32 extensions. Regards, Nandakishore On Sun, Aug 7, 2011 at 11:46 AM, a?l??l?sl? wrote: > Hi, > I am using shutil.rmtree() to delete folders & all its files(windows), > getting Access Denied Error. > Yes, the folder set to be readonly by default but can delete these > manually from my login. > More over python is installed by Admin login. Let me know a way to solve > it. > > > -- > a?l??l?sl? > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From asif.jamadar at rezayat.net Mon Aug 8 10:22:06 2011 From: asif.jamadar at rezayat.net (Asif Jamadar) Date: Mon, 8 Aug 2011 08:22:06 +0000 Subject: [BangPypers] Mysqldb and Pyodbc Message-ID: Hi, I have already installed mysqldb on ubuntu machine. Now I want to install Pyodbc, so whether it will affect mysqldb package? From kracethekingmaker at gmail.com Tue Aug 9 17:35:52 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Tue, 9 Aug 2011 21:05:52 +0530 Subject: [BangPypers] Python T-shirt Message-ID: I am looking for python T-shirt in India.I googled, evrything in vain, the problem is I don't have Credit card or international payment option, i can use netbanking. -- *Winning Regards KraceKumar.R http://kracekumar.wordpress.com +91-97906-58304 * From paras.choudhary at 21iitjee.com Tue Aug 9 17:55:54 2011 From: paras.choudhary at 21iitjee.com (Paras Choudhary) Date: Tue, 9 Aug 2011 21:25:54 +0530 Subject: [BangPypers] Need Python Developers In-Reply-To: References: Message-ID: Hi, I need a Python developer for a project. Could you please refer me to someone you know is good? Thanks Paras -- Paras Choudhary B.Tech, M.Tech, IIT Bombay Doctoral Candidate, Pennsylvania State University +91 9167839773 paras.choudhary at gmail.com From senthil at uthcode.com Wed Aug 10 02:10:09 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Wed, 10 Aug 2011 08:10:09 +0800 Subject: [BangPypers] Python T-shirt In-Reply-To: References: Message-ID: <20110810001008.GC2654@mathmagic> On Tue, Aug 09, 2011 at 09:05:52PM +0530, kracekumar ramaraju wrote: > I am looking for python T-shirt in India.I googled, evrything in vain, the > problem is I don't have Credit card or international payment option, i can > use netbanking. > You can take any of your logo and go to Photo printing shops and print yourself a T-Shirt. You can use cash too. Or register and attend the upcoming pycon and get one for free! -- Senthil From gladiatorg4 at gmail.com Wed Aug 10 06:29:59 2011 From: gladiatorg4 at gmail.com (gladiatorg4 at gmail.com) Date: Wed, 10 Aug 2011 04:29:59 +0000 Subject: [BangPypers] Need Python Developers Message-ID: <4e42094a.cc43d80a.0a3f.134c@mx.google.com> Hi, I wouls like to know more about the project could you please let me know. Is it a fulltime or parttime. Regards, Joseph ------Original message------ From: Paras Choudhary To: "bangpypers" Date: Tuesday, August 9, 2011 9:25:54 PM GMT+0530 Subject: [BangPypers] Need Python Developers Hi, I need a Python developer for a project. Could you please refer me to someone you know is good? Thanks Paras -- Paras Choudhary B.Tech, M.Tech, IIT Bombay Doctoral Candidate, Pennsylvania State University +91 9167839773 paras.choudhary at gmail.com _______________________________________________ BangPypers mailing list BangPypers at python.org http://mail.python.org/mailman/listinfo/bangpypers From dapurv5 at gmail.com Wed Aug 10 09:07:52 2011 From: dapurv5 at gmail.com (Apurv Verma) Date: Wed, 10 Aug 2011 12:37:52 +0530 Subject: [BangPypers] Need Python Developers In-Reply-To: <4e42094a.cc43d80a.0a3f.134c@mx.google.com> References: <4e42094a.cc43d80a.0a3f.134c@mx.google.com> Message-ID: Hi Paras, I guess good must only be a euphemism for exceptionally bright or awesome. I am not these both. I have had experience of programming in python. I am mainly a Java programmer though python is also my prominent love. I am assigned a project as part of my curriculum in software engineering wherein I have to make a sufficiently large system in the django framework, so I was wondering if I could combine my course project with the work that you possibly have for me. I still have to learn django this semester. The professor is open to any moderately large project that requires the utilization of software design principles. -- thanks and regards, ~Apurv Verma B. Tech.(CSE) IIT- Ropar Mobile - 09256587545 On Wed, Aug 10, 2011 at 9:59 AM, wrote: > Hi, > > I wouls like to know more about the project could you please let me know. > Is it a fulltime or parttime. > > Regards, > > Joseph > > > ------Original message------ > From: Paras Choudhary > To: "bangpypers" > Date: Tuesday, August 9, 2011 9:25:54 PM GMT+0530 > Subject: [BangPypers] Need Python Developers > > Hi, > > I need a Python developer for a project. > Could you please refer me to someone you know is good? > > Thanks > Paras > > -- > Paras Choudhary > B.Tech, M.Tech, IIT Bombay > Doctoral Candidate, Pennsylvania State University > +91 9167839773 > paras.choudhary at gmail.com > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From lorddaemon at gmail.com Wed Aug 10 09:10:21 2011 From: lorddaemon at gmail.com (Sidu Ponnappa) Date: Wed, 10 Aug 2011 12:40:21 +0530 Subject: [BangPypers] Need Python Developers In-Reply-To: References: <4e42094a.cc43d80a.0a3f.134c@mx.google.com> Message-ID: No offense, but could you please take this discussion off-list? On Wed, Aug 10, 2011 at 12:37 PM, Apurv Verma wrote: > Hi Paras, > ?I guess good must only be a euphemism for exceptionally bright or awesome. > I am not these both. I have had experience of programming in python. I am > mainly a Java programmer though python is also my prominent love. > I am assigned a project as part of my curriculum in software engineering > wherein I have to make a sufficiently large system in the django framework, > so I was wondering if I could combine my course project with the work that > you possibly have for me. I still have to learn django this semester. The > professor is open to any moderately large project that requires the > utilization of software design principles. > > > -- > thanks and regards, > > ~Apurv Verma > ? B. Tech.(CSE) > ? IIT- Ropar > ? Mobile - 09256587545 > > > > > > > On Wed, Aug 10, 2011 at 9:59 AM, wrote: > >> Hi, >> >> I wouls like to know more about the project could you please let me know. >> Is it a fulltime or parttime. >> >> Regards, >> >> Joseph >> >> >> ------Original message------ >> From: Paras Choudhary >> To: "bangpypers" >> Date: Tuesday, August 9, 2011 9:25:54 PM GMT+0530 >> Subject: [BangPypers] Need Python Developers >> >> Hi, >> >> I need a Python developer for a project. >> Could you please refer me to someone you know is good? >> >> Thanks >> Paras >> >> -- >> Paras Choudhary >> B.Tech, M.Tech, IIT Bombay >> Doctoral Candidate, Pennsylvania State University >> +91 9167839773 >> paras.choudhary at gmail.com >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dapurv5 at gmail.com Wed Aug 10 09:15:24 2011 From: dapurv5 at gmail.com (Apurv Verma) Date: Wed, 10 Aug 2011 12:45:24 +0530 Subject: [BangPypers] Need Python Developers In-Reply-To: References: <4e42094a.cc43d80a.0a3f.134c@mx.google.com> Message-ID: Yeah sorry apologies. ~Apurv Verma B. Tech.(CSE) IIT- Ropar Mobile - 09256587545 On Wed, Aug 10, 2011 at 12:40 PM, Sidu Ponnappa wrote: > No offense, but could you please take this discussion off-list? > > On Wed, Aug 10, 2011 at 12:37 PM, Apurv Verma wrote: > > Hi Paras, > > I guess good must only be a euphemism for exceptionally bright or > awesome. > > I am not these both. I have had experience of programming in python. I am > > mainly a Java programmer though python is also my prominent love. > > I am assigned a project as part of my curriculum in software engineering > > wherein I have to make a sufficiently large system in the django > framework, > > so I was wondering if I could combine my course project with the work > that > > you possibly have for me. I still have to learn django this semester. The > > professor is open to any moderately large project that requires the > > utilization of software design principles. > > > > > > -- > > thanks and regards, > > > > ~Apurv Verma > > B. Tech.(CSE) > > IIT- Ropar > > Mobile - 09256587545 > > > > > > > > > > > > > > On Wed, Aug 10, 2011 at 9:59 AM, wrote: > > > >> Hi, > >> > >> I wouls like to know more about the project could you please let me > know. > >> Is it a fulltime or parttime. > >> > >> Regards, > >> > >> Joseph > >> > >> > >> ------Original message------ > >> From: Paras Choudhary > >> To: "bangpypers" > >> Date: Tuesday, August 9, 2011 9:25:54 PM GMT+0530 > >> Subject: [BangPypers] Need Python Developers > >> > >> Hi, > >> > >> I need a Python developer for a project. > >> Could you please refer me to someone you know is good? > >> > >> Thanks > >> Paras > >> > >> -- > >> Paras Choudhary > >> B.Tech, M.Tech, IIT Bombay > >> Doctoral Candidate, Pennsylvania State University > >> +91 9167839773 > >> paras.choudhary at gmail.com > >> _______________________________________________ > >> BangPypers mailing list > >> BangPypers at python.org > >> http://mail.python.org/mailman/listinfo/bangpypers > >> > >> _______________________________________________ > >> BangPypers mailing list > >> BangPypers at python.org > >> http://mail.python.org/mailman/listinfo/bangpypers > >> > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From senthil at uthcode.com Wed Aug 10 14:36:33 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Wed, 10 Aug 2011 20:36:33 +0800 Subject: [BangPypers] Fw: ffnet-0.7 released In-Reply-To: <201108090256.32030.mwojc@p.lodz.pl> References: <201108090256.32030.mwojc@p.lodz.pl> Message-ID: <20110810123633.GB2116@mathmagic> I am not sure if, if still Neural networks hype is present in colleges. But it used be high! http://sourceforge.net/projects/ffnet/ Seems to be nice library to deal with feed forward neural network. On Tue, Aug 09, 2011 at 02:56:31AM +0200, Marek Wojciechowski wrote: > ffnet version 0.7 has been released and is available for download at: > > http://sourceforge.net/projects/ffnet/ > > This release contains couple of important changes: > - neural network can be trained now using the power of multi-processor > systems (see example mptrain.py) > - attributes necessary for calculation of network derivatives > are now generated only on demand; > - data normalization limits are not changed when re-trainig with new > data set; net.renormalize=True have to be set first; > - compatibility with newest versions of numpy, scipy and networkx > is enhanced; > - support for *export to java* and *drawing network with drawffnet* > is dropped. > Basic API is left almost untouched. Exactly the same trainig scriptsas > for older versions should work without problems. > > > What is ffnet? > -------------- > ffnet is a fast and easy-to-use feed-forward neuralnetwork training > solution for python. > > Unique features present in ffnet > -------------------------------- > 1. Any network connectivity without cycles is allowed. > 2. Training can be performed with use of several optimization > schemes including: standard backpropagation with momentum, rprop, > conjugate gradient, bfgs, tnc (with multiprocessing) > and genetic alorithm based optimization. > 3. There is access to exact partial derivatives of network outputs > vs. its inputs. > 4. Automatic normalization of data. > > Basic assumptions and limitations > --------------------------------- > 1. Network has feed-forward architecture. > 2. Input units have identity activation function, all other units > have sigmoid activation function. > 3. Provided data are automatically normalized, both input and > output, with a linear mapping to the range (0.15, 0.85). > Each input and output is treated separately (i.e. linear map is > unique for each input and output). > 4. Function minimized during training is a sum of squared errors of > each output for each training pattern. > > Performance > ----------- > Excellent computational performance is achieved implementing core > functions in fortran 77 and wrapping them with f2py. ffnet outstands > in performance pure python training packages and is competitive to > 'compiled language' software. Incorporation of multiprocessing capabilities > (tnc algorithm so far) makes ffnet ideal for large scale (really!) > problems. Moreover, a trained network can be exported to fortran > sources,compiled and called from many programming languages. > > Usage > ----- > Basic usage of the package is outlined below.See description of > ffnet module and its functions(and especially ffnet class) for > detailed explanations. > > >>>from ffnet import ffnet, mlgraph, savenet, loadnet, exportnet > >>>conec = mlgraph( (2,2,1) ) > >>>net = ffnet(conec) > >>>input = [ [0.,0.], [0.,1.], [1.,0.], [1.,1.] ] > >>>target = [ [1.], [0.], [0.], [1.] ] > >>>net.train_tnc(input, target, maxfun = 1000) > >>>net.test(input, target, iprint = 2) > >>>savenet(net, "xor.net") > >>>exportnet(net, "xor.f") > >>>net = loadnet("xor.net") > >>>answer = net( [ 0., 0. ] ) > >>>partial_derivatives = net.derivative( [ 0., 0. ] ) > > Usage examples with full description can be found inexamples > directory of the source distribution. > > -- > Marek Wojciechowski > -- > http://mail.python.org/mailman/listinfo/python-announce-list > > Support the Python Software Foundation: > http://www.python.org/psf/donations/ From kracethekingmaker at gmail.com Wed Aug 10 15:26:00 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Wed, 10 Aug 2011 18:56:00 +0530 Subject: [BangPypers] Python T-shirt In-Reply-To: <20110810001008.GC2654@mathmagic> References: <20110810001008.GC2654@mathmagic> Message-ID: I am attending pycon :), but quality matters From senthil at uthcode.com Wed Aug 10 15:29:40 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Wed, 10 Aug 2011 21:29:40 +0800 Subject: [BangPypers] Python T-shirt In-Reply-To: References: <20110810001008.GC2654@mathmagic> Message-ID: <20110810132940.GF2116@mathmagic> On Wed, Aug 10, 2011 at 06:56:00PM +0530, kracekumar ramaraju wrote: > I am attending pycon :), but quality matters Of course, the photoshops won't mind printing the Python logos on Ralph Lauren t-shirts. -- Senthil From kracethekingmaker at gmail.com Wed Aug 10 15:32:55 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Wed, 10 Aug 2011 19:02:55 +0530 Subject: [BangPypers] Python T-shirt In-Reply-To: <20110810132940.GF2116@mathmagic> References: <20110810001008.GC2654@mathmagic> <20110810132940.GF2116@mathmagic> Message-ID: problem is garment factory ask for 5+ T-shirt order. From nitin.nitp at gmail.com Wed Aug 10 19:01:49 2011 From: nitin.nitp at gmail.com (Nitin Kumar) Date: Wed, 10 Aug 2011 22:31:49 +0530 Subject: [BangPypers] Python T-shirt In-Reply-To: References: <20110810001008.GC2654@mathmagic> Message-ID: whatever we got in last pycon was of very good quality and with good logo. So i don't know how you wrote that.... On Wed, Aug 10, 2011 at 6:56 PM, kracekumar ramaraju < kracethekingmaker at gmail.com> wrote: > I am attending pycon :), but quality matters > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- Nitin K From gora at mimirtech.com Wed Aug 10 20:15:53 2011 From: gora at mimirtech.com (Gora Mohanty) Date: Wed, 10 Aug 2011 23:45:53 +0530 Subject: [BangPypers] Python T-shirt In-Reply-To: References: <20110810001008.GC2654@mathmagic> Message-ID: On Wed, Aug 10, 2011 at 10:31 PM, Nitin Kumar wrote: > whatever we got in last pycon was of very good quality and with good logo. > So i don't know how you wrote that.... [...] As already requested, please take this discussion offline. Thanks. Regards, Gora From vikasruhil06 at gmail.com Thu Aug 11 11:54:09 2011 From: vikasruhil06 at gmail.com (vikas ruhil) Date: Thu, 11 Aug 2011 15:24:09 +0530 Subject: [BangPypers] how to write Operating System in python Message-ID: I am looking towards to write an operating system in Python? How i can write kernel and kernel calls on Debian Linux ! any body can help reagrd this !! From noufal at gmail.com Thu Aug 11 11:56:26 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Thu, 11 Aug 2011 15:26:26 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: (vikas ruhil's message of "Thu, 11 Aug 2011 15:24:09 +0530") References: Message-ID: <87ty9oz2yd.fsf@sanitarium.localdomain> vikas ruhil writes: > I am looking towards to write an operating system in Python? How i can > write kernel and kernel calls on Debian Linux ! any body can help > reagrd this !! [...] I mailed a while ago about choosing the right tool for a given task (as opposed to seeing everything as a nail). Are there any reasons why you're interested in doing this in Python (as opposed to say Ruby)? -- ~noufal http://nibrahim.net.in I marvel at the strength of human weakness. From lawgon at gmail.com Thu Aug 11 12:01:29 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Thu, 11 Aug 2011 15:31:29 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: <87ty9oz2yd.fsf@sanitarium.localdomain> References: <87ty9oz2yd.fsf@sanitarium.localdomain> Message-ID: <1313056893.23144.47.camel@xlquest.web> On Thu, 2011-08-11 at 15:26 +0530, Noufal Ibrahim wrote: > vikas ruhil writes: > > > I am looking towards to write an operating system in Python? How i > can > > write kernel and kernel calls on Debian Linux ! any body can help > > reagrd this !! > > [...] > > I mailed a while ago about choosing the right tool for a given task > (as > opposed to seeing everything as a nail). > > Are there any reasons why you're interested in doing this in Python > (as > opposed to say Ruby)? or C? -- regards Kenneth Gonsalves From venkat83 at gmail.com Thu Aug 11 12:01:38 2011 From: venkat83 at gmail.com (Venkatraman S) Date: Thu, 11 Aug 2011 15:31:38 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil wrote: > I am looking towards to write an operating system in Python? How i can > write kernel and kernel calls on Debian Linux ! any body can help reagrd > this !! > http://www.jtauber.com/cleese From dhananjay.nene at gmail.com Thu Aug 11 12:17:50 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Thu, 11 Aug 2011 15:47:50 +0530 Subject: [BangPypers] Would pypy result in a recast of what are the more efficient pythonic idioms ? Message-ID: I had done some benchmarking of code in various languages 3 years ago. I had not chosen to implement either the most efficient code, instead preferring to stick to a specific style of implementation. (The experiment is documented at http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/) Curiously I revisited it today and tried it with pypy. The results were most remarkable. The python code as mentioned today required 112 ?seconds on cPython 2.6 while it ended up requiring only 4.4 ?seconds on PyPy (1.5 alpha). What was even more curious was if one wrote the code differently eg. the following alternative implementation as suggested in one of the comments. def findlast(chainlength = 40, kill = 3): firstinc, c = 1, range(1,chainlength + 1) while len(c)>1: c, firstinc = [x for n,x in enumerate(c) if (firstinc+n) % 3], (n+1 + firstinc) %3 return c import time ITER = 100000 print findlast() start = time.time() for i in range(ITER): findlast() end = time.time() print 'Time per iteration = %s microseconds ' % ((end - start) * 1000000 / ITER) This code times in at about 31 ?sec on cPython 2.6 vs 7.45 ?seconds on PyPy So - the code that was 4 times faster on cPython is now 60% as fast on PyPy. Assuming more examples like this show up - I would imagine the definition of efficient pythonic idiom to be evolving rather fast in a different direction as pypy catches traction. Dhananjay -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From cjgiridhar at gmail.com Thu Aug 11 12:50:15 2011 From: cjgiridhar at gmail.com (chetan giridhar) Date: Thu, 11 Aug 2011 16:20:15 +0530 Subject: [BangPypers] Would pypy result in a recast of what are the more efficient pythonic idioms ? In-Reply-To: References: Message-ID: Out of curiosity ran the code in Python 3.2 and Python 2.7. Python 2.7: 30 ?sec Python 3.2: 35 ?sec Regards, Chetan On Thu, Aug 11, 2011 at 3:47 PM, Dhananjay Nene wrote: > I had done some benchmarking of code in various languages 3 years ago. I > had > not chosen to implement either the most efficient code, instead preferring > to stick to a specific style of implementation. (The experiment is > documented at > > http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/ > ) > > Curiously I revisited it today and tried it with pypy. The results were > most > remarkable. > > The python code as mentioned today required 112 ?seconds on cPython 2.6 > while it ended up requiring only 4.4 ?seconds on PyPy (1.5 alpha). > > What was even more curious was if one wrote the code differently eg. the > following alternative implementation as suggested in one of the comments. > > def findlast(chainlength = 40, kill = 3): > firstinc, c = 1, range(1,chainlength + 1) > while len(c)>1: > c, firstinc = [x for n,x in enumerate(c) if (firstinc+n) % 3], (n+1 > + firstinc) %3 > return c > > import time > ITER = 100000 > print findlast() > start = time.time() > for i in range(ITER): > findlast() > end = time.time() > print 'Time per iteration = %s microseconds ' % ((end - start) * 1000000 / > ITER) > > This code times in at about 31 ?sec on cPython 2.6 vs 7.45 ?seconds on PyPy > > So - the code that was 4 times faster on cPython is now 60% as fast on > PyPy. > Assuming more examples like this show up - I would imagine the definition > of > efficient pythonic idiom to be evolving rather fast in a different > direction > as pypy catches traction. > > Dhananjay > > -- > > ---------------------------------------------------------------------------------------------------------------------------------- > http://blog.dhananjaynene.com twitter: @dnene > google plus: > http://gplus.to/dhananjaynene > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- Regards, Chetan http://technobeans.com From lorddaemon at gmail.com Thu Aug 11 15:06:24 2011 From: lorddaemon at gmail.com (Sidu Ponnappa) Date: Thu, 11 Aug 2011 18:36:24 +0530 Subject: [BangPypers] [JOB] C42 Engineering is hiring Message-ID: Hello everyone, C42 Engineering is looking for talented and passionate programmers. You *do not* have to have prior experience in Ruby or Rails to apply - all we care about is that you enjoy programming and that you're good at it. Here's an extract from our careers page[1] - if you fall into one or more of these categories, you'll probably fit right in. * You care about writing code, and writing it well * You are a polyglot programmer and are comfortable with several programming languages * You are passionate about products and product development * You test drive all your code * You are familiar with eXtreme Programming (XP) * You contribute to open source projects * You love both teaching and learning, and take pleasure in getting better at what you do * You want to work with like minded, intelligent people you can have a real conversation with * You aren't overly fond of conformity, especially in the context of being a faceless cog in a big company * You value decency and integrity, and prefer working with other people who do so too Here's a quick outline of the company: * C42 Engineering is a 1.5 year old boutique Ruby and Rails consultancy. * We follow an Agile/XP setup where we test drive all our code and pair program throughout. * We have nascent product and training arms. ** We did our first public training session[2] last month. ** We are on the verge of launching the beta of our first product. * We are deeply involved in the Ruby community. ** We contribute to open-source via both our own projects[3] as well as patches to existing projects[4] like RSpec. ** Our top three open-source projects combined have ~350 watchers and ~50 forks. ** We speak fairly frequently at various conferences[5]. Our talks have been accepted at the international RubyConf for two consecutive years now. ** We were one of the sponsors of RubyConf India[6] and we are committed to supporting this event in the future. * We obsess over integrity and transparency. Internally, all finances and salaries are open. * We pay extremely competitive salaries. As we say on our careers page, we may not match top paymasters like Amazon and Google, but we're within shouting distance. * We understand that snacking and hacking go hand-in-hand and so maintain a fully stocked pantry. * We play video games. For more information, please take a look at our careers page[1]. Thanks, Sidu Ponnappa. http://sidu.in [1] http://c42.in/careers [2] http://c42-ruby-tdd-jul11.doattend.com [3] http://github.com/c42 [4] http://github.com/c42engineering [5] http://blog.c42.in/tag/conference [6] http://rubyconfindia.org/2011/sponsors.html#c42-engineering From vikasruhil06 at gmail.com Thu Aug 11 17:15:18 2011 From: vikasruhil06 at gmail.com (vikas ruhil) Date: Thu, 11 Aug 2011 20:45:18 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: >hey i just want see something that really powered by python such as GAE and django >I am thinking Whyn't explore any potential in field of operating system So we can create more secure Systems > any body can guide or tell how start it from where or some other relevance links related this Issue On Thu, Aug 11, 2011 at 3:31 PM, Venkatraman S wrote: > On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil > wrote: > > > I am looking towards to write an operating system in Python? How i can > > write kernel and kernel calls on Debian Linux ! any body can help reagrd > > this !! > > > > http://www.jtauber.com/cleese > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dapurv5 at gmail.com Thu Aug 11 19:02:20 2011 From: dapurv5 at gmail.com (Apurv Verma) Date: Thu, 11 Aug 2011 22:32:20 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: Hey I was really amazed by the complexity of the idea, since a complete operating system might be something too elusive. I don't know exactly whether Python would be able to meet all the requirements. But as far a simple OS is concerned you can look at Pintos. ~Apurv Verma B. Tech.(CSE) IIT- Ropar Mobile - 09256587545 On Thu, Aug 11, 2011 at 8:45 PM, vikas ruhil wrote: > >hey i just want see something that really powered by python such as GAE > and > django > >I am thinking Whyn't explore any potential in field of operating system So > we can create more secure Systems > > any body can guide or tell how start it from where or some other > relevance > links related this Issue > > On Thu, Aug 11, 2011 at 3:31 PM, Venkatraman S wrote: > > > On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil > > wrote: > > > > > I am looking towards to write an operating system in Python? How i > can > > > write kernel and kernel calls on Debian Linux ! any body can help > reagrd > > > this !! > > > > > > > http://www.jtauber.com/cleese > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From lgp171188 at gmail.com Thu Aug 11 19:08:59 2011 From: lgp171188 at gmail.com (L. Guruprasad) Date: Thu, 11 Aug 2011 22:38:59 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: <87ty9oz2yd.fsf@sanitarium.localdomain> References: <87ty9oz2yd.fsf@sanitarium.localdomain> Message-ID: <4E440CAB.10006@gmail.com> Hi Vikas, On Thursday 11 August 2011 03:26 PM, Noufal Ibrahim wrote: > vikas ruhil writes: > >> I am looking towards to write an operating system in Python? How i can >> write kernel and kernel calls on Debian Linux ! any body can help >> reagrd this !! > > I mailed a while ago about choosing the right tool for a given task (as > opposed to seeing everything as a nail). > > Are there any reasons why you're interested in doing this in Python (as > opposed to say Ruby)? I totally agree with Noufal here. But searching the web for similar attempts, I found these http://jtauber.com/cleese/ https://launchpad.net/pycorn Not sure how active these attempts are and whether it is really possible to achieve something like this. Thanks & Regards, Guruprasad From gopalakrishnan.subramani at gmail.com Thu Aug 11 21:02:26 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Thu, 11 Aug 2011 13:02:26 -0600 Subject: [BangPypers] how to write Operating System in python In-Reply-To: <4E440CAB.10006@gmail.com> References: <87ty9oz2yd.fsf@sanitarium.localdomain> <4E440CAB.10006@gmail.com> Message-ID: Look at the Lua attempt to create OS. http://luaos.net/ Lua script is more readable. Personally, I would never prefer to create an OS in Python. If you get minimal open sourced RTOS source code (many found in sourge forge), you could start with basic and see the similar approach in Python. If you need secure environment like GAE, you need to re-implement many Python APIs & language runtime than re-writing everything from scratch.. You know that processor still needs machine instructions to boot. Hope you are not serious enough to get started :-). Your reasoning is not sound good. All the best for your initiatives if you really get started. -- Gopal On Thu, Aug 11, 2011 at 11:08 AM, L. Guruprasad wrote: > Hi Vikas, > > On Thursday 11 August 2011 03:26 PM, Noufal Ibrahim wrote: > >> vikas ruhil writes: >> >> I am looking towards to write an operating system in Python? How i can >>> write kernel and kernel calls on Debian Linux ! any body can help >>> reagrd this !! >>> >> >> I mailed a while ago about choosing the right tool for a given task (as >> opposed to seeing everything as a nail). >> >> Are there any reasons why you're interested in doing this in Python (as >> opposed to say Ruby)? >> > > I totally agree with Noufal here. But searching the web for similar > attempts, I found these > > http://jtauber.com/cleese/ > https://launchpad.net/pycorn > > Not sure how active these attempts are and whether it is really possible to > achieve something like this. > > Thanks & Regards, > Guruprasad > > ______________________________**_________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/**mailman/listinfo/bangpypers > From zaki at manian.org Fri Aug 12 01:06:40 2011 From: zaki at manian.org (zaki at manian.org) Date: Thu, 11 Aug 2011 16:06:40 -0700 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: <87ty9oz2yd.fsf@sanitarium.localdomain> <4E440CAB.10006@gmail.com> Message-ID: There has been some interesting work done with self hosting virtual machines for languages like http://halvm.org/wiki/ It seems some what self defeating to try to recreate the device drivers to run on actual hardware. But a minimal python environment running on KVM would be of pratical use to many people. On Thu, Aug 11, 2011 at 12:02 PM, Gopalakrishnan Subramani < gopalakrishnan.subramani at gmail.com> wrote: > Look at the Lua attempt to create OS. http://luaos.net/ Lua script is > more > readable. > > Personally, I would never prefer to create an OS in Python. If you get > minimal open sourced RTOS source code (many found in sourge forge), you > could start with basic and see the similar approach in Python. > > If you need secure environment like GAE, you need to re-implement many > Python APIs & language runtime than re-writing everything from scratch.. > You > know that processor still needs machine instructions to boot. > > Hope you are not serious enough to get started :-). Your reasoning is not > sound good. All the best for your initiatives if you really get started. > > -- > Gopal > > > > > > > On Thu, Aug 11, 2011 at 11:08 AM, L. Guruprasad > wrote: > > > Hi Vikas, > > > > On Thursday 11 August 2011 03:26 PM, Noufal Ibrahim wrote: > > > >> vikas ruhil writes: > >> > >> I am looking towards to write an operating system in Python? How i can > >>> write kernel and kernel calls on Debian Linux ! any body can help > >>> reagrd this !! > >>> > >> > >> I mailed a while ago about choosing the right tool for a given task (as > >> opposed to seeing everything as a nail). > >> > >> Are there any reasons why you're interested in doing this in Python (as > >> opposed to say Ruby)? > >> > > > > I totally agree with Noufal here. But searching the web for similar > > attempts, I found these > > > > http://jtauber.com/cleese/ > > https://launchpad.net/pycorn > > > > Not sure how active these attempts are and whether it is really possible > to > > achieve something like this. > > > > Thanks & Regards, > > Guruprasad > > > > ______________________________**_________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/**mailman/listinfo/bangpypers< > http://mail.python.org/mailman/listinfo/bangpypers> > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From mandarvaze at gmail.com Fri Aug 12 08:36:23 2011 From: mandarvaze at gmail.com (=?UTF-8?B?TWFuZGFyIFZhemUgLyDgpK7gpILgpKbgpL7gpLAg4KS14KSd4KWH?=) Date: Fri, 12 Aug 2011 12:06:23 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: > > On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil > > wrote: > > > > > I am looking towards to write an operating system in Python? How i > can > > > write kernel and kernel calls on Debian Linux ! any body can help > reagrd > > > this !! > > > > > > > http://www.jtauber.com/cleese > What is your definition of operating system "in python" ? Several source files of cleese project are still in "C" (booting, malloc, keyboard, cpu, video, ports ..... ) -Mandar From vikasruhil06 at gmail.com Fri Aug 12 11:58:07 2011 From: vikasruhil06 at gmail.com (vikas ruhil) Date: Fri, 12 Aug 2011 15:28:07 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: Thanks to all for useful information , Motivation and Inspiration to me . As i have hobby to code in python might try put my effort with my best.now need to focus. Someone want to share some more positive python related motivation ,help, documents , anything else !! 2011/8/12 Mandar Vaze / ????? ??? > > > On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil > > > wrote: > > > > > > > I am looking towards to write an operating system in Python? How i > > can > > > > write kernel and kernel calls on Debian Linux ! any body can help > > reagrd > > > > this !! > > > > > > > > > > http://www.jtauber.com/cleese > > > > What is your definition of operating system "in python" ? > > Several source files of cleese project are still in "C" (booting, malloc, > keyboard, cpu, video, ports ..... ) > > -Mandar > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From kracethekingmaker at gmail.com Fri Aug 12 19:06:03 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Fri, 12 Aug 2011 22:36:03 +0530 Subject: [BangPypers] Create Better Python community Message-ID: Things you could do to improve diversity in the Python community. (Quoting without permission from a thoughtful post on the Python diversity list; s/Python/Your project/ to suit your taste.) - At the next Python event you are at, make a point to talk to someone diverse or new. - Before going to your next Python event, email/call/contact someone diverse from the community and encourage them to meet you there. - Encourage diverse non-programmers you know to come to Python for beginners events. - Sit down with a diverse non-programmer and teach them the basics of Python. - Recommend a diverse Python programmer for a job (even if they already have one). - Organize a weekend workshop like the "Boston Python Workshop for women and their friends" in your city (feel free to ask for all the documents -- Jessica has made this easy). - Organize an event for women Python developers (or another diversity group) -- could be a cocktail party, a networking event, a barbeque.... - Run your own meetup event to teach a topic you know, and spread the word to your diverse Python friends to bring a friend (diverse or not -- bringing friends makes everyone feel comfortable). I got this content from Guido's stream in Google+. -- * "Talk is cheap, show me the code" - Linus Torvalds Winning Regards KraceKumar.R http://kracekumar.wordpress.com +91-97906-58304 * *+91-85530-29521* * * From lawgon at gmail.com Sat Aug 13 05:33:56 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Sat, 13 Aug 2011 09:03:56 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: Message-ID: <1313206439.23144.60.camel@xlquest.web> On Fri, 2011-08-12 at 22:36 +0530, kracekumar ramaraju wrote: > Things you could do to improve diversity what is a diverse person? -- regards Kenneth Gonsalves From kracethekingmaker at gmail.com Sat Aug 13 06:29:16 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Sat, 13 Aug 2011 09:59:16 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <1313206439.23144.60.camel@xlquest.web> References: <1313206439.23144.60.camel@xlquest.web> Message-ID: Diverse person can be person from PHP, Java community newly entering Python Community or can be NON-Programming background. From noufal at gmail.com Sat Aug 13 09:04:47 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Sat, 13 Aug 2011 12:34:47 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (kracekumar ramaraju's message of "Fri, 12 Aug 2011 22:36:03 +0530") References: Message-ID: <877h6hvlkg.fsf@sanitarium.localdomain> kracekumar ramaraju writes: > Things you could do to improve diversity in the Python > community. (Quoting without permission from a thoughtful post on the > Python diversity list; s/Python/Your project/ to suit your taste.) [...] It would be nice to just have python user group meetings in Bangalore regularly even if they're not particularly "diverse". -- ~noufal http://nibrahim.net.in "I always avoid prophesying beforehand because it is much better to prophesy after the event has already taken place. " - Winston Churchill From ansalansari at gmail.com Sun Aug 14 17:43:30 2011 From: ansalansari at gmail.com (Ansal) Date: Sun, 14 Aug 2011 21:13:30 +0530 Subject: [BangPypers] Django - share login sessions on sub-domain Message-ID: Hi, I have a django app running on my domain. I have another django app running on its subdomain. How can I share the same login session on this subdomain? Some websites are saying to set SESSION_COOKIE_DOMAIN = '.mydomain.com' in settings.py in the first app. But it won't work. If i set the same in sub domain's app, I am automatically getting logged out. So, what should I do to get this done? Thanks in advance, Ansal. From lorddaemon at gmail.com Mon Aug 15 01:38:34 2011 From: lorddaemon at gmail.com (Sidu Ponnappa) Date: Mon, 15 Aug 2011 05:08:34 +0530 Subject: [BangPypers] Django - share login sessions on sub-domain In-Reply-To: References: Message-ID: If these are two different apps, why not simply use something like OAuth for SSO? Best, Sidu. On Sun, Aug 14, 2011 at 9:13 PM, Ansal wrote: > Hi, > I have a django app running on my domain. I have another django app running > on its subdomain. How can I share the same login session on this subdomain? > Some websites are saying to set SESSION_COOKIE_DOMAIN = '.mydomain.com' in > settings.py in the first app. But it won't work. If i set the same in sub > domain's app, I am automatically getting logged out. So, what should I do to > get this done? > > Thanks in advance, > Ansal. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From mahaboobcrc at gmail.com Mon Aug 15 06:04:28 2011 From: mahaboobcrc at gmail.com (subhan) Date: Mon, 15 Aug 2011 09:34:28 +0530 Subject: [BangPypers] JOB:Python Programmer Job in Dell R&D Center Bangalore Message-ID: Hello everyone, Dell R&D Center Bangalore is looking for talented and passionate python programmers. *Job Description:* Working knowledge on Core Python. Hand's on with modules like - OS, SYS, RE, XML, SUBPROCESS. Automation background - optional skill Job openings in Dell R&D as a Contractor - long term(more then a year) & Good package For more information, please Contact me. Email : mahaboob_subhan at dell.com Mobile : 9591237026 Thanks, Mahaboob Subhan. mahaboob_subhan at dell.com Mobile:9591237026 From asif.jamadar at rezayat.net Mon Aug 15 11:30:49 2011 From: asif.jamadar at rezayat.net (Asif Jamadar) Date: Mon, 15 Aug 2011 09:30:49 +0000 Subject: [BangPypers] 'dict' object has no attribute 'company_name' Message-ID: charges = [(c.company_name) for c in ReportModel.objects.values('company_name').distinct()] but it throws this error: " 'dict' object has no attribute 'company_name'" any suggestions? From ramdaz at gmail.com Mon Aug 15 11:33:44 2011 From: ramdaz at gmail.com (Ramdas S) Date: Mon, 15 Aug 2011 15:03:44 +0530 Subject: [BangPypers] 'dict' object has no attribute 'company_name' In-Reply-To: References: Message-ID: On Mon, Aug 15, 2011 at 3:00 PM, Asif Jamadar wrote: > charges = [(c.company_name) > > for c in > ReportModel.objects.values('company_name').distinct()] > > > but it throws this error: " 'dict' object has no attribute 'company_name'" > > > paste the whole code somewhere may be dpaste.com and ask the question > > any suggestions? > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- Ramdas S +91 9342 583 065 From jeffjosejeff at gmail.com Mon Aug 15 11:38:38 2011 From: jeffjosejeff at gmail.com (Jeffrey Jose) Date: Mon, 15 Aug 2011 15:08:38 +0530 Subject: [BangPypers] 'dict' object has no attribute 'company_name' In-Reply-To: References: Message-ID: On Aug 15, 2011 3:02 PM, "Asif Jamadar" wrote: > > charges = [(c.company_name) > > for c in ReportModel.objects.values('company_name').distinct()] > > > but it throws this error: " 'dict' object has no attribute 'company_name'" > > > > any suggestions? > dict attribute access in python goes like this.. c['company_name '] /jeff - from a handheld device. _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers From ashok.raavi at gmail.com Mon Aug 15 11:39:19 2011 From: ashok.raavi at gmail.com (ashok raavi) Date: Mon, 15 Aug 2011 15:09:19 +0530 Subject: [BangPypers] 'dict' object has no attribute 'company_name' In-Reply-To: References: Message-ID: On Mon, Aug 15, 2011 at 3:03 PM, Ramdas S wrote: > On Mon, Aug 15, 2011 at 3:00 PM, Asif Jamadar >wrote: > > > charges = [(c.company_name) > > > > for c in > > ReportModel.objects.values('company_name').distinct()] > .values returns a QuerySet that returns dictionaries when used as an iterable, rather than model-instance objects. https://docs.djangoproject.com/en/dev/ref/models/querysets/#values > > > > > > but it throws this error: " 'dict' object has no attribute > 'company_name'" > > > > > > paste the whole code somewhere may be dpaste.com and ask the question > > > > > any suggestions? > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > Ramdas S > +91 9342 583 065 > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- ashok raavi From ansalansari at gmail.com Mon Aug 15 13:16:59 2011 From: ansalansari at gmail.com (Ansal) Date: Mon, 15 Aug 2011 16:46:59 +0530 Subject: [BangPypers] Django - share login sessions on sub-domain In-Reply-To: References: Message-ID: Yes, I can do that. But isn't there a way to share the same login session information in sub-domain too? From ketanpadegaonkar at gmail.com Mon Aug 15 16:27:41 2011 From: ketanpadegaonkar at gmail.com (Ketan Padegaonkar) Date: Mon, 15 Aug 2011 07:27:41 -0700 Subject: [BangPypers] Django - share login sessions on sub-domain In-Reply-To: References: Message-ID: It is possible to set session cookies on a subdomain (*.example.com), in which case you'd need to use the same session storage and user store for all apps in the subdomain so that all the apps can validate the cookie. Having SSO is a much cleaner and simpler way of authenticating users across multiple (sub)domains. This allows apps to not have to share the same session store and to worry about apps writing on top of each others session data(namespacing et.al.). Ditto with the user storage. - Ketan studios.thoughtworks.com | twitter.com/ketanpkr On Mon, Aug 15, 2011 at 4:16 AM, Ansal wrote: > Yes, I can do that. But isn't there a way to share the same login session > information in sub-domain too? > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From brian.curtin at gmail.com Tue Aug 16 00:32:29 2011 From: brian.curtin at gmail.com (Brian Curtin) Date: Mon, 15 Aug 2011 17:32:29 -0500 Subject: [BangPypers] Looking for PyCon 2012 Speakers Message-ID: With PyCon 2012 efforts off to a great start, we?re looking for you, the people of the Python community, so show us what you?ve got. Our call for proposals (http://us.pycon.org/2012/cfp/) just went out and we want to include you in our 2012 conference schedule, taking place March 7-15, 2012 in Santa Clara, CA. The call covers tutorial, talk, and poster applications, and we?re expecting to blow the previous record of 250 applications out of the water. Put together your best 3-hour class proposals for one of the tutorial sessions on March 7 and 8. Submit your best talks on any range of topics for the conference days, March 9 through 11. The poster session will be in full swing on Sunday with a series of 4'x4' posters and an open floor for attendees to interact with presenters. Get your applications in early - we want to help you put together the best proposal possible, so we?re going to work with submitters as applications come in. See more details and submit your talks here: http://us.pycon.org/2012/speaker/ We?re also looking for feedback from your past PyCon experiences along with what you?re looking for in the future, by way of our 2012 Guidance Survey at https://www.surveymonkey.com/s/pycon2012_launch_survey. The attendees make the conference, so every response we get from you makes a difference in putting together the best conference we can. If you or your company is interested in sponsoring PyCon, we?d love to hear from you. Join our growing list with Diamond sponsors Google and Dropbox, and Platinum sponsors Microsoft, Nasuni, SurveyMonkey, and Gondor by Eldarion. CCP Games, Linode, Walt Disney Animation Studios, Canonical, DotCloud, Loggly, Revolution Systems, ZeOmega, bitly, ActiveState, JetBrains, Snoball, Caktus Consulting Group, and Disqus make up our Gold sponsors. The Silver sponsors so far are 10gen, GitHub, Olark, Wingware, net-ng, Imaginary Landscape, BigDoor, Fwix, AG Interactive, Bitbucket, The Open Bastion, Accense Technology, Cox Media Group, and myYearbook. See our sponsorship page at http://us.pycon.org/2012/sponsors/ for more details. The PyCon Organizers - http://us.pycon.org/2012 Jesse Noller - Chairman - jnoller at python.org Brian Curtin - Publicity Coordinator - brian at python.org From asif.jamadar at rezayat.net Tue Aug 16 07:46:16 2011 From: asif.jamadar at rezayat.net (Asif Jamadar) Date: Tue, 16 Aug 2011 05:46:16 +0000 Subject: [BangPypers] two dropdowns dependents on each other Message-ID: I have two dropdowns one dropdown is dependent on other (Ex. Country/State dropdowns) Now how can I implement this thing in django? I'm using modelform concept to display form which having two dropdowns Any sugtgestions? From lawgon at gmail.com Tue Aug 16 07:49:47 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Tue, 16 Aug 2011 11:19:47 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: Message-ID: <1313473790.3693.13.camel@xlquest.web> On Tue, 2011-08-16 at 05:46 +0000, Asif Jamadar wrote: > I have two dropdowns one dropdown is dependent on other (Ex. > Country/State dropdowns) > > Now how can I implement this thing in django? > > ajax -- regards Kenneth Gonsalves From asif.jamadar at rezayat.net Tue Aug 16 07:50:13 2011 From: asif.jamadar at rezayat.net (Asif Jamadar) Date: Tue, 16 Aug 2011 05:50:13 +0000 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: <1313473790.3693.13.camel@xlquest.web> References: <1313473790.3693.13.camel@xlquest.web> Message-ID: Can you provide me example using ajax? _______________________________________________ BangPypers mailing list BangPypers at python.org http://mail.python.org/mailman/listinfo/bangpypers From lawgon at gmail.com Tue Aug 16 08:02:56 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Tue, 16 Aug 2011 11:32:56 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: <1313473790.3693.13.camel@xlquest.web> Message-ID: <1313474579.3693.15.camel@xlquest.web> On Tue, 2011-08-16 at 05:50 +0000, Asif Jamadar wrote: > Can you provide me example using ajax? I do not do ajax - all the samples are proprietary. -- regards Kenneth Gonsalves From mandarvaze at gmail.com Tue Aug 16 08:29:57 2011 From: mandarvaze at gmail.com (=?UTF-8?B?TWFuZGFyIFZhemUgLyDgpK7gpILgpKbgpL7gpLAg4KS14KSd4KWH?=) Date: Tue, 16 Aug 2011 11:59:57 +0530 Subject: [BangPypers] Django - share login sessions on sub-domain In-Reply-To: References: Message-ID: Also refer to similar discussion on Python Pune mailing list : http://groups.google.com/group/pythonpune/browse_thread/thread/31993e39bd0dfac6/b9b3709bceb6e913 -Mandar On Mon, Aug 15, 2011 at 7:57 PM, Ketan Padegaonkar < ketanpadegaonkar at gmail.com> wrote: > It is possible to set session cookies on a subdomain (*.example.com), > in which case you'd need to use the same session storage and user > store for all apps in the subdomain so that all the apps can validate > the cookie. > > Having SSO is a much cleaner and simpler way of authenticating users > across multiple (sub)domains. This allows apps to not have to share > the same session store and to worry about apps writing on top of each > others session data(namespacing et.al.). Ditto with the user storage. > > - Ketan > studios.thoughtworks.com | twitter.com/ketanpkr > > > On Mon, Aug 15, 2011 at 4:16 AM, Ansal wrote: > > Yes, I can do that. But isn't there a way to share the same login session > > information in sub-domain too? > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From sudheer.s at sudheer.net Tue Aug 16 08:40:23 2011 From: sudheer.s at sudheer.net (Sudheer Satyanarayana) Date: Tue, 16 Aug 2011 12:10:23 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: Message-ID: <4E4A10D7.3060104@sudheer.net> On Tuesday 16 August 2011 11:16 AM, Asif Jamadar wrote: > I have two dropdowns one dropdown is dependent on other (Ex. Country/State dropdowns) > > Now how can I implement this thing in django? > > I'm using modelform concept to display form which having two dropdowns > > Any sugtgestions? DOM manipulations are done using JavaScript. Start learning JavaScript. Eventually you'll learn AJAX. -- With warm regards, Sudheer. S Personal home page - http://www.sudheer.net/about Tech Chorus - http://www.techchorus.net From gora at mimirtech.com Tue Aug 16 09:14:53 2011 From: gora at mimirtech.com (Gora Mohanty) Date: Tue, 16 Aug 2011 12:44:53 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: Message-ID: On Tue, Aug 16, 2011 at 11:16 AM, Asif Jamadar wrote: > I have two dropdowns one dropdown is dependent on other (Ex. Country/State dropdowns) > > Now how can I implement this thing in django? [...] This is probably best done with a layer on top of Javascript: I would recommend jQuery. Depending on your requirements, you might or might not want AJAX. Searching Google for "jquery country state select" turns up many likely-looking examples. Regards, Gora From vsapre80 at gmail.com Tue Aug 16 09:16:55 2011 From: vsapre80 at gmail.com (Vishal) Date: Tue, 16 Aug 2011 12:46:55 +0530 Subject: [BangPypers] how to write Operating System in python In-Reply-To: References: Message-ID: Hello, It might be tempting to write a desktop OS in Python...and it may also be a very good learning tool for an OS course. What really is needed is to have Python environment on smaller footprint systems...the 'embedded' part of computing universe. They are everywhere are rarely programmed in anything but C. We need to have a 'comfortable' way of programming these systems in Python...pure Python. If you can do that..that will be a HUGE step ahead for higher level languages. There is certainly work in that area going on... - pymite - SL4A (python on Android)...see the details on PyCon APAC 2011 - SNAPy (A Python VM from Synapse Wireless...see Pycon video on blip.tv. The VM is proprietary - M2M (Machine 2 Machine) communication and control solutions from Telit Just another direction to whet your interest :)) Enjoy Python... Best regards, Vishal On Fri, Aug 12, 2011 at 3:28 PM, vikas ruhil wrote: > Thanks to all for useful information , Motivation and Inspiration to me . > As i have hobby to code in python might try put my effort with my best.now > need to focus. > Someone want to share some more positive python related motivation ,help, > documents , anything else !! > > > > 2011/8/12 Mandar Vaze / ????? ??? > > > > > On Thu, Aug 11, 2011 at 3:24 PM, vikas ruhil > > > > > wrote: > > > > > > > > > I am looking towards to write an operating system in Python? How > i > > > can > > > > > write kernel and kernel calls on Debian Linux ! any body can help > > > reagrd > > > > > this !! > > > > > > > > > > > > > http://www.jtauber.com/cleese > > > > > > > What is your definition of operating system "in python" ? > > > > Several source files of cleese project are still in "C" (booting, malloc, > > keyboard, cpu, video, ports ..... ) > > > > -Mandar > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- Thanks and best regards, Vishal Sapre --- "So say...Day by day, in every way, I am getting better, better and better !!!" "A Strong and Positive attitude creates more miracles than anything else." "Life is 10% how you make it, and 90% how you take it" "Diamond is another piece of coal that did well under pressure? "May we do good and not evil. May we find forgiveness for ourself and forgive others. May we share freely, never taking more than we give." "????? ?????, ????? ????? (Benefit for most people, Happiness for most people.)" The difference between "*ordinary*" and "*extraordinary*" is that "extra". Its called by another name, "*preparation*". Extraordinary people prepare themselves for situations that ordinary people choose to ignore. From lawgon at gmail.com Tue Aug 16 09:41:03 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Tue, 16 Aug 2011 13:11:03 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: Message-ID: <1313480466.3693.25.camel@xlquest.web> On Tue, 2011-08-16 at 05:46 +0000, Asif Jamadar wrote: > I have two dropdowns one dropdown is dependent on other (Ex. > Country/State dropdowns) > > Now how can I implement this thing in django? > > I'm using modelform concept to display form which having two dropdowns > > Any sugtgestions? without ajax: 1. override __init__ on your modelform, pass the value of the first dropdown to __init__ and populate the second dropdown depending on that value. If the value is None, the second dropdown will not be populated. 2. in your template, refresh the page when the value of the first dropdown changes. A sample of overriding __init__ is here: https://bitbucket.org/lawgon/djangogolf/src/822bb414b722/web/views.py#cl-379 -- regards Kenneth Gonsalves From amit.pureenergy at gmail.com Tue Aug 16 12:15:33 2011 From: amit.pureenergy at gmail.com (Amit Sethi) Date: Tue, 16 Aug 2011 15:45:33 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: <1313480466.3693.25.camel@xlquest.web> References: <1313480466.3693.25.camel@xlquest.web> Message-ID: [..] > without ajax: > > 1. override __init__ on your modelform, pass the value of the first > dropdown to __init__ and populate the second dropdown depending on that > value. If the value is None, the second dropdown will not be populated. > > 2. in your template, refresh the page when the value of the first > dropdown changes. > There might be a small problem doing this without ajax. While reloading, the __init__ of the first form will also run which will bring all user input to default,and thus would require you set the values again explicitly instead why not get the values as json object and populate as required using jquery. -- A-M-I-T S|S From lawgon at gmail.com Tue Aug 16 12:27:26 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Tue, 16 Aug 2011 15:57:26 +0530 Subject: [BangPypers] two dropdowns dependents on each other In-Reply-To: References: <1313480466.3693.25.camel@xlquest.web> Message-ID: <1313490450.3693.29.camel@xlquest.web> On Tue, 2011-08-16 at 15:45 +0530, Amit Sethi wrote: > > without ajax: > > > > 1. override __init__ on your modelform, pass the value of the first > > dropdown to __init__ and populate the second dropdown depending on > that > > value. If the value is None, the second dropdown will not be > populated. > > > > 2. in your template, refresh the page when the value of the first > > dropdown changes. > > > There might be a small problem doing this without ajax. While > reloading, the __init__ of the first form will also run which will > bring all user input to default,and thus would require you set the > values again explicitly instead why not get the values as json object > and populate as required using jquery. ajax is the way to go - but if you need to learn ajax for it and there is a deadline ... again depends on what kind of form it is. For bus booking one can force the user to populate the dropdowns first. -- regards Kenneth Gonsalves From ramamurthy.swaminathan at gmail.com Tue Aug 16 17:25:45 2011 From: ramamurthy.swaminathan at gmail.com (Ramamurthy Swaminathan) Date: Tue, 16 Aug 2011 20:55:45 +0530 Subject: [BangPypers] [JOBS] - Openings for good programmers in Python/Django/Flex/Postgres - @ Bangalore Message-ID: <046d01cc5c28$c8c458e0$5a4d0aa0$@gmail.com> Hi, I am looking for highly skilled Software Engineers having very good programming knowledge in Python/Django/Flex for company based out of Bangalore. The name of the company is "LogFire Technology Solutions Private Limited" ( http://www.logfire.com ). We work in the Supply Chain Management Domain. Knowledge in relational DBMS is a must. Knowledge of Postgres ( RDMBS) preferred. Good communication skills and ability to work in large Teams across multiple Geographies is a must. You can look forward to developing new products from scratch in the Supply Chain domain on OPEN SOURCE PLATFORM ,supported by an excellent work environment and culture. Please do send me your resume (MS word or text format) to the email given below and/or call me at the below number to know more about it. Thanks, Ram [ Ramamurthy Swaminathan ] Director Mobile : + 919845949503 Email : Ramamurthy.swaminathan at gmail.com LogFire LLC http://www.logfire.com From ruchi.2786 at yahoo.in Thu Aug 18 13:19:11 2011 From: ruchi.2786 at yahoo.in (Ruchi Singh) Date: Thu, 18 Aug 2011 16:49:11 +0530 (IST) Subject: [BangPypers] Job Opportunity In-Reply-To: <1313666084.96223.YahooMailNeo@web137613.mail.in.yahoo.com> References: <1313664991.1449.YahooMailClassic@web1110.biz.mail.sk1.yahoo.com> <1313666084.96223.YahooMailNeo@web137613.mail.in.yahoo.com> Message-ID: <1313666351.5907.YahooMailNeo@web137612.mail.in.yahoo.com> ?Dear Members, ?BeeHyv Software (www.beehyv.com) is ?an Outsourced Product Development (OPD) firm based in ?Secunderabad (Hyderabad) started by alumni of IIT Madras ?(refer LinkedIn profiles below).? We are looking for ?B.Tech graduates from IIT's or other top institutes with 2+ ?years of experience for working on a project for a Biotech ?research firm (data analytics). Send resumes to careers at ?beehyv dot com ? Python/C/C++ Developer: ? Experience working on the following technologies: ? Python and python libraries like numpy, Matplotlib, ?sqlalchemy, cElementTree, win32com, reportlab, rpy2, ?wxPython.? Any math, stats, algorithm background will ?be a plus.? ? ? 90% of the people at BeeHyv are alumni of various IIT's. We ?work with entrepreneurs and VC funded firms across verticals ?like Finance, Biotech, etc. Our customers also include ?Enterprise Software Product vendors. If you would like to ?work on interesting projects with a good team of people ?around you, do send in your resumes to careers at ?beehyv.com. ? LinkedIn Profiles of BeeHyv's Founders: ? http://in.linkedin.com/in/sureshatbeehyv ?http://in.linkedin.com/in/vrayabhari ? Please send us your c.v incase you are interested. ? ? Regards ??Ruchi Singh ??HR Manager ? Bee Hyv Software Solutions ? 040-40159024 From abpillai at gmail.com Thu Aug 18 21:14:04 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Fri, 19 Aug 2011 00:44:04 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <877h6hvlkg.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> Message-ID: On Sat, Aug 13, 2011 at 12:34 PM, Noufal Ibrahim wrote: > kracekumar ramaraju writes: > > > Things you could do to improve diversity in the Python > > community. (Quoting without permission from a thoughtful post on the > > Python diversity list; s/Python/Your project/ to suit your taste.) > > [...] > > It would be nice to just have python user group meetings in Bangalore > regularly even if they're not particularly "diverse". > We need to poll people here on top 2 pain points/issues that prevent them from attending such meets. For me - it is mostly the distance to center of the city. Maybe we should have more hackdays. Something the IPSS should think about pretty soon. > > -- > ~noufal > http://nibrahim.net.in > > "I always avoid prophesying beforehand because it is much better to > prophesy after the event has already taken place. " - Winston Churchill > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From dapurv5 at gmail.com Thu Aug 18 21:36:18 2011 From: dapurv5 at gmail.com (Apurv Verma) Date: Fri, 19 Aug 2011 01:06:18 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> Message-ID: For me it's the distance. -- thanks and regards, Apurv Verma B. Tech.(CSE) IIT- Ropar On Fri, Aug 19, 2011 at 12:44 AM, Anand Balachandran Pillai < abpillai at gmail.com> wrote: > On Sat, Aug 13, 2011 at 12:34 PM, Noufal Ibrahim wrote: > > > kracekumar ramaraju writes: > > > > > Things you could do to improve diversity in the Python > > > community. (Quoting without permission from a thoughtful post on the > > > Python diversity list; s/Python/Your project/ to suit your taste.) > > > > [...] > > > > It would be nice to just have python user group meetings in Bangalore > > regularly even if they're not particularly "diverse". > > > > We need to poll people here on top 2 pain points/issues that > prevent them from attending such meets. > > For me - it is mostly the distance to center of the city. > > Maybe we should have more hackdays. Something the IPSS > should think about pretty soon. > > > > > > -- > > ~noufal > > http://nibrahim.net.in > > > > "I always avoid prophesying beforehand because it is much better to > > prophesy after the event has already taken place. " - Winston Churchill > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > --Anand > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From noufal at gmail.com Fri Aug 19 06:41:37 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 10:11:37 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (Anand Balachandran Pillai's message of "Fri, 19 Aug 2011 00:44:04 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> Message-ID: <87liuqui66.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: [...] > We need to poll people here on top 2 pain points/issues that > prevent them from attending such meets. > > For me - it is mostly the distance to center of the city. > > Maybe we should have more hackdays. Something the IPSS > should think about pretty soon. [...] I don't mind travelling any distance once a month. My main problem is the lack of interest. I mailed for a few months (after our last PyCon) and meetings took place. After that, the apathy was too much. -- ~noufal http://nibrahim.net.in His honour rooted in dishonour stood, And faith unfaithful kept him falsely true. -- Alfred Lord Tennyson From lawgon at gmail.com Fri Aug 19 07:17:28 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Fri, 19 Aug 2011 10:47:28 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <87liuqui66.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> Message-ID: <1313731051.21876.22.camel@xlquest.web> On Fri, 2011-08-19 at 10:11 +0530, Noufal Ibrahim wrote: > > Maybe we should have more hackdays. Something the IPSS > > should think about pretty soon. > > [...] > > I don't mind travelling any distance once a month. > > My main problem is the lack of interest. I mailed for a few months > (after our last PyCon) and meetings took place. After that, the apathy > was too much. chennaipy meets on the 4th Saturday of every month, this is fixed. Attendance varies from 2 to 15. So the question is not 'shall we meet?' but 'are you attending'. This has been going on since 2006 with some breaks now and then. -- regards Kenneth Gonsalves From noufal at gmail.com Fri Aug 19 08:35:28 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 12:05:28 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <1313731051.21876.22.camel@xlquest.web> (Kenneth Gonsalves's message of "Fri, 19 Aug 2011 10:47:28 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> Message-ID: <8762ltvrgv.fsf@sanitarium.localdomain> Kenneth Gonsalves writes: [...] > chennaipy meets on the 4th Saturday of every month, this is fixed. > Attendance varies from 2 to 15. So the question is not 'shall we > meet?' but 'are you attending'. This has been going on since 2006 > with some breaks now and then. A fixed date without attendees does not a user group meeting make. ChennaiPy has *some* people attending every month. -- ~noufal http://nibrahim.net.in Some bachelors want a meaningful overnight relationship. From sree at mahiti.org Fri Aug 19 08:44:04 2011 From: sree at mahiti.org (Sreekanth S Rameshaiah) Date: Fri, 19 Aug 2011 12:14:04 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <8762ltvrgv.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> Message-ID: On 19 August 2011 12:05, Noufal Ibrahim wrote: > Kenneth Gonsalves writes: > > > [...] > > > chennaipy meets on the 4th Saturday of every month, this is fixed. > > Attendance varies from 2 to 15. So the question is not 'shall we > > meet?' but 'are you attending'. This has been going on since 2006 > > with some breaks now and then. > > A fixed date without attendees does not a user group meeting > make. ChennaiPy has *some* people attending every month. > > But, consistency and predictability helps in the long run. Regards, - sree From lawgon at gmail.com Fri Aug 19 08:45:10 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Fri, 19 Aug 2011 12:15:10 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <8762ltvrgv.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> Message-ID: <1313736313.21876.24.camel@xlquest.web> On Fri, 2011-08-19 at 12:05 +0530, Noufal Ibrahim wrote: > > chennaipy meets on the 4th Saturday of every month, this is fixed. > > Attendance varies from 2 to 15. So the question is not 'shall we > > meet?' but 'are you attending'. This has been going on since 2006 > > with some breaks now and then. > > A fixed date without attendees does not a user group meeting > make. ChennaiPy has *some* people attending every month. on several occasions we had 2 -- regards Kenneth Gonsalves From abpillai at gmail.com Fri Aug 19 14:01:23 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Fri, 19 Aug 2011 17:31:23 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <1313736313.21876.24.camel@xlquest.web> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> Message-ID: On Fri, Aug 19, 2011 at 12:15 PM, Kenneth Gonsalves wrote: > On Fri, 2011-08-19 at 12:05 +0530, Noufal Ibrahim wrote: > > > chennaipy meets on the 4th Saturday of every month, this is fixed. > > > Attendance varies from 2 to 15. So the question is not 'shall we > > > meet?' but 'are you attending'. This has been going on since 2006 > > > with some breaks now and then. > > > > A fixed date without attendees does not a user group meeting > > make. ChennaiPy has *some* people attending every month. > > on several occasions we had 2 > I dont call that a user group meeting. That is definitely apathy though better than no meeting any day. I see a few factors that discourage people in actively attending tech forum meetings such as BangPypers. 1. (Lack of) Continuation of thread/topic - Most of the time we end up discussing different topics from one meeting to next. Topic dis-continuation leads to lack of focus and lack of shared goal which finally leads to apathy. 2. (Lack of) Shared goals - This is kind of related to 1, but slightly different. If 2-3 folks are working on the same/similar project then there is more shared problems to discuss and even hack on a week-end, but if you don't find a common ground, you cant build a cohesive group who would like to meet. 3. Social networking ? - I am guessing here, but I do feel that the advent of social networking has affected real social gatherings to an extend. I am not talking about attending marriage ceremonies or house warming here, but shared social collectives such as tech groups like us. Since there is an alternate channel (twitter, FB) to share content and discuss in real time, I am wondering if it acts as a deterrent to meeting in person. 4. Maturity - I think this is a point which we often forget. When BangPypers was starting off, we had a lot of energy and enthusiasm since Python was not as much popular then as it is now. There were a lot of basic ignorance so many of the initial meetings were discussions on the language aspects. However right now this initial novelty has worn off and the language (and the group) has matured. So topic picking is not as easy as it used to be and finding themes to discuss that is novel and holds others interests is perhaps not as easy as earlier. I am not proposing solutions in this email (tired fingers), but identifying problems is a start to fixing them. > -- > regards > Kenneth Gonsalves > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From noufal at gmail.com Fri Aug 19 14:06:48 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 17:36:48 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (Anand Balachandran Pillai's message of "Fri, 19 Aug 2011 17:31:23 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> Message-ID: <87k4a9sizr.fsf@sanitarium.localdomain> Anand Balachandran Pillai writes: > On Fri, Aug 19, 2011 at 12:15 PM, Kenneth Gonsalves wrote: [...] >> on several occasions we had 2 >> > > I dont call that a user group meeting. That is definitely > apathy though better than no meeting any day. Exactly. It keeps it going which is something. > I see a few factors that discourage people in actively > attending tech forum meetings such as BangPypers. > > 1. (Lack of) Continuation of thread/topic - Most of the time we > end up discussing different topics from one meeting to next. Topic > dis-continuation leads to lack of focus and lack of shared goal which > finally leads to apathy. The ChennaiPy people, AFAIK, do LPTHW exercises, watch Pycon videos etc. These are things that can be done on a continuous basis. > 2. (Lack of) Shared goals - This is kind of related to 1, but slightly > different. If 2-3 folks are working on the same/similar project then > there is more shared problems to discuss and even hack on a week-end, > but if you don't find a common ground, you cant build a cohesive group > who would like to meet. Agreed. We need a pet project. > 3. Social networking ? - I am guessing here, but I do feel that the > advent of social networking has affected real social gatherings to an > extend. I am not talking about attending marriage ceremonies or house > warming here, but shared social collectives such as tech groups like > us. Since there is an alternate channel (twitter, FB) to share content > and discuss in real time, I am wondering if it acts as a deterrent to > meeting in person. I don't know. I freelance and work from home myself and can eagerly pounce on a meeting, tech or otherwise to meet people in the flesh. There's only so much that technology can do. However, if you have enough social engagements via. work, then this becomes secondary. > 4. Maturity - I think this is a point which we often forget. When > BangPypers was starting off, we had a lot of energy and enthusiasm > since Python was not as much popular then as it is now. There were a > lot of basic ignorance so many of the initial meetings were > discussions on the language aspects. However right now this initial > novelty has worn off and the language (and the group) has matured. So > topic picking is not as easy as it used to be and finding themes to > discuss that is novel and holds others interests is perhaps not as > easy as earlier. This is basically just dearth of topics. I don't know how to fix it but maybe we can give it some kind of stimulus with a day long hackathon? It would help us get into depth about *something* and make some headway. [...] -- ~noufal http://nibrahim.net.in Our comedies are not to be laughed at. -Samuel Goldwyn From anandology at gmail.com Fri Aug 19 14:11:43 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Fri, 19 Aug 2011 17:41:43 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> Message-ID: 2011/8/19 Anand Balachandran Pillai : > On Fri, Aug 19, 2011 at 12:15 PM, Kenneth Gonsalves wrote: > >> On Fri, 2011-08-19 at 12:05 +0530, Noufal Ibrahim wrote: >> > > chennaipy meets on the 4th Saturday of every month, this is fixed. >> > > Attendance varies from 2 to 15. So the question is not 'shall we >> > > meet?' ?but 'are you attending'. This has been going on since 2006 >> > > with some breaks now and then. >> > >> > A fixed date without attendees does not a user group meeting >> > make. ChennaiPy has *some* people attending every month. >> >> on several occasions we had 2 >> > > ?I dont call that a user group meeting. That is definitely > ?apathy though better than no meeting any day. > > ?I see a few factors that discourage people in actively > ?attending tech forum meetings such as BangPypers. > > ?1. (Lack of) Continuation of thread/topic - Most of the time we > end up discussing different topics from one meeting to next. Topic > dis-continuation leads to lack of focus and lack of shared goal which > finally leads to apathy. > > 2. (Lack of) Shared goals - This is kind of related to 1, but slightly > different. If 2-3 folks are working on the same/similar project then > there is more shared problems to discuss and even hack on a week-end, > but if you don't find a common ground, you cant build a cohesive > group who would like to meet. > > 3. Social networking ? - I am guessing here, but I do feel that the > advent of social networking has affected real social gatherings to an > extend. I am not talking about attending marriage ceremonies or > house warming here, but shared social collectives such as tech groups > like us. Since there is an alternate channel (twitter, FB) to share > content and discuss in real time, I am wondering if it acts as a deterrent > to meeting in person. > > 4. Maturity - I think this is a point which we often forget. When BangPypers > was starting off, we had a lot of energy and enthusiasm since Python was > not as much popular then as it is now. There were a lot of basic ignorance > so many of the initial meetings were discussions on the language aspects. > However right now this initial novelty has worn off and the language (and > the > group) has matured. So topic picking is not as easy as it used to be and > finding > themes to discuss that is novel and holds others interests is perhaps not > as easy as earlier. > > I am not proposing solutions in this email (tired fingers), but identifying > problems is a start to fixing them. Why don't we meet this weekend and discuss this? Anand From noufal at gmail.com Fri Aug 19 14:17:30 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 17:47:30 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (Anand Chitipothu's message of "Fri, 19 Aug 2011 17:41:43 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> Message-ID: <87fwkxsihx.fsf@sanitarium.localdomain> Anand Chitipothu writes: [...] > Why don't we meet this weekend and discuss this? [...] I'm out of town. :) -- ~noufal http://nibrahim.net.in A little pain never hurt anyone. From abpillai at gmail.com Fri Aug 19 14:27:49 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Fri, 19 Aug 2011 17:57:49 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <87k4a9sizr.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> Message-ID: On Fri, Aug 19, 2011 at 5:36 PM, Noufal Ibrahim wrote: > > > This is basically just dearth of topics. I don't know how to fix it but > maybe we can give it some kind of stimulus with a day long hackathon? It > would help us get into depth about *something* and make some headway. > It would be great to do this. I myself haven't really done much in Python for the last year or so. However the thing to hack should be sufficiently hard enough and in a topic of interest - not exactly writing Django plugins :) Anyone feel any pain point they want to hack on close to Python core, something which could be useful in general ? Personally, I would love to do something related to Python alternate implementation ecosystem (PyPy/Cython etc). Another option could be to form a small group who looks at core Python bugs and takes it over - if we can get started on this, we could end up owning some pieces of core Python in long term and also solve my problem # 2 (Shared goal). Of course, this needs some preparation - I am not talking of coming with a blank mind and just start random hacking. > > > [...] > > > -- > ~noufal > http://nibrahim.net.in > > Our comedies are not to be laughed at. -Samuel Goldwyn > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From lawgon at gmail.com Fri Aug 19 14:29:37 2011 From: lawgon at gmail.com (Kenneth Gonsalves) Date: Fri, 19 Aug 2011 17:59:37 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> Message-ID: <1313756980.21876.32.camel@xlquest.web> On Fri, 2011-08-19 at 17:31 +0530, Anand Balachandran Pillai wrote: > > > A fixed date without attendees does not a user group meeting > > > make. ChennaiPy has *some* people attending every month. > > > > on several occasions we had 2 > > > > I dont call that a user group meeting. That is definitely > apathy though better than no meeting any day. it works -- regards Kenneth Gonsalves From anandology at gmail.com Fri Aug 19 14:38:26 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Fri, 19 Aug 2011 18:08:26 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> Message-ID: 2011/8/19 Anand Balachandran Pillai : > On Fri, Aug 19, 2011 at 5:36 PM, Noufal Ibrahim wrote: > >> >> >> This is basically just dearth of topics. I don't know how to fix it but >> maybe we can give it some kind of stimulus with a day long hackathon? It >> would help us get into depth about *something* and make some headway. >> > > ?It would be great to do this. I myself haven't really done much in Python > ?for the last year or so. However the thing to hack should be sufficiently > ?hard enough and in a topic of interest - not exactly writing Django plugins > :) > > ?Anyone feel any pain point they want to hack on close to Python core, > something which could be useful in general ? > > ?Personally, I would love to do something related to Python > ?alternate implementation ecosystem (PyPy/Cython etc). Another option > ?could be to form a small group who looks at core Python bugs and > ?takes it over - if we can get started on this, we could end up owning > ?some pieces of core Python in long term and also solve my > ?problem # 2 (Shared goal). +1. I think it is a good idea. I'm interested in working on PyPy or core Python bugs. > ?Of course, this needs some preparation - I am not talking of coming > ?with a blank mind and just start random hacking. OK. Shall we meet this weekend and talk about alternate Python implementations and why PyPy is faster? Anand From noufal at gmail.com Fri Aug 19 14:42:09 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 18:12:09 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (Anand Chitipothu's message of "Fri, 19 Aug 2011 18:08:26 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> Message-ID: <87bovlshcu.fsf@sanitarium.localdomain> Anand Chitipothu writes: [...] > +1. > > I think it is a good idea. I'm interested in working on PyPy or core > Python bugs. +1 for PyPy. I know nothing about it but would love to dive in. If there's a bunch of people interested, it would be awesome. [...] -- ~noufal http://nibrahim.net.in Some bachelors want a meaningful overnight relationship. From osubbu at gmail.com Fri Aug 19 15:00:25 2011 From: osubbu at gmail.com (Subramanian Olagappan) Date: Fri, 19 Aug 2011 18:30:25 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <87bovlshcu.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> Message-ID: +1 . I am also interested to contribute. Regards, Subbu On Fri, Aug 19, 2011 at 6:12 PM, Noufal Ibrahim wrote: > Anand Chitipothu writes: > > > [...] > > > +1. > > > > I think it is a good idea. I'm interested in working on PyPy or core > > Python bugs. > > +1 for PyPy. I know nothing about it but would love to dive in. If > there's a bunch of people interested, it would be awesome. > > [...] > > > -- > ~noufal > http://nibrahim.net.in > > Some bachelors want a meaningful overnight relationship. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From abpillai at gmail.com Fri Aug 19 15:00:52 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Fri, 19 Aug 2011 18:30:52 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <87bovlshcu.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> Message-ID: On Fri, Aug 19, 2011 at 6:12 PM, Noufal Ibrahim wrote: > Anand Chitipothu writes: > > > [...] > > > +1. > > > > I think it is a good idea. I'm interested in working on PyPy or core > > Python bugs. > > +1 for PyPy. I know nothing about it but would love to dive in. If > there's a bunch of people interested, it would be awesome. > Since Noufal is out this week-end, how about next Sat or Sun ? We can all do a bit of reading up of PyPy this week-end, discuss in the mailing list over next week, arrive (hopefully) at a common problem of interest to talk on or hack on next week-end. > [...] > > > -- > ~noufal > http://nibrahim.net.in > > Some bachelors want a meaningful overnight relationship. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From kracethekingmaker at gmail.com Fri Aug 19 16:06:04 2011 From: kracethekingmaker at gmail.com (kracekumar ramaraju) Date: Fri, 19 Aug 2011 19:36:04 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> Message-ID: I am ready for next week end. We can try using PyPy and we can share our experience and share to rest of world through blogs. Then we will sort famous apps which don't run on PyPy to run on it. http://www.quora.com/Alex-Gaynor/Quora-product/Quora-is-now-running-on-PyPy. From anandology at gmail.com Fri Aug 19 17:02:21 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Fri, 19 Aug 2011 20:32:21 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> Message-ID: > Since Noufal is out this week-end, how about next Sat or Sun ? > We can all do a bit of reading up of PyPy this week-end, > discuss in the mailing list over next week, arrive (hopefully) > at a common problem of interest to talk on or hack on next > week-end. Noufal is away until 3rd of September. I think we should go ahead and meet without him. +1 for next weekend. Anand From noufal at gmail.com Fri Aug 19 18:35:41 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Fri, 19 Aug 2011 22:05:41 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: (Anand Chitipothu's message of "Fri, 19 Aug 2011 20:32:21 +0530") References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> Message-ID: <8739gxs6jm.fsf@sanitarium.localdomain> Anand Chitipothu writes: >> Since Noufal is out this week-end, how about next Sat or Sun ? >> We can all do a bit of reading up of PyPy this week-end, >> discuss in the mailing list over next week, arrive (hopefully) >> at a common problem of interest to talk on or hack on next >> week-end. > > Noufal is away until 3rd of September. I think we should go ahead and > meet without him. > > +1 for next weekend. [...] Do post a summary to the list. I'll follow it and try to do some reading and research by myself. The JIT parts of PyPy were preceeded by Psyco (which was written by one of the PyPy contributors). There is a presentation on Psyco over here http://psyco.sourceforge.net/accu2004-psyco.tgz which is quite detailed. -- ~noufal http://nibrahim.net.in She used to diet on any kind of food she could lay her hands on. -- Arthur Baer, American comic and columnist From dhananjay.nene at gmail.com Sun Aug 21 12:31:45 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Sun, 21 Aug 2011 16:01:45 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <8739gxs6jm.fsf@sanitarium.localdomain> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <87k4a9sizr.fsf@sanitarium.localdomain> <87bovlshcu.fsf@sanitarium.localdomain> <8739gxs6jm.fsf@sanitarium.localdomain> Message-ID: On Fri, Aug 19, 2011 at 10:05 PM, Noufal Ibrahim wrote: > Anand Chitipothu writes: > >>> Since Noufal is out this week-end, how about next Sat or Sun ? >>> We can all do a bit of reading up of PyPy this week-end, >>> discuss in the mailing list over next week, arrive (hopefully) >>> at a common problem of interest to talk on or hack on next >>> week-end. >> >> Noufal is away until 3rd of September. I think we should go ahead and >> meet without him. >> >> +1 for next weekend. > > [...] > > Do post a summary to the list. I'll follow it and try to do some reading > and research by myself. > > The JIT parts of PyPy were preceeded by Psyco (which was written by one > of the PyPy contributors). There is a presentation on Psyco over here > http://psyco.sourceforge.net/accu2004-psyco.tgz which is quite detailed. > These are good reads (they are sequential reads in the pypy docs) http://codespeak.net/pypy/dist/pypy/doc/jit/overview.html http://codespeak.net/pypy/dist/pypy/doc/jit/pyjitpl5.html http://codespeak.net/svn/pypy/extradoc/talk/icooolps2009/bolz-tracing-jit-final.pdf While I haven't tried it, for advanced study a tool like this is quite likely to be useful http://morepypy.blogspot.com/2011/08/visualization-of-jitted-code.html From kunal.t2 at gmail.com Sun Aug 21 16:45:31 2011 From: kunal.t2 at gmail.com (kunal ghosh) Date: Sun, 21 Aug 2011 20:15:31 +0530 Subject: [BangPypers] [X-Post] Technical Events in India Message-ID: Hi all, There are a lot of Tech Events organized in India, but many a times the most difficult part for the organizers is to get the word around. So, to address this issue, i have created and will moderate the google-group *http://groups.google.com/group/teindia/* * This is a sincere effort to address the issue of getting the word around about tech events in India to prospective attendees. * This list is manually moderated , so no spam. * If you want to moderate this list please contact me , It'd be great to have more moderators. * Please help spread the word around about this list. * You could use http://groups.google.com/group/teindia/boxsubscribe to register to the group. * This list is to aggregate ALL TECH EVENTS including but not restricted to events focusing on Free and Open Source Software. -- regards, Kunal Ghosh From gopalakrishnan.subramani at gmail.com Mon Aug 22 21:09:19 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Mon, 22 Aug 2011 13:09:19 -0600 Subject: [BangPypers] Language Parsing and output generation Message-ID: I have interesting problem to solve. We have a language called "Description Language" less widely known outside but used very much in automation domain. The examples are given below. By definition, language is readable and I could could not provide the language spec due to restriction (really close source in this way). The idea is to convert the 'Description Language' code to Lua code using Python. This involves 2 things. One is parsing and another is generation. In between 2, I need to make a tree as a output from parser, kind of AST. The generated Lua source base shall be used in mobile phones, Desktop etc. The following are few example code, extracted and modified. Otherwise they will sue us.. -------------------------------------------------------------------- #include "constant.dl" #define MY_DEF 1 #define WIDGET_TYPE 1 WIDGET mywidget { TITLE "My widget"; TYPE WIDGET_TYPE; ELEMENTS { element1, element2, element3 } } IMPORT WIDGET mywidget { REFINE widget_name{ REDEFINE TITLE "Your widget"; } } #ifdef YOUR_WIDGET_ALLOWED WIDGET yourwidget { TITLE "Your widget"; TYPE WIDGET_TYPE; ELEMENTS { element1, element2, element3 } } #endif For Loop but needs pre-declaration of loop variable int x; for ( x=0; x < 8; x++) { if ( something_true ) do_this(argument1, argument2); } supports do { statements; }while(condition); supports while(condition) { statements; } switch statement also supported -------------------------------------------------------------------- I prefer Python for this conversion. Any idea is appreciated. Regards, Gopalakrishnan From senthil at uthcode.com Tue Aug 23 01:51:44 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Tue, 23 Aug 2011 09:51:44 +1000 Subject: [BangPypers] Create Better Python community In-Reply-To: <1313756980.21876.32.camel@xlquest.web> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <1313756980.21876.32.camel@xlquest.web> Message-ID: <20110822235144.GA3514@mathmagic> On Fri, Aug 19, 2011 at 05:59:37PM +0530, Kenneth Gonsalves wrote: > > > > > > on several occasions we had 2 > > > > > > > I dont call that a user group meeting. That is definitely > > apathy though better than no meeting any day. > > it works And yes, that is what is required. So, regular schedule with even two people coming up is a good thing. -- Senthil From senthil at uthcode.com Tue Aug 23 02:10:47 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Tue, 23 Aug 2011 10:10:47 +1000 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: References: Message-ID: <20110823001047.GB3514@mathmagic> On Mon, Aug 22, 2011 at 01:09:19PM -0600, Gopalakrishnan Subramani wrote: > I prefer Python for this conversion. Any idea is appreciated. In your source language, do you have tools to create AST? If not, then it would be the first thing to aim for. Then you need a mechanism to translate that AST to the target language specs. There is a lot of compiler theory involved in this problem, unless your source language really really very minimal (just I/O, conditional and looping) and in which case you do a literal translation to the other language and see it works. -- Senthil From gopalakrishnan.subramani at gmail.com Tue Aug 23 03:43:34 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Mon, 22 Aug 2011 19:43:34 -0600 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: <20110823001047.GB3514@mathmagic> References: <20110823001047.GB3514@mathmagic> Message-ID: Source language IO is very limited and it has functions to map to IO and UI. As a total, they have around 100+ function. Those can be easily done in Lua. -- Gopal On Mon, Aug 22, 2011 at 6:10 PM, Senthil Kumaran wrote: > On Mon, Aug 22, 2011 at 01:09:19PM -0600, Gopalakrishnan Subramani wrote: > > I prefer Python for this conversion. Any idea is appreciated. > > In your source language, do you have tools to create AST? If not, then > it would be the first thing to aim for. Then you need a mechanism to > translate that AST to the target language specs. > > There is a lot of compiler theory involved in this problem, unless > your source language really really very minimal (just I/O, conditional > and looping) and in which case you do a literal translation to the > other language and see it works. > > > -- > Senthil > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From noufal at gmail.com Tue Aug 23 07:25:36 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Tue, 23 Aug 2011 10:55:36 +0530 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: (Gopalakrishnan Subramani's message of "Mon, 22 Aug 2011 19:43:34 -0600") References: <20110823001047.GB3514@mathmagic> Message-ID: <87ippor967.fsf@sanitarium.localdomain> Gopalakrishnan Subramani writes: > Source language IO is very limited and it has functions to map to IO and UI. > As a total, they have around 100+ function. > > Those can be easily done in Lua. [...] For a project in one of my earlier companies, I used SPARK[1] to write a little parser for a language of my own making to used to specify some conditionals. The parser would convert this into a python expression which could be evaluated with some objects to return a true or a false. If you have the grammar of your source language at hand, it's a fews hours job to write a parser for it using SPARK. Once you do that, you have to write a backend to convert it into LUA which might be a little more complex but not impossibly so. Footnotes: [1] http://pages.cpsc.ucalgary.ca/~aycock/spark/ -- ~noufal http://nibrahim.net.in An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, American comic and columnist From gopalakrishnan.subramani at gmail.com Tue Aug 23 07:45:24 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Mon, 22 Aug 2011 23:45:24 -0600 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: <87ippor967.fsf@sanitarium.localdomain> References: <20110823001047.GB3514@mathmagic> <87ippor967.fsf@sanitarium.localdomain> Message-ID: I could make a grammar compiled myself. I will look into SPARK.. Anybody has experience in pyparsing http://pyparsing.wikispaces.com/ ? Under Examples http://pyparsing.wikispaces.com/Examples Python language example is promising. Regards, Gopal On Mon, Aug 22, 2011 at 11:25 PM, Noufal Ibrahim wrote: > Gopalakrishnan Subramani writes: > > > Source language IO is very limited and it has functions to map to IO and > UI. > > As a total, they have around 100+ function. > > > > Those can be easily done in Lua. > > [...] > > For a project in one of my earlier companies, I used SPARK[1] to write a > little parser for a language of my own making to used to specify some > conditionals. > > The parser would convert this into a python expression which could be > evaluated with some objects to return a true or a false. > > If you have the grammar of your source language at hand, it's a fews > hours job to write a parser for it using SPARK. Once you do that, you > have to write a backend to convert it into LUA which might be a little > more complex but not impossibly so. > > > > > Footnotes: > [1] http://pages.cpsc.ucalgary.ca/~aycock/spark/ > > -- > ~noufal > http://nibrahim.net.in > > An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, American > comic and columnist > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From benignbala at gmail.com Tue Aug 23 08:09:18 2011 From: benignbala at gmail.com (Balachandran Sivakumar) Date: Tue, 23 Aug 2011 11:39:18 +0530 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: References: Message-ID: Hi, On Tue, Aug 23, 2011 at 12:39 AM, Gopalakrishnan Subramani wrote: > > The idea is to convert the 'Description Language' code to Lua code using > Python. This involves 2 things. One is parsing and another is generation. In > between 2, I need to make a tree as a output from parser, kind of AST. > LLVM is a good tool for such stuff. llvm-py is the one with python bindings. The original LLVM site has good tutorials and examples. Project URL: http://www.mdevan.org/llvm-py/ -- Thank you Balachandran Sivakumar Arise Awake and stop not till the goal is reached. Mail: benignbala at gmail.com Blog: http://benignbala.wordpress.com/ From sree at mahiti.org Tue Aug 23 10:11:59 2011 From: sree at mahiti.org (Sreekanth S Rameshaiah) Date: Tue, 23 Aug 2011 13:41:59 +0530 Subject: [BangPypers] Create Better Python community In-Reply-To: <20110822235144.GA3514@mathmagic> References: <877h6hvlkg.fsf@sanitarium.localdomain> <87liuqui66.fsf@sanitarium.localdomain> <1313731051.21876.22.camel@xlquest.web> <8762ltvrgv.fsf@sanitarium.localdomain> <1313736313.21876.24.camel@xlquest.web> <1313756980.21876.32.camel@xlquest.web> <20110822235144.GA3514@mathmagic> Message-ID: On 23 August 2011 05:21, Senthil Kumaran wrote: > On Fri, Aug 19, 2011 at 05:59:37PM +0530, Kenneth Gonsalves wrote: > > > > > > > > on several occasions we had 2 > > > > > > > > > > I dont call that a user group meeting. That is definitely > > > apathy though better than no meeting any day. > > > > it works > > And yes, that is what is required. So, regular schedule with even two > people coming up is a good thing. > +1 From abpillai at gmail.com Tue Aug 23 11:04:31 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Tue, 23 Aug 2011 14:34:31 +0530 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: References: <20110823001047.GB3514@mathmagic> <87ippor967.fsf@sanitarium.localdomain> Message-ID: On Tue, Aug 23, 2011 at 11:15 AM, Gopalakrishnan Subramani < gopalakrishnan.subramani at gmail.com> wrote: > I could make a grammar compiled myself. I will look into SPARK.. Anybody > has > experience in pyparsing http://pyparsing.wikispaces.com/ ? > Under Examples http://pyparsing.wikispaces.com/Examples Python language > example is promising. > Have you taken a look at Lunatic Python ? http://labix.org/lunatic-python Looks like it already provides the required interfaces you need. > > Regards, > > Gopal > > > On Mon, Aug 22, 2011 at 11:25 PM, Noufal Ibrahim wrote: > > > Gopalakrishnan Subramani writes: > > > > > Source language IO is very limited and it has functions to map to IO > and > > UI. > > > As a total, they have around 100+ function. > > > > > > Those can be easily done in Lua. > > > > [...] > > > > For a project in one of my earlier companies, I used SPARK[1] to write a > > little parser for a language of my own making to used to specify some > > conditionals. > > > > The parser would convert this into a python expression which could be > > evaluated with some objects to return a true or a false. > > > > If you have the grammar of your source language at hand, it's a fews > > hours job to write a parser for it using SPARK. Once you do that, you > > have to write a backend to convert it into LUA which might be a little > > more complex but not impossibly so. > > > > > > > > > > Footnotes: > > [1] http://pages.cpsc.ucalgary.ca/~aycock/spark/ > > > > -- > > ~noufal > > http://nibrahim.net.in > > > > An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, American > > comic and columnist > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From ashulinux at yahoo.com Tue Aug 23 12:46:23 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Tue, 23 Aug 2011 03:46:23 -0700 (PDT) Subject: [BangPypers] Updating Python 2.3.4 to 2.6.1 on RHEL 4 Message-ID: <1314096383.67198.YahooMailNeo@web111412.mail.gq1.yahoo.com> Hi, I wrote a script that involves "subprocess" module ; and when I ran it on? a production server I found that due to older version of Python 2.3.4 my script failed to execute. I have the following python version on one of the RedHat servers. Python 2.3.4 (#1, Feb 18 2008, 17:17:04) [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 Now, the concern is of updating Python version to 2.6.1 w/o effecting other things eg: system-config-* on RedHat machine which are dependent on current Python version 2.3.4 So far I have downloaded the source tar ball, untarred it and NOT yet executed - ./configure --prefix=/opt where I want it to land. Can I now run make, make install ? Any inputs on whether this is the right way to do withoutoverriding current default Python ? Thank you, ~ Ashutosh Narayan From abpillai at gmail.com Tue Aug 23 13:36:44 2011 From: abpillai at gmail.com (Anand Balachandran Pillai) Date: Tue, 23 Aug 2011 17:06:44 +0530 Subject: [BangPypers] Updating Python 2.3.4 to 2.6.1 on RHEL 4 In-Reply-To: <1314096383.67198.YahooMailNeo@web111412.mail.gq1.yahoo.com> References: <1314096383.67198.YahooMailNeo@web111412.mail.gq1.yahoo.com> Message-ID: On Tue, Aug 23, 2011 at 4:16 PM, Ashutosh Narayan wrote: > Hi, > > I wrote a script that involves "subprocess" module ; and when I ran it > on a production server I found that due to older version of Python 2.3.4 > my script failed to execute. > > I have the following python version on one of the RedHat servers. > Python 2.3.4 (#1, Feb 18 2008, 17:17:04) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 > > Now, the concern is of updating Python version to 2.6.1 w/o effecting > other things eg: system-config-* on RedHat machine which are dependent > on current Python version 2.3.4 > > So far I have downloaded the source tar ball, untarred it and NOT yet > executed - > ./configure --prefix=/opt where I want it to land. Can I now run make, make > install ? > > Any inputs on whether this is the right way to do withoutoverriding current > default Python ? > > 1. Install to a different prefix on the system (/usr/local/, /opt etc). 2. Use virtualenv > Thank you, > > > ~ Ashutosh Narayan > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- --Anand From dhananjay.nene at gmail.com Wed Aug 24 07:31:25 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 11:01:25 +0530 Subject: [BangPypers] Embedded python mail server Message-ID: What would be good options to embed a python mail server ? The scope is strictly restricted to automated testing. So the embedded mail server (embedded in the test cases) acts as the server which receives email and is in turn further queried to ensure receipt of email correctly. One option is http://lamsonproject.org/ Are there any other options you might suggest? Dhananjay From anandology at gmail.com Wed Aug 24 07:36:29 2011 From: anandology at gmail.com (Anand Chitipothu) Date: Wed, 24 Aug 2011 11:06:29 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: 2011/8/24 Dhananjay Nene : > What would be good options to embed a python mail server ? > > The scope is strictly restricted to automated testing. So the embedded > mail server (embedded in the test cases) acts as the server which > receives email and is in turn further queried to ensure receipt of > email correctly. > > One option is http://lamsonproject.org/ > > Are there any other options you might suggest? Do you really want to run a mail server for testing? I usually monkey patch the function to send email and store the emails in a global variable for later access. Anand From dhananjay.nene at gmail.com Wed Aug 24 07:39:49 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 11:09:49 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu wrote: > 2011/8/24 Dhananjay Nene : >> What would be good options to embed a python mail server ? >> >> The scope is strictly restricted to automated testing. So the embedded >> mail server (embedded in the test cases) acts as the server which >> receives email and is in turn further queried to ensure receipt of >> email correctly. >> >> One option is http://lamsonproject.org/ >> >> Are there any other options you might suggest? > > Do you really want to run a mail server for testing? I usually monkey > patch the function to send email and store the emails in a global > variable for later access. > In automated acceptance testing context I believe it would be appropriate to implement a mail server. With unit tests, stubbing the mail server with a mock would've been fine. Dhananjay From ashulinux at yahoo.com Wed Aug 24 07:55:53 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Tue, 23 Aug 2011 22:55:53 -0700 (PDT) Subject: [BangPypers] Updating Python 2.3.4 to 2.6.1 on RHEL 4 In-Reply-To: References: <1314096383.67198.YahooMailNeo@web111412.mail.gq1.yahoo.com> Message-ID: <1314165353.95641.YahooMailNeo@web111409.mail.gq1.yahoo.com> Worked for me. Thanks ! ? ~ Ashutosh >________________________________ >From: Anand Balachandran Pillai >To: Ashutosh Narayan ; Bangalore Python Users Group - India >Sent: Tuesday, August 23, 2011 5:06 PM >Subject: Re: [BangPypers] Updating Python 2.3.4 to 2.6.1 on RHEL 4 > > > > > >On Tue, Aug 23, 2011 at 4:16 PM, Ashutosh Narayan wrote: > >Hi, >> >>I wrote a script that involves "subprocess" module ; and when I ran it >>on? a production server I found that due to older version of Python 2.3.4 >>my script failed to execute. >> >>I have the following python version on one of the RedHat servers. >>Python 2.3.4 (#1, Feb 18 2008, 17:17:04) >>[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2 >> >>Now, the concern is of updating Python version to 2.6.1 w/o effecting >>other things eg: system-config-* on RedHat machine which are dependent >>on current Python version 2.3.4 >> >>So far I have downloaded the source tar ball, untarred it and NOT yet executed - >>./configure --prefix=/opt where I want it to land. Can I now run make, make install ? >> >>Any inputs on whether this is the right way to do withoutoverriding current default Python ? >> >> > >1.? Install to a different prefix on the system (/usr/local/, /opt etc). >2.? Use virtualenv > >? >Thank you, >> >> >>~ Ashutosh Narayan >>_______________________________________________ >>BangPypers mailing list >>BangPypers at python.org >>http://mail.python.org/mailman/listinfo/bangpypers >> > > >-- >--Anand > > > > > > From gopalakrishnan.subramani at gmail.com Wed Aug 24 08:33:28 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 00:33:28 -0600 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd is a proxy so only look at the client interface level, you may not need to push to local server, no need to store to DB etc. you copy the file and modify and wrap to meet your automation needs and to get the response confirmation once the mail delivered. SMTP RFC is very simple to code even in C++ & Java. But until or unless you have mail client or mail proxy or a email server as your core business/module or automating the application functional testing, you don't need to worry about testing with real mail server. Since you have mentioned as automated test, I assume that you don't mean unit testing. Regards, Gopal On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene wrote: > On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu > wrote: > > 2011/8/24 Dhananjay Nene : > >> What would be good options to embed a python mail server ? > >> > >> The scope is strictly restricted to automated testing. So the embedded > >> mail server (embedded in the test cases) acts as the server which > >> receives email and is in turn further queried to ensure receipt of > >> email correctly. > >> > >> One option is http://lamsonproject.org/ > >> > >> Are there any other options you might suggest? > > > > Do you really want to run a mail server for testing? I usually monkey > > patch the function to send email and store the emails in a global > > variable for later access. > > > > In automated acceptance testing context I believe it would be > appropriate to implement a mail server. With unit tests, stubbing the > mail server with a mock would've been fine. > > Dhananjay > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From amit.pureenergy at gmail.com Wed Aug 24 08:35:08 2011 From: amit.pureenergy at gmail.com (Amit Sethi) Date: Wed, 24 Aug 2011 12:05:08 +0530 Subject: [BangPypers] setuptools and distutils confusion Message-ID: Hi all, I am really confused as to how setuptools and distutils work. Basically what i want to achieve is be able to install packages in my local environment and not globally ( just a preference ) . I know I can use virtualenv and distribute but i just want to do some simple testing and don't really want to setup a virtualenv for that. The usual practice I adopted for this was that in setup.py I would change the lines from setuptools import setup to from distutils.core import setup this way i can use python setup.py develop instead of python setup.py install and it will install the package in the same directory but it turns out when i use python setup.py develop in this fashion while this particular package is installed locally all other packages acquired from pypi are installed in the usual way . Is there any way i can solve that make it install all packages locally .. Thanks Amit -- A-M-I-T S|S From gopalakrishnan.subramani at gmail.com Wed Aug 24 08:37:59 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 00:37:59 -0600 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: References: <20110823001047.GB3514@mathmagic> <87ippor967.fsf@sanitarium.localdomain> Message-ID: This is not about running Lua inside Python or Python inside Lua. I will go thorough few of tools you all mentioned and will back. Making a grammar is really fun. I am more curious to know how the AST would turn to be. -- Gopal On Tue, Aug 23, 2011 at 3:04 AM, Anand Balachandran Pillai < abpillai at gmail.com> wrote: > On Tue, Aug 23, 2011 at 11:15 AM, Gopalakrishnan Subramani < > gopalakrishnan.subramani at gmail.com> wrote: > > > I could make a grammar compiled myself. I will look into SPARK.. Anybody > > has > > experience in pyparsing http://pyparsing.wikispaces.com/ ? > > Under Examples http://pyparsing.wikispaces.com/Examples Python language > > example is promising. > > > > Have you taken a look at Lunatic Python ? > > http://labix.org/lunatic-python > > Looks like it already provides the required interfaces you need. > > > > > > > Regards, > > > > Gopal > > > > > > On Mon, Aug 22, 2011 at 11:25 PM, Noufal Ibrahim > wrote: > > > > > Gopalakrishnan Subramani writes: > > > > > > > Source language IO is very limited and it has functions to map to IO > > and > > > UI. > > > > As a total, they have around 100+ function. > > > > > > > > Those can be easily done in Lua. > > > > > > [...] > > > > > > For a project in one of my earlier companies, I used SPARK[1] to write > a > > > little parser for a language of my own making to used to specify some > > > conditionals. > > > > > > The parser would convert this into a python expression which could be > > > evaluated with some objects to return a true or a false. > > > > > > If you have the grammar of your source language at hand, it's a fews > > > hours job to write a parser for it using SPARK. Once you do that, you > > > have to write a backend to convert it into LUA which might be a little > > > more complex but not impossibly so. > > > > > > > > > > > > > > > Footnotes: > > > [1] http://pages.cpsc.ucalgary.ca/~aycock/spark/ > > > > > > -- > > > ~noufal > > > http://nibrahim.net.in > > > > > > An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, > American > > > comic and columnist > > > _______________________________________________ > > > BangPypers mailing list > > > BangPypers at python.org > > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > _______________________________________________ > > BangPypers mailing list > > BangPypers at python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > --Anand > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dhananjay.nene at gmail.com Wed Aug 24 08:42:12 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 12:12:12 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani wrote: > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd is > a proxy so only look at the client interface level, you may not need to push > to local server, no need to store to DB etc. > > you copy the file and modify and wrap to meet your automation needs and to > get the response confirmation once the mail delivered. > > SMTP RFC is very simple to code even in C++ & Java. ?But until or unless you > have mail client or mail proxy or a email server as your core > business/module or automating the application functional testing, you don't > need to worry about testing with real mail server. > > Since you have mentioned as automated test, I assume that you don't mean > unit testing. It is automated acceptance testing .. so testing is strictly at the system boundaries. So it has to test the released version of the artifact - without *any* changes. I presume that would constrain me from introducing a different smtpd.py > Gopal > > > > > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene > wrote: > >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu >> wrote: >> > 2011/8/24 Dhananjay Nene : >> >> What would be good options to embed a python mail server ? >> >> >> >> The scope is strictly restricted to automated testing. So the embedded >> >> mail server (embedded in the test cases) acts as the server which >> >> receives email and is in turn further queried to ensure receipt of >> >> email correctly. >> >> >> >> One option is http://lamsonproject.org/ >> >> >> >> Are there any other options you might suggest? >> > >> > Do you really want to run a mail server for testing? I usually monkey >> > patch the function to send email and store the emails in a global >> > variable for later access. >> > >> >> In automated acceptance testing context I believe it would be >> appropriate to implement a mail server. With unit tests, stubbing the >> mail server with a mock would've been fine. >> >> Dhananjay From noufal at gmail.com Wed Aug 24 08:44:43 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Wed, 24 Aug 2011 12:14:43 +0530 Subject: [BangPypers] setuptools and distutils confusion In-Reply-To: (Amit Sethi's message of "Wed, 24 Aug 2011 12:05:08 +0530") References: Message-ID: <87liujnw9w.fsf@sanitarium.localdomain> Amit Sethi writes: > Hi all, > I am really confused as to how setuptools and distutils work. > Basically what i want to achieve is be able to install packages in my > local environment and not globally ( just a preference ) . I know I > can use virtualenv and distribute but i just want to do some simple > testing and don't really want to setup a virtualenv for that. The first question is why. Virtualenv is designed for exactly this and trying to not use it will create more problems than it solves. distribute *is* setuptools (a fork which is more featureful) so there's no difference there. > The usual practice I adopted for this was that in setup.py I would > change the lines > from setuptools import setup > to > from distutils.core import setup > this way i can use > > python setup.py develop instead of python setup.py install > and it will install the package in the same directory > > but it turns out when i use python setup.py develop in this fashion > while this particular package is installed locally all other packages > acquired from pypi are installed in the usual way . Is there any way i > can solve that make it install all packages locally .. The "develop" command installs all dependencies and make some other changes so that you can use your existing copy directly without having to "install" it. I suppose you could manually download/unpack all your dependencies into the right places and then fix your PYTHONPATH to pick them up properly. You could also automate this but it would be a pain. So, my basic question is - why not use virtualenv. [...] -- ~noufal http://nibrahim.net.in Evil isn't all bad. From gopalakrishnan.subramani at gmail.com Wed Aug 24 08:46:48 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 00:46:48 -0600 Subject: [BangPypers] setuptools and distutils confusion In-Reply-To: References: Message-ID: setuptools is for the users who use a package produced by someone. disutils is for users who produce the package. On Wed, Aug 24, 2011 at 12:35 AM, Amit Sethi wrote: > Hi all, > I am really confused as to how setuptools and distutils work. > Basically what i want to achieve is be able to install packages in my > local environment and not globally ( just a preference ) . I know I > can use virtualenv and distribute but i just want to do some simple > testing and don't really want to setup a virtualenv for that. > > The usual practice I adopted for this was that in setup.py I would > change the lines > from setuptools import setup > to > from distutils.core import setup > this way i can use > > python setup.py develop instead of python setup.py install > and it will install the package in the same directory > > but it turns out when i use python setup.py develop > in this fashion while this particular package is installed locally all > other packages acquired from pypi are installed in the usual way . Is > there any way i can solve that make it install all packages locally .. > > Thanks > Amit > > -- > A-M-I-T S|S > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From noufal at gmail.com Wed Aug 24 08:53:32 2011 From: noufal at gmail.com (Noufal Ibrahim) Date: Wed, 24 Aug 2011 12:23:32 +0530 Subject: [BangPypers] setuptools and distutils confusion In-Reply-To: (Gopalakrishnan Subramani's message of "Wed, 24 Aug 2011 00:46:48 -0600") References: Message-ID: <87hb57nvv7.fsf@sanitarium.localdomain> Gopalakrishnan Subramani writes: > setuptools is for the users who use a package produced by someone. > disutils is for users who produce the package. Not really. distutils is the packaging system provided by the standard library. setuptools is an extension of distutils which provides automatic fetching from PyPI etc. It's installer is easy_install. distribute is a fork of setuptools that was created because setuptools was stagnating. pip is a replacement for easy_install that's standalone. distutils2 is a completel rewrite and cleanup of the above mess. [...] -- ~noufal http://nibrahim.net.in I disagree with unanimity. From gopalakrishnan.subramani at gmail.com Wed Aug 24 08:55:26 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 00:55:26 -0600 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: So you basically look for SMTP and also a POP3 access to the server? With that you could send a mail using SMTP and retrieve using POP3 to make sure the mail reached safely? There is no way to get the return receipt in SMTP (sorry, I could be wrong since I coded SMTP & POP3 6 years back with limited support). I used jmailsrv which is simple to configure and test on your scenarios. If you could share your testing strategy to test email, it would lead to good discussion. Regards, Gopal On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene wrote: > On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani > wrote: > > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd > is > > a proxy so only look at the client interface level, you may not need to > push > > to local server, no need to store to DB etc. > > > > you copy the file and modify and wrap to meet your automation needs and > to > > get the response confirmation once the mail delivered. > > > > SMTP RFC is very simple to code even in C++ & Java. But until or unless > you > > have mail client or mail proxy or a email server as your core > > business/module or automating the application functional testing, you > don't > > need to worry about testing with real mail server. > > > > Since you have mentioned as automated test, I assume that you don't mean > > unit testing. > > It is automated acceptance testing .. so testing is strictly at the > system boundaries. So it has to test the released version of the > artifact - without *any* changes. I presume that would constrain me > from introducing a different smtpd.py > > > Gopal > > > > > > > > > > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene > > wrote: > > > >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < > anandology at gmail.com> > >> wrote: > >> > 2011/8/24 Dhananjay Nene : > >> >> What would be good options to embed a python mail server ? > >> >> > >> >> The scope is strictly restricted to automated testing. So the > embedded > >> >> mail server (embedded in the test cases) acts as the server which > >> >> receives email and is in turn further queried to ensure receipt of > >> >> email correctly. > >> >> > >> >> One option is http://lamsonproject.org/ > >> >> > >> >> Are there any other options you might suggest? > >> > > >> > Do you really want to run a mail server for testing? I usually monkey > >> > patch the function to send email and store the emails in a global > >> > variable for later access. > >> > > >> > >> In automated acceptance testing context I believe it would be > >> appropriate to implement a mail server. With unit tests, stubbing the > >> mail server with a mock would've been fine. > >> > >> Dhananjay > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From gopalakrishnan.subramani at gmail.com Wed Aug 24 08:58:29 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 00:58:29 -0600 Subject: [BangPypers] setuptools and distutils confusion In-Reply-To: <87hb57nvv7.fsf@sanitarium.localdomain> References: <87hb57nvv7.fsf@sanitarium.localdomain> Message-ID: Thanks Noufal. I misunderstood. I was using disutils for to create a package for my app. -- Gopal On Wed, Aug 24, 2011 at 12:53 AM, Noufal Ibrahim wrote: > Gopalakrishnan Subramani writes: > > > setuptools is for the users who use a package produced by someone. > > disutils is for users who produce the package. > > Not really. distutils is the packaging system provided by the standard > library. > > setuptools is an extension of distutils which provides automatic > fetching from PyPI etc. It's installer is easy_install. > > distribute is a fork of setuptools that was created because setuptools > was stagnating. > > pip is a replacement for easy_install that's standalone. > > distutils2 is a completel rewrite and cleanup of the above mess. > > > [...] > > > -- > ~noufal > http://nibrahim.net.in > > I disagree with unanimity. > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dhananjay.nene at gmail.com Wed Aug 24 09:04:04 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 12:34:04 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 12:25 PM, Gopalakrishnan Subramani wrote: > So you basically look for SMTP and also a POP3 access to the server? With > that you could send a mail using SMTP and retrieve using POP3 to make sure > the mail reached safely? There is no way to get the return receipt in SMTP > (sorry, I could be wrong since I coded SMTP & POP3 6 years back with limited > support). Only SMTP with programmatic access to query received emails is good enough. > > I used jmailsrv which is simple to configure and test on your scenarios. > > If you could share your testing strategy to test email, it would lead to > good discussion. > There is an released artifact "X". X needs to be tested for acceptance criteria. No code changes can be introduced into X. X sends out emails. Test cases need to test whether the mails got sent out correctly. Thus after running test sequences, the mails that have gone out need to be verified. The intent is to embed the mail server into the test case (not X). Thus outgoing emails from X will get dispatched to and received by the embedded mail server. Since test cases (but not X) have programmatic access to X and its datastore, using whatever is the available mail server api to query the mails it has received is acceptable mechanism of verification. Using a embedded python mail server helps the test cases to just test the received emails using python calls rather than having to do POP3 calls instead. Dhananjay > > On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene > wrote: > >> On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani >> wrote: >> > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd >> is >> > a proxy so only look at the client interface level, you may not need to >> push >> > to local server, no need to store to DB etc. >> > >> > you copy the file and modify and wrap to meet your automation needs and >> to >> > get the response confirmation once the mail delivered. >> > >> > SMTP RFC is very simple to code even in C++ & Java. ?But until or unless >> you >> > have mail client or mail proxy or a email server as your core >> > business/module or automating the application functional testing, you >> don't >> > need to worry about testing with real mail server. >> > >> > Since you have mentioned as automated test, I assume that you don't mean >> > unit testing. >> >> It is automated acceptance testing .. so testing is strictly at the >> system boundaries. So it has to test the released version of the >> artifact - without *any* changes. I presume that would constrain me >> from introducing a different smtpd.py >> >> > Gopal >> > >> > >> > >> > >> > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene >> > wrote: >> > >> >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < >> anandology at gmail.com> >> >> wrote: >> >> > 2011/8/24 Dhananjay Nene : >> >> >> What would be good options to embed a python mail server ? >> >> >> >> >> >> The scope is strictly restricted to automated testing. So the >> embedded >> >> >> mail server (embedded in the test cases) acts as the server which >> >> >> receives email and is in turn further queried to ensure receipt of >> >> >> email correctly. >> >> >> >> >> >> One option is http://lamsonproject.org/ >> >> >> >> >> >> Are there any other options you might suggest? >> >> > >> >> > Do you really want to run a mail server for testing? I usually monkey >> >> > patch the function to send email and store the emails in a global >> >> > variable for later access. >> >> > >> >> >> >> In automated acceptance testing context I believe it would be >> >> appropriate to implement a mail server. With unit tests, stubbing the >> >> mail server with a mock would've been fine. >> >> >> >> Dhananjay >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From dhananjay.nene at gmail.com Wed Aug 24 09:07:18 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 12:37:18 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 12:34 PM, Dhananjay Nene wrote: > On Wed, Aug 24, 2011 at 12:25 PM, Gopalakrishnan Subramani > wrote: >> So you basically look for SMTP and also a POP3 access to the server? With >> that you could send a mail using SMTP and retrieve using POP3 to make sure >> the mail reached safely? There is no way to get the return receipt in SMTP >> (sorry, I could be wrong since I coded SMTP & POP3 6 years back with limited >> support). > > Only SMTP with programmatic access to query received emails is good enough. >> >> I used jmailsrv which is simple to configure and test on your scenarios. >> >> If you could share your testing strategy to test email, it would lead to >> good discussion. >> > > There is an released artifact "X". X needs to be tested for acceptance > criteria. No code changes can be introduced into X. X sends out > emails. Test cases need to test whether the mails got sent out > correctly. Thus after running test sequences, the mails that have gone > out need to be verified. The intent is to embed the mail server into > the test case (not X). Thus outgoing emails from X will get dispatched > to and received by the embedded mail server. Since test cases (but not > X) have programmatic access to X and its datastore, using whatever is > the available mail server api to query the mails it has received is > acceptable mechanism of verification. Using a embedded python mail > server helps the test cases to just test the received emails using > python calls rather than having to do POP3 calls instead. > s/programmatic access to X and its datastore/programmatic access to mail server and its datastore/g > Dhananjay > >> >> On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene >> wrote: >> >>> On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani >>> wrote: >>> > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd >>> is >>> > a proxy so only look at the client interface level, you may not need to >>> push >>> > to local server, no need to store to DB etc. >>> > >>> > you copy the file and modify and wrap to meet your automation needs and >>> to >>> > get the response confirmation once the mail delivered. >>> > >>> > SMTP RFC is very simple to code even in C++ & Java. ?But until or unless >>> you >>> > have mail client or mail proxy or a email server as your core >>> > business/module or automating the application functional testing, you >>> don't >>> > need to worry about testing with real mail server. >>> > >>> > Since you have mentioned as automated test, I assume that you don't mean >>> > unit testing. >>> >>> It is automated acceptance testing .. so testing is strictly at the >>> system boundaries. So it has to test the released version of the >>> artifact - without *any* changes. I presume that would constrain me >>> from introducing a different smtpd.py >>> >>> > Gopal >>> > >>> > >>> > >>> > >>> > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene >>> > wrote: >>> > >>> >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < >>> anandology at gmail.com> >>> >> wrote: >>> >> > 2011/8/24 Dhananjay Nene : >>> >> >> What would be good options to embed a python mail server ? >>> >> >> >>> >> >> The scope is strictly restricted to automated testing. So the >>> embedded >>> >> >> mail server (embedded in the test cases) acts as the server which >>> >> >> receives email and is in turn further queried to ensure receipt of >>> >> >> email correctly. >>> >> >> >>> >> >> One option is http://lamsonproject.org/ >>> >> >> >>> >> >> Are there any other options you might suggest? >>> >> > >>> >> > Do you really want to run a mail server for testing? I usually monkey >>> >> > patch the function to send email and store the emails in a global >>> >> > variable for later access. >>> >> > >>> >> >>> >> In automated acceptance testing context I believe it would be >>> >> appropriate to implement a mail server. With unit tests, stubbing the >>> >> mail server with a mock would've been fine. >>> >> >>> >> Dhananjay >>> _______________________________________________ >>> BangPypers mailing list >>> BangPypers at python.org >>> http://mail.python.org/mailman/listinfo/bangpypers >>> >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> > > > > -- > ---------------------------------------------------------------------------------------------------------------------------------- > http://blog.dhananjaynene.com twitter: @dnene google plus: > http://gplus.to/dhananjaynene > -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From dhananjay.nene at gmail.com Wed Aug 24 09:10:38 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 12:40:38 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: Just discovered http://www.lastcraft.com/fakemail.php On Wed, Aug 24, 2011 at 12:37 PM, Dhananjay Nene wrote: > On Wed, Aug 24, 2011 at 12:34 PM, Dhananjay Nene > wrote: >> On Wed, Aug 24, 2011 at 12:25 PM, Gopalakrishnan Subramani >> wrote: >>> So you basically look for SMTP and also a POP3 access to the server? With >>> that you could send a mail using SMTP and retrieve using POP3 to make sure >>> the mail reached safely? There is no way to get the return receipt in SMTP >>> (sorry, I could be wrong since I coded SMTP & POP3 6 years back with limited >>> support). >> >> Only SMTP with programmatic access to query received emails is good enough. >>> >>> I used jmailsrv which is simple to configure and test on your scenarios. >>> >>> If you could share your testing strategy to test email, it would lead to >>> good discussion. >>> >> >> There is an released artifact "X". X needs to be tested for acceptance >> criteria. No code changes can be introduced into X. X sends out >> emails. Test cases need to test whether the mails got sent out >> correctly. Thus after running test sequences, the mails that have gone >> out need to be verified. The intent is to embed the mail server into >> the test case (not X). Thus outgoing emails from X will get dispatched >> to and received by the embedded mail server. Since test cases (but not >> X) have programmatic access to X and its datastore, using whatever is >> the available mail server api to query the mails it has received is >> acceptable mechanism of verification. Using a embedded python mail >> server helps the test cases to just test the received emails using >> python calls rather than having to do POP3 calls instead. >> > s/programmatic access to X and its datastore/programmatic access to > mail server and its datastore/g >> Dhananjay >> >>> >>> On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene >>> wrote: >>> >>>> On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani >>>> wrote: >>>> > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd >>>> is >>>> > a proxy so only look at the client interface level, you may not need to >>>> push >>>> > to local server, no need to store to DB etc. >>>> > >>>> > you copy the file and modify and wrap to meet your automation needs and >>>> to >>>> > get the response confirmation once the mail delivered. >>>> > >>>> > SMTP RFC is very simple to code even in C++ & Java. ?But until or unless >>>> you >>>> > have mail client or mail proxy or a email server as your core >>>> > business/module or automating the application functional testing, you >>>> don't >>>> > need to worry about testing with real mail server. >>>> > >>>> > Since you have mentioned as automated test, I assume that you don't mean >>>> > unit testing. >>>> >>>> It is automated acceptance testing .. so testing is strictly at the >>>> system boundaries. So it has to test the released version of the >>>> artifact - without *any* changes. I presume that would constrain me >>>> from introducing a different smtpd.py >>>> >>>> > Gopal >>>> > >>>> > >>>> > >>>> > >>>> > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene >>>> > wrote: >>>> > >>>> >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < >>>> anandology at gmail.com> >>>> >> wrote: >>>> >> > 2011/8/24 Dhananjay Nene : >>>> >> >> What would be good options to embed a python mail server ? >>>> >> >> >>>> >> >> The scope is strictly restricted to automated testing. So the >>>> embedded >>>> >> >> mail server (embedded in the test cases) acts as the server which >>>> >> >> receives email and is in turn further queried to ensure receipt of >>>> >> >> email correctly. >>>> >> >> >>>> >> >> One option is http://lamsonproject.org/ >>>> >> >> >>>> >> >> Are there any other options you might suggest? >>>> >> > >>>> >> > Do you really want to run a mail server for testing? I usually monkey >>>> >> > patch the function to send email and store the emails in a global >>>> >> > variable for later access. >>>> >> > >>>> >> >>>> >> In automated acceptance testing context I believe it would be >>>> >> appropriate to implement a mail server. With unit tests, stubbing the >>>> >> mail server with a mock would've been fine. >>>> >> >>>> >> Dhananjay >>>> _______________________________________________ >>>> BangPypers mailing list >>>> BangPypers at python.org >>>> http://mail.python.org/mailman/listinfo/bangpypers >>>> >>> _______________________________________________ >>> BangPypers mailing list >>> BangPypers at python.org >>> http://mail.python.org/mailman/listinfo/bangpypers >>> >> >> >> >> -- >> ---------------------------------------------------------------------------------------------------------------------------------- >> http://blog.dhananjaynene.com twitter: @dnene google plus: >> http://gplus.to/dhananjaynene >> > > > > -- > ---------------------------------------------------------------------------------------------------------------------------------- > http://blog.dhananjaynene.com twitter: @dnene google plus: > http://gplus.to/dhananjaynene > -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From gopalakrishnan.subramani at gmail.com Wed Aug 24 09:18:58 2011 From: gopalakrishnan.subramani at gmail.com (Gopalakrishnan Subramani) Date: Wed, 24 Aug 2011 01:18:58 -0600 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: fakemail seems to be right solution to me. interesting discovery. On Wed, Aug 24, 2011 at 1:10 AM, Dhananjay Nene wrote: > Just discovered http://www.lastcraft.com/fakemail.php > > On Wed, Aug 24, 2011 at 12:37 PM, Dhananjay Nene > wrote: > > On Wed, Aug 24, 2011 at 12:34 PM, Dhananjay Nene > > wrote: > >> On Wed, Aug 24, 2011 at 12:25 PM, Gopalakrishnan Subramani > >> wrote: > >>> So you basically look for SMTP and also a POP3 access to the server? > With > >>> that you could send a mail using SMTP and retrieve using POP3 to make > sure > >>> the mail reached safely? There is no way to get the return receipt in > SMTP > >>> (sorry, I could be wrong since I coded SMTP & POP3 6 years back with > limited > >>> support). > >> > >> Only SMTP with programmatic access to query received emails is good > enough. > >>> > >>> I used jmailsrv which is simple to configure and test on your > scenarios. > >>> > >>> If you could share your testing strategy to test email, it would lead > to > >>> good discussion. > >>> > >> > >> There is an released artifact "X". X needs to be tested for acceptance > >> criteria. No code changes can be introduced into X. X sends out > >> emails. Test cases need to test whether the mails got sent out > >> correctly. Thus after running test sequences, the mails that have gone > >> out need to be verified. The intent is to embed the mail server into > >> the test case (not X). Thus outgoing emails from X will get dispatched > >> to and received by the embedded mail server. Since test cases (but not > >> X) have programmatic access to X and its datastore, using whatever is > >> the available mail server api to query the mails it has received is > >> acceptable mechanism of verification. Using a embedded python mail > >> server helps the test cases to just test the received emails using > >> python calls rather than having to do POP3 calls instead. > >> > > s/programmatic access to X and its datastore/programmatic access to > > mail server and its datastore/g > >> Dhananjay > >> > >>> > >>> On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene > >>> wrote: > >>> > >>>> On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani > >>>> wrote: > >>>> > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. > smtpd > >>>> is > >>>> > a proxy so only look at the client interface level, you may not need > to > >>>> push > >>>> > to local server, no need to store to DB etc. > >>>> > > >>>> > you copy the file and modify and wrap to meet your automation needs > and > >>>> to > >>>> > get the response confirmation once the mail delivered. > >>>> > > >>>> > SMTP RFC is very simple to code even in C++ & Java. But until or > unless > >>>> you > >>>> > have mail client or mail proxy or a email server as your core > >>>> > business/module or automating the application functional testing, > you > >>>> don't > >>>> > need to worry about testing with real mail server. > >>>> > > >>>> > Since you have mentioned as automated test, I assume that you don't > mean > >>>> > unit testing. > >>>> > >>>> It is automated acceptance testing .. so testing is strictly at the > >>>> system boundaries. So it has to test the released version of the > >>>> artifact - without *any* changes. I presume that would constrain me > >>>> from introducing a different smtpd.py > >>>> > >>>> > Gopal > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene > >>>> > wrote: > >>>> > > >>>> >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < > >>>> anandology at gmail.com> > >>>> >> wrote: > >>>> >> > 2011/8/24 Dhananjay Nene : > >>>> >> >> What would be good options to embed a python mail server ? > >>>> >> >> > >>>> >> >> The scope is strictly restricted to automated testing. So the > >>>> embedded > >>>> >> >> mail server (embedded in the test cases) acts as the server > which > >>>> >> >> receives email and is in turn further queried to ensure receipt > of > >>>> >> >> email correctly. > >>>> >> >> > >>>> >> >> One option is http://lamsonproject.org/ > >>>> >> >> > >>>> >> >> Are there any other options you might suggest? > >>>> >> > > >>>> >> > Do you really want to run a mail server for testing? I usually > monkey > >>>> >> > patch the function to send email and store the emails in a global > >>>> >> > variable for later access. > >>>> >> > > >>>> >> > >>>> >> In automated acceptance testing context I believe it would be > >>>> >> appropriate to implement a mail server. With unit tests, stubbing > the > >>>> >> mail server with a mock would've been fine. > >>>> >> > >>>> >> Dhananjay > >>>> _______________________________________________ > >>>> BangPypers mailing list > >>>> BangPypers at python.org > >>>> http://mail.python.org/mailman/listinfo/bangpypers > >>>> > >>> _______________________________________________ > >>> BangPypers mailing list > >>> BangPypers at python.org > >>> http://mail.python.org/mailman/listinfo/bangpypers > >>> > >> > >> > >> > >> -- > >> > ---------------------------------------------------------------------------------------------------------------------------------- > >> http://blog.dhananjaynene.com twitter: @dnene google plus: > >> http://gplus.to/dhananjaynene > >> > > > > > > > > -- > > > ---------------------------------------------------------------------------------------------------------------------------------- > > http://blog.dhananjaynene.com twitter: @dnene google plus: > > http://gplus.to/dhananjaynene > > > > > > -- > > ---------------------------------------------------------------------------------------------------------------------------------- > http://blog.dhananjaynene.com twitter: @dnene google plus: > http://gplus.to/dhananjaynene > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > From dhananjay.nene at gmail.com Wed Aug 24 09:35:43 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 13:05:43 +0530 Subject: [BangPypers] Embedded python mail server In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 12:48 PM, Gopalakrishnan Subramani wrote: > fakemail seems to be right solution to me. interesting discovery. > Had troubles with easy_install. Colleague recommended http://packages.python.org/lazr.smtptest/docs/queue.html Quickly tried out in shell .. works and looks like a very appropriate tool. Dhananjay > On Wed, Aug 24, 2011 at 1:10 AM, Dhananjay Nene wrote: > >> Just discovered http://www.lastcraft.com/fakemail.php >> >> On Wed, Aug 24, 2011 at 12:37 PM, Dhananjay Nene >> wrote: >> > On Wed, Aug 24, 2011 at 12:34 PM, Dhananjay Nene >> > wrote: >> >> On Wed, Aug 24, 2011 at 12:25 PM, Gopalakrishnan Subramani >> >> wrote: >> >>> So you basically look for SMTP and also a POP3 access to the server? >> With >> >>> that you could send a mail using SMTP and retrieve using POP3 to make >> sure >> >>> the mail reached safely? There is no way to get the return receipt in >> SMTP >> >>> (sorry, I could be wrong since I coded SMTP & POP3 6 years back with >> limited >> >>> support). >> >> >> >> Only SMTP with programmatic access to query received emails is good >> enough. >> >>> >> >>> I used jmailsrv which is simple to configure and test on your >> scenarios. >> >>> >> >>> If you could share your testing strategy to test email, it would lead >> to >> >>> good discussion. >> >>> >> >> >> >> There is an released artifact "X". X needs to be tested for acceptance >> >> criteria. No code changes can be introduced into X. X sends out >> >> emails. Test cases need to test whether the mails got sent out >> >> correctly. Thus after running test sequences, the mails that have gone >> >> out need to be verified. The intent is to embed the mail server into >> >> the test case (not X). Thus outgoing emails from X will get dispatched >> >> to and received by the embedded mail server. Since test cases (but not >> >> X) have programmatic access to X and its datastore, using whatever is >> >> the available mail server api to query the mails it has received is >> >> acceptable mechanism of verification. Using a embedded python mail >> >> server helps the test cases to just test the received emails using >> >> python calls rather than having to do POP3 calls instead. >> >> >> > s/programmatic access to X and its datastore/programmatic access to >> > mail server and its datastore/g >> >> Dhananjay >> >> >> >>> >> >>> On Wed, Aug 24, 2011 at 12:42 AM, Dhananjay Nene >> >>> wrote: >> >>> >> >>>> On Wed, Aug 24, 2011 at 12:03 PM, Gopalakrishnan Subramani >> >>>> wrote: >> >>>> > Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. >> smtpd >> >>>> is >> >>>> > a proxy so only look at the client interface level, you may not need >> to >> >>>> push >> >>>> > to local server, no need to store to DB etc. >> >>>> > >> >>>> > you copy the file and modify and wrap to meet your automation needs >> and >> >>>> to >> >>>> > get the response confirmation once the mail delivered. >> >>>> > >> >>>> > SMTP RFC is very simple to code even in C++ & Java. ?But until or >> unless >> >>>> you >> >>>> > have mail client or mail proxy or a email server as your core >> >>>> > business/module or automating the application functional testing, >> you >> >>>> don't >> >>>> > need to worry about testing with real mail server. >> >>>> > >> >>>> > Since you have mentioned as automated test, I assume that you don't >> mean >> >>>> > unit testing. >> >>>> >> >>>> It is automated acceptance testing .. so testing is strictly at the >> >>>> system boundaries. So it has to test the released version of the >> >>>> artifact - without *any* changes. I presume that would constrain me >> >>>> from introducing a different smtpd.py >> >>>> >> >>>> > Gopal >> >>>> > >> >>>> > >> >>>> > >> >>>> > >> >>>> > On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene >> >>>> > wrote: >> >>>> > >> >>>> >> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu < >> >>>> anandology at gmail.com> >> >>>> >> wrote: >> >>>> >> > 2011/8/24 Dhananjay Nene : >> >>>> >> >> What would be good options to embed a python mail server ? >> >>>> >> >> >> >>>> >> >> The scope is strictly restricted to automated testing. So the >> >>>> embedded >> >>>> >> >> mail server (embedded in the test cases) acts as the server >> which >> >>>> >> >> receives email and is in turn further queried to ensure receipt >> of >> >>>> >> >> email correctly. >> >>>> >> >> >> >>>> >> >> One option is http://lamsonproject.org/ >> >>>> >> >> >> >>>> >> >> Are there any other options you might suggest? >> >>>> >> > >> >>>> >> > Do you really want to run a mail server for testing? I usually >> monkey >> >>>> >> > patch the function to send email and store the emails in a global >> >>>> >> > variable for later access. >> >>>> >> > >> >>>> >> >> >>>> >> In automated acceptance testing context I believe it would be >> >>>> >> appropriate to implement a mail server. With unit tests, stubbing >> the >> >>>> >> mail server with a mock would've been fine. >> >>>> >> >> >>>> >> Dhananjay >> >>>> _______________________________________________ >> >>>> BangPypers mailing list >> >>>> BangPypers at python.org >> >>>> http://mail.python.org/mailman/listinfo/bangpypers >> >>>> >> >>> _______________________________________________ >> >>> BangPypers mailing list >> >>> BangPypers at python.org >> >>> http://mail.python.org/mailman/listinfo/bangpypers >> >>> >> >> >> >> >> >> >> >> -- >> >> >> ---------------------------------------------------------------------------------------------------------------------------------- >> >> http://blog.dhananjaynene.com twitter: @dnene google plus: >> >> http://gplus.to/dhananjaynene >> >> >> > >> > >> > >> > -- >> > >> ---------------------------------------------------------------------------------------------------------------------------------- >> > http://blog.dhananjaynene.com twitter: @dnene google plus: >> > http://gplus.to/dhananjaynene >> > >> >> >> >> -- >> >> ---------------------------------------------------------------------------------------------------------------------------------- >> http://blog.dhananjaynene.com twitter: @dnene google plus: >> http://gplus.to/dhananjaynene >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From dhananjay.nene at gmail.com Wed Aug 24 09:50:05 2011 From: dhananjay.nene at gmail.com (Dhananjay Nene) Date: Wed, 24 Aug 2011 13:20:05 +0530 Subject: [BangPypers] Language Parsing and output generation In-Reply-To: References: <20110823001047.GB3514@mathmagic> <87ippor967.fsf@sanitarium.localdomain> Message-ID: On Tue, Aug 23, 2011 at 11:15 AM, Gopalakrishnan Subramani wrote: > I could make a grammar compiled myself. I will look into SPARK.. Anybody has > experience in pyparsing http://pyparsing.wikispaces.com/ ? > Under Examples http://pyparsing.wikispaces.com/Examples Python language > example is promising. > I had written up a little about it (using a question that was earlier posted on bangpypers) and it included the pyparsing configuration as well. http://codeblog.dhananjaynene.com/2010/01/extracting-data-using-recursive-descent-parsing/ > Regards, > > Gopal > > > On Mon, Aug 22, 2011 at 11:25 PM, Noufal Ibrahim wrote: > >> Gopalakrishnan Subramani writes: >> >> > Source language IO is very limited and it has functions to map to IO and >> UI. >> > As a total, they have around 100+ function. >> > >> > Those can be easily done in Lua. >> >> [...] >> >> For a project in one of my earlier companies, I used SPARK[1] to write a >> little parser for a language of my own making to used to specify some >> conditionals. >> >> The parser would convert this into a python expression which could be >> evaluated with some objects to return a true or a false. >> >> If you have the grammar of your source language at hand, it's a fews >> hours job to write a parser for it using SPARK. Once you do that, you >> have to write a backend to convert it into LUA which might be a little >> more complex but not impossibly so. >> >> >> >> >> Footnotes: >> [1] ?http://pages.cpsc.ucalgary.ca/~aycock/spark/ >> >> -- >> ~noufal >> http://nibrahim.net.in >> >> An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, American >> comic and columnist >> _______________________________________________ >> BangPypers mailing list >> BangPypers at python.org >> http://mail.python.org/mailman/listinfo/bangpypers >> > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- ---------------------------------------------------------------------------------------------------------------------------------- http://blog.dhananjaynene.com twitter: @dnene google plus: http://gplus.to/dhananjaynene From ndaine at gmail.com Thu Aug 25 05:48:52 2011 From: ndaine at gmail.com (Nilesh Daine) Date: Thu, 25 Aug 2011 09:18:52 +0530 Subject: [BangPypers] [Opening] Python/Django Experts Message-ID: Hi All, We @Synnove Systems Pvt.Ltd, is looking for experienced - atleast 2 years - Python(Django,Pylon) people to join us full time. The position will be based in Pune. Please mail your CV to careers at synnovesystems.com. Thanks, Nilesh From ashulinux at yahoo.com Thu Aug 25 18:28:00 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Thu, 25 Aug 2011 09:28:00 -0700 (PDT) Subject: [BangPypers] Installation of SIP ( Python binding generator ) Message-ID: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> Hi, I have downloaded SIP tar file :sip-4.12.4.tar.gz While building it using "make" I encountered the following error : make[1]: Entering directory `/misc/tar_balls/projects_related/sip-4.12.4/sipgen' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/sipgen' make[1]: Entering directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' gcc -c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.7 -o siplib.o siplib.c siplib.c:20:20: fatal error: Python.h: No such file or directory compilation terminated. make[1]: *** [siplib.o] Error 1 make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' make: *** [all] Error 2 Contents of /usr/include/python2.7/ -rw-r--r-- 1 root root? 1751 2010-12-22 14:22 ImPlatform.h -rw-r--r-- 1 root root? 1317 2010-12-22 14:22 ImDib.h -rw-r--r-- 1 root root 19193 2010-12-22 14:22 Imaging.h -rw-r--r-- 1 root root 35791 2011-04-12 00:36 pyconfig.h So, I think Python.h file is not there under /usr/include/python2.7/ Hence the building failed. Anybody has encountered such error before ? Thank you, ? ~ Ashutosh Narayan From gora at mimirtech.com Thu Aug 25 18:31:49 2011 From: gora at mimirtech.com (Gora Mohanty) Date: Thu, 25 Aug 2011 22:01:49 +0530 Subject: [BangPypers] Installation of SIP ( Python binding generator ) In-Reply-To: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> References: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> Message-ID: On Thu, Aug 25, 2011 at 9:58 PM, Ashutosh Narayan wrote: [...] > I have downloaded SIP tar file :sip-4.12.4.tar.gz > While building it using "make" I encountered the following error : [...] > make[1]: Entering directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' > gcc -c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.7 -o siplib.o siplib.c > siplib.c:20:20: fatal error: Python.h: No such file or directory > compilation terminated. > make[1]: *** [siplib.o] Error 1 > make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' > make: *** [all] Error 2 [...] You are probably missing the Python development files. What OS are you using? If it is Debian/Ubuntu, you would need to install the python-dev package. Regards, Gora From ashulinux at yahoo.com Thu Aug 25 18:34:12 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Thu, 25 Aug 2011 09:34:12 -0700 (PDT) Subject: [BangPypers] [SOLVED] Installation of SIP ( Python binding generator ) In-Reply-To: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> References: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> Message-ID: <1314290052.83506.YahooMailNeo@web111413.mail.gq1.yahoo.com> gcc -c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.7 -o siplib.o siplib.c >siplib.c:20:20: fatal error: Python.h: No such file or directory >compilation terminated. >make[1]: *** [siplib.o] Error 1 >make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' >make: *** [all] Error 2 > >All I needed, was to install python-dev package. >Issue is fixed. >Apology for posting it to the group w/o giving enough thought !! >? > >~ Ashutosh Narayan >_______________________________________________ >BangPypers mailing list >BangPypers at python.org >http://mail.python.org/mailman/listinfo/bangpypers > > > From ashulinux at yahoo.com Thu Aug 25 18:34:12 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Thu, 25 Aug 2011 09:34:12 -0700 (PDT) Subject: [BangPypers] [SOLVED] Installation of SIP ( Python binding generator ) In-Reply-To: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> References: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> Message-ID: <1314290052.83506.YahooMailNeo@web111413.mail.gq1.yahoo.com> gcc -c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.7 -o siplib.o siplib.c >siplib.c:20:20: fatal error: Python.h: No such file or directory >compilation terminated. >make[1]: *** [siplib.o] Error 1 >make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' >make: *** [all] Error 2 > >All I needed, was to install python-dev package. >Issue is fixed. >Apology for posting it to the group w/o giving enough thought !! >? > >~ Ashutosh Narayan >_______________________________________________ >BangPypers mailing list >BangPypers at python.org >http://mail.python.org/mailman/listinfo/bangpypers > > > From ashulinux at yahoo.com Thu Aug 25 18:39:07 2011 From: ashulinux at yahoo.com (Ashutosh Narayan) Date: Thu, 25 Aug 2011 09:39:07 -0700 (PDT) Subject: [BangPypers] Installation of SIP ( Python binding generator ) In-Reply-To: References: <1314289680.39984.YahooMailNeo@web111405.mail.gq1.yahoo.com> Message-ID: <1314290347.83317.YahooMailNeo@web111411.mail.gq1.yahoo.com> ? ~ Ashutosh >________________________________ >From: Gora Mohanty >To: Ashutosh Narayan ; Bangalore Python Users Group - India >Sent: Thursday, August 25, 2011 10:01 PM >Subject: Re: [BangPypers] Installation of SIP ( Python binding generator ) > >On Thu, Aug 25, 2011 at 9:58 PM, Ashutosh Narayan wrote: >[...] >> I have downloaded SIP tar file :sip-4.12.4.tar.gz >> While building it using "make" I encountered the following error : >[...] >> make[1]: Entering directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' >> gcc -c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.7 -o siplib.o siplib.c >> siplib.c:20:20: fatal error: Python.h: No such file or directory >> compilation terminated. >> make[1]: *** [siplib.o] Error 1 >> make[1]: Leaving directory `/misc/tar_balls/projects_related/sip-4.12.4/siplib' >> make: *** [all] Error 2 >[...] > >You are probably missing the Python development files. >What OS are you using? If it is Debian/Ubuntu, you would >need to install the python-dev package. > >I am using Linux Mint 11, having Python 2.7.1+? [GCC 4.5.2] > >Yes, thanks Gora, I did so before reading your reply. > >Regards, >Gora > > > From vishnuprasadgaddam at gmail.com Sat Aug 27 07:47:41 2011 From: vishnuprasadgaddam at gmail.com (vishnu prasad) Date: Sat, 27 Aug 2011 11:17:41 +0530 Subject: [BangPypers] Can any one post the venue details of user group meet ? Message-ID: Hi greetings from Prasad Can any one post the venue details of bangpyers user group meet ? when ? From vikasruhil06 at gmail.com Sat Aug 27 13:26:55 2011 From: vikasruhil06 at gmail.com (vikas ruhil) Date: Sat, 27 Aug 2011 16:56:55 +0530 Subject: [BangPypers] what should be memory size memcached for Django on Ubuntu Os? Message-ID: A brief Description of system On i need help for memcached size:- 1)Cpu :- i7 intel , 16 Gb Ram , Internal SATA Hard-disk :640 Gb , External Hardisk :-10 Tb, Os :- Ubuntu-32bit 2)Cpu- i2 intel core2duo , 4Gb Ram, Internal SATA Hard-disk: 320 Gb , External Hard-disk :- 2 Tb , Os:-Ubuntu-32bit 3)Cpu- i2 intel core2duo , 4Gb Ram, Internal SATA Hard-disk: 320 Gb , External Hard-disk :- 2 Tb , Os:-FreeBsd-7.0 (I am using FreeBsd with Lamson for mailing system) Using Command line :- memcached -d -m -l 127.0.0.1 -p 11222 Anybody able to suggest memory size for Django, or for Dynamic python usage for high Performance computing Regards Vikash Ruhil From gora at mimirtech.com Sat Aug 27 19:59:37 2011 From: gora at mimirtech.com (Gora Mohanty) Date: Sat, 27 Aug 2011 23:29:37 +0530 Subject: [BangPypers] what should be memory size memcached for Django on Ubuntu Os? In-Reply-To: References: Message-ID: On Sat, Aug 27, 2011 at 4:56 PM, vikas ruhil wrote: > A brief Description of system On i ?need help for memcached size:- [...] > Using Command line ?:- memcached -d -m -l 127.0.0.1 -p 11222 > Anybody able to suggest memory size for Django, or for Dynamic python usage > for high Performance computing This is hard to say for sure without a complete strategy. This would require an understanding of what your site is doing, which parts are dynamic, and on what time scales. Django does have pretty nice caching strategies that you should look into. Also, you seem to have plenty of RAM to play with, at least on the face of things, so an aggressive caching strategy should work for you. Regards, Gora P.S. Also look into varnish, and nginx for static media. This blog is a great starting point: http://codysoyland.com/2010/jan/17/evaluating-django-caching-options/ From subhodipbiswas at gmail.com Sun Aug 28 17:24:16 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Sun, 28 Aug 2011 20:54:16 +0530 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed Message-ID: Hello, I could really solve my problems, thanks to the response i get from this group. However once again I hit a dead end. I wrote few tests using Jython. In order to execute them in a bunch I wrote an allTests.py (an unittest suite). Now my original target was to generate nice html reports from the xml report which allTest.py generates. So here are my queries. 1. Is there a way I can get such nice reports? 2. I stumbled upon Hudson and found that to be a very useful tool. But problem is it won't run my allTests.py deep down in the tree. How do I make it run the tests? nose? ant? (with Hudson I can sync my scripts to dev environment). 3. everything works fine in my eclipse environment and I used easy_install to install most of the modules, is there a way I can create lib which external build system would recognize and won't give a module not recognized error? It would be really helpful for me to get these solved. ------------- Thanks and Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas From senthil at uthcode.com Sun Aug 28 18:06:35 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Mon, 29 Aug 2011 00:06:35 +0800 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: References: Message-ID: <20110828160635.GA2182@mathmagic> Hi Subhodip, On Sun, Aug 28, 2011 at 08:54:16PM +0530, Subhodip Biswas wrote: > Now my original target was to generate nice html reports from the xml > report which allTest.py generates. Hudson merely requires that your XML output be Junit output style that it can display. Look at the specifics, install hudson and point your output xml to it should be fine. If you want to something simpler, you can look at py.test and it's plugins. py.test has a way to generate junit style xml to be bed to hudson too. HTH, Senthil From subhodipbiswas at gmail.com Sun Aug 28 19:01:18 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Sun, 28 Aug 2011 22:31:18 +0530 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: <20110828160635.GA2182@mathmagic> References: <20110828160635.GA2182@mathmagic> Message-ID: On Sun, Aug 28, 2011 at 9:36 PM, Senthil Kumaran wrote: > Hi Subhodip, > > On Sun, Aug 28, 2011 at 08:54:16PM +0530, Subhodip Biswas wrote: >> Now my original target was to generate nice html reports from the xml >> report which allTest.py generates. > > Hudson merely requires that your XML output be Junit output style that > it can display. Look at the specifics, install hudson and point your > output xml to it should be fine. > > If you want to something simpler, you can look at py.test and it's > plugins. py.test has a way to generate junit style xml to be bed to > hudson too. I have most of the modules installed by easy install. How do I build the same from my central repo. Is there a way I can upload these modules and ask jython to look for it? Problem is hudson won't build from local, so it need to pass the central repo path. > > HTH, > Senthil > > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > ------------- Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas From senthil at uthcode.com Tue Aug 30 11:30:07 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Tue, 30 Aug 2011 17:30:07 +0800 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: References: <20110828160635.GA2182@mathmagic> Message-ID: <20110830093006.GA23421@mathmagic> On Sun, Aug 28, 2011 at 10:31:18PM +0530, Subhodip Biswas wrote: > > I have most of the modules installed by easy install. How do I build > the same from my central repo. Is there a way I can upload these > modules and ask jython to look for it? I am not getting this clearly. > > Problem is hudson won't build from local, so it need to pass the > central repo path. I think, you can configure this. You can configure how/what you want hudson to build. But in order the reports to be shown in Hudson, you don't need hudson to build it. You can just point your results to hudson for it to display. HTH, Senthil From subhodipbiswas at gmail.com Tue Aug 30 11:50:58 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Tue, 30 Aug 2011 15:20:58 +0530 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: <20110830093006.GA23421@mathmagic> References: <20110828160635.GA2182@mathmagic> <20110830093006.GA23421@mathmagic> Message-ID: Hi, On Tue, Aug 30, 2011 at 3:00 PM, Senthil Kumaran wrote: > On Sun, Aug 28, 2011 at 10:31:18PM +0530, Subhodip Biswas wrote: >> >> I have most of the modules installed by easy install. How do I build >> the same from my central repo. Is there a way I can upload these >> modules and ask jython to look for it? > What I did is : easy_install someModule. So now in my eclipse install I can see these modules and use them accordingly. If i am trying to build the same from a different machine. I need these to be configured right in a way that normal jython mymodule.py works. In java we generally attach the libs in the classpath and build using ant. What do i do in case of jython? write an ant file doing the same(pyanttasks) or is there another way to do so? >> >> Problem is hudson won't build from local, so it need to pass the >> central repo path. > > I think, you can configure this. You can configure how/what you want > hudson to build. > > But in order the reports to be shown in Hudson, you don't need hudson > to build it. You can just point your results to hudson for it to > display. > Can you point me to the some docs where i can look for the same? my google search does not provide me any good results. My current hudson successfully located the file but is unable to show me any reports based the junit type xml files. Thanks in advance for the help. ------------- Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas From senthil at uthcode.com Tue Aug 30 13:59:00 2011 From: senthil at uthcode.com (Senthil Kumaran) Date: Tue, 30 Aug 2011 19:59:00 +0800 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: References: <20110828160635.GA2182@mathmagic> <20110830093006.GA23421@mathmagic> Message-ID: <20110830115900.GB24929@mathmagic> On Tue, Aug 30, 2011 at 03:20:58PM +0530, Subhodip Biswas wrote: > What I did is : easy_install someModule. > So now in my eclipse install I can see these modules and use them accordingly. > If i am trying to build the same from a different machine. I need > these to be configured right in a way that normal jython mymodule.py > works. Well, if you can carry those modules along to new server that would resolve your dependencies. The other option is to create a virtualenv. I believe there is an option to create a virtualevn for jython interpreter too and in which case all your dependencies are installed within that environment. On anymachine that you want to execute, you have to create that setup. > In java we generally attach the libs in the classpath and build using > ant. What do i do in case of jython? write an ant file doing the > same(pyanttasks) or is there another way to do so? Yes, you can write an Ant task to build your project for Jython. Even this seems interesting: https://wiki.jenkins-ci.org/display/JENKINS/Jython+Plugin > Can you point me to the some docs where i can look for the same? my > google search does not provide me any good results. My current hudson > successfully located the file but is unable to show me any reports > based the junit type xml files. Look at how pytest is being tested. http://hudson.testrun.org/view/pytest/job/pytest/ They are running py.test and with xdist plugin. py.test has an option to generate junit.xml style output. Once that is generated, jenkins/hudson is pointed to the xml and it can generate the report automatically. I am not sure why you went with Jython in the first place, but if it was just for interfacing with Hudson, then the above pytest example should convey a message that jython is NOT a requirement for building software/running tests and generating reports. If you would like to start small, then I would suggest you to write py.test test, execute it and get the junit xml output and then point it to your jenkins/hudson and see the report. If this works, then you can go ahead try for your task. Thanks, Senthil From subhodipbiswas at gmail.com Tue Aug 30 14:36:35 2011 From: subhodipbiswas at gmail.com (Subhodip Biswas) Date: Tue, 30 Aug 2011 18:06:35 +0530 Subject: [BangPypers] [Python][Hudson][Tests] Problems - help needed In-Reply-To: <20110830115900.GB24929@mathmagic> References: <20110828160635.GA2182@mathmagic> <20110830093006.GA23421@mathmagic> <20110830115900.GB24929@mathmagic> Message-ID: Hi Senthil, Thanks for the information. On Tue, Aug 30, 2011 at 5:29 PM, Senthil Kumaran wrote: > On Tue, Aug 30, 2011 at 03:20:58PM +0530, Subhodip Biswas wrote: >> What I did is : easy_install someModule. >> So now in my eclipse install I can see these modules and use them accordingly. >> If i am trying to build the same from a different machine. I need >> these to be configured right in a way that normal jython mymodule.py >> works. > > Well, if you can carry those modules along to new server that would > resolve your dependencies. ?The other option is to create a > virtualenv. I believe there is an option to create a virtualevn for > jython interpreter too and in which case all your dependencies are > installed within that environment. > > On anymachine that you want to execute, you have to create that setup. > >> In java we generally attach the libs in the classpath and build using >> ant. What do i do in case of jython? write an ant file doing the >> same(pyanttasks) or is there another way to do so? > > Yes, you can write an Ant task to build your project for Jython. > Even this seems interesting: > https://wiki.jenkins-ci.org/display/JENKINS/Jython+Plugin > >> Can you point me to the some docs where i can look for the same? my >> google search does not provide me any good results. My current hudson >> successfully located the file but is unable to show me any reports >> based the junit type xml files. > > Look at how pytest is being tested. > > http://hudson.testrun.org/view/pytest/job/pytest/ > > They are running py.test and with xdist plugin. py.test has an option > to generate junit.xml style output. Once that is generated, > jenkins/hudson is pointed to the xml and it can generate the report > automatically. > > I am not sure why you went with Jython in the first place, but if it > was just for interfacing with Hudson, then the above pytest example > should convey a message that jython is NOT a requirement for > building software/running tests and generating reports. > If you would like to start small, then I would suggest you to write > py.test test, execute it and get the junit xml output and then point > it to your jenkins/hudson and see the report. If this works, then you > can go ahead try for your task. > My main app is in java. I wrote few code in java but somehow I felt python is better (lots of good libs). since there were few java dependencies I finally settled for jython(best of both worlds). Everything were good until it came to produce some trending reports. I thought of buildbot but system already has Hudson/Jenkins in place. So I have to integrate the whole system to hudson and this is where I got stuck. I will look into the information you gave and in case of any problem I will bug the list even more :-) Thanks again for the information. > Thanks, > Senthil > _______________________________________________ > BangPypers mailing list > BangPypers at python.org > http://mail.python.org/mailman/listinfo/bangpypers > ------------- Regards Subhodip Biswas GPG key : FAEA34AB Server : pgp.mit.edu http://subhodipbiswas.wordpress.com http:/www.fedoraproject.org/wiki/SubhodipBiswas