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
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
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.
>
>
___
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,
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]
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
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
&
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:/
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
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:
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
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
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
13 matches
Mail list logo