Re: How to modify this script?

2013-01-09 Thread chaouche yacine
item in items :     columns += addcolumn(item,len(items))     output  += addline(columns) output += "" return output> From: Kurt Hansen To: python-list@python.org Sent: Wednesday, January 9, 2013 12:04 PM Subject: Re: How to modify this script? D

Re: How to modify this script?

2013-01-09 Thread chaouche yacine
r has errors). I had to debug it using pdb.set_trace directly inside its source code to figure out what was wrong in the snippet. If this doesn't work for you, please let me know. From: Kurt Hansen To: python-list@python.org Sent: Wednesday, January 9

Re: How to modify this script?

2013-01-08 Thread chaouche yacine
onday, January 7, 2013 5:42 PM Subject: Re: How to modify this script? Den 06/01/13 16.12, chaouche yacine skrev: > I'm not confident this would run on gedit. It works on a python > interpreter if you have a file named data.txt in the same directory > containing your sample data. > >

Re: Over 30 types of variables available in python ?

2013-01-07 Thread chaouche yacine
___ From: Terry Reedy To: python-list@python.org Sent: Monday, January 7, 2013 1:45 AM Subject: Re: Over 30 types of variables available in python ? On 1/6/2013 6:12 PM, chaouche yacine wrote: > > booleans > ints, floats, longs, complexes > strings, unicode strings > lists,

Re: How to modify this script?

2013-01-06 Thread chaouche yacine
PM Subject: Re: How to modify this script? Den 06/01/13 15.01, chaouche yacine wrote: > Well, I'm not answering your question since I am rewriting the script, > because I prefer it this way :) > > def addline(line): >      return "%s\n" % line [cut]

Re: How to modify this script?

2013-01-06 Thread chaouche yacine
printed >>> Price table 1 Green apple $1 5 Green apples $4 10 Green apples $7 >>> From: Kurt Hansen To: python-list@python.org Sent: Sunday, January 6, 2013 2:38 PM Subject: Re: How to modify this script? Den 06/01/13

Re: Proof that nobody reads the tests

2013-01-06 Thread chaouche yacine
13 at 12:01 AM, chaouche yacine wrote: > Has anybody read the source code of > /usr/lib/python2.7/test/inspect_fodder.py ? > > I wonder how did they let this into the official python distribution. I > thought Guido was serious :) people of the PSF seem to have a certain sense &

Re: How to modify this script?

2013-01-06 Thread chaouche yacine
if len(columns) != 3:    colspan = 3 - len(columns) + 1    output += '' % (colspan) + item + ' ' I did not test. Use with caution. From: Kurt Hansen To: python-list@python.org Sent: Sunday, January 6, 2013 1:42 PM Subject: How to modify this script? http:/

Re: Python programming philosophy

2013-01-05 Thread chaouche yacine
The compiler reads your source code and parses it into parse trees. This is first step. It then takes the parse trees and transform them into abstract syntax trees, which are like a DOM tree in an HTML file, and then transform that AST into a control flow graph, and finally a bytecode is produce

Re: reduce expression to test sublist

2013-01-05 Thread chaouche yacine
Because reduce doesn't do what you want. You'd want "all". L1 = [1,2,3] L2 = ["A1","B2","C3",1,2,3] print all((x in L2 for x in L1)) # prints True L3 = ["A1","B2","C3"] print all((x in L2 for x in L3)) # prints True - Original Message - From: Asim To: python-list@python.org Cc: Sent:

Re: Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
ing or ending docstring     elif line.startswith('"""') or line.startswith("'''"):     docstring = not docstring     continue     else:     nb_lines += 1     return nb_lines ----- Original Message - From: Chr

Re: Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
ith("'''"):docstring =notdocstring continueelse:nb_lines +=1returnnb_lines - Original Message - From: Chris Angelico To: python-list@python.org Cc: Sent: Saturday, January 5, 2013 3:09 PM Subject: Re: Couting the number of lines of code of a python program On

Couting the number of lines of code of a python program

2013-01-05 Thread chaouche yacine
Hello. I'v written a small script that prints the number of lines of code of a python program to stdout (by module, function, class and method), the sources are available online here  https://www.assembla.com/code/tahar/subversion/nodes. The readme has an example usage as well as a trace of