x27; to see things broken down
> by CPU core (there are 32 of them, probably counting hyperthreads as
> different cores), but the CPU use is in the teens or so.
If you had many CPU-bound Python threads, then with 32 cores each core
might show as 3 % busy (the sum of the threads can't u
On 17/07/2019 09.58, Barry Scott wrote:
>
>> On 16 Jul 2019, at 20:48, Dan Stromberg wrote:
>>
>>
>>
>> A question arises though: Does threading.active_count() only show Python
>> threads created with the threading module? What about threads created with
>> the thread module?
> Only pythons t
cess using 100% CPU?
> Nope. CPU utilization and disk use are both low.
Then your problem is latency. You need to find the slow operation.
> We've been going into top, and then hitting '1' to see things broken down by
> CPU core (there are 32 of them, probably counting hype
CPU-bound Python threads causing the problem
> > (because of the threading+GIL thing).
>
> Does top show the process using 100% CPU?
>
Nope. CPU utilization and disk use are both low.
We've been going into top, and then hitting '1' to see things broken down
by CPU core (
I'm going to assume you are on linux.
On 16 Jul 2019, at 18:35, Dan Stromberg wrote:
>
> I'm looking at a performance problem in a large CPython 2.x/3.x codebase
> with quite a few dependencies.
>
> I'm not sure what's causing the slowness yet. The CPU isn't getting hit
> hard, and I/O on the
I'm looking at a performance problem in a large CPython 2.x/3.x codebase
with quite a few dependencies.
I'm not sure what's causing the slowness yet. The CPU isn't getting hit
hard, and I/O on the system appears to be low - but throughput is poor.
I'm wondering if it could be CPU-bound Python thr
On Fri, 20 Oct 2017 09:05:15 -0800, Israel Brewster wrote:
> On Oct 19, 2017, at 5:18 PM, Steve D'Aprano
> wrote:
>> What t1 and t2 are, I have no idea. Your code there suggests that they
>> are fields in your data records, but the contents of the fields, who
>> knows?
>
> t1 and t2 are *indepen
On 2017-10-20 18:05, Israel Brewster wrote:[snip]
In a sense, in that it supports my initial approach.
As Stefan Ram pointed out, there is nothing wrong with the solution I have: simply using
if statements around the calculated lateness of t1 and t2 to increment the appropriate
counters. I was
On Oct 19, 2017, at 5:18 PM, Steve D'Aprano wrote:
> What t1 and t2 are, I have no idea. Your code there suggests that they are
> fields in your data records, but the contents of the fields, who knows?
t1 and t2 are *independent* timestamp fields. My apologies - I made the
obviously false assump
On 2017-10-20 03:32, Chris Angelico wrote:
On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano
wrote:
On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote:
So if the date of
the first record was today, t1 was on-time, and t2 was 5 minutes late, then
I would need to increment ALL of the following (
On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano
wrote:
> On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote:
>> So if the date of
>> the first record was today, t1 was on-time, and t2 was 5 minutes late, then
>> I would need to increment ALL of the following (using your data structure
>> from ab
On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote:
> If it helps, my data would look something like this:
>
> [ (date, key, t1, t2),
> (date, key, t1, t2)
> .
> .
> ]
>
> Where the date and the key are what is used to determine what "on-time" is
> for the record, and thus which "late" bin to
On 19/10/17 20:04, Israel Brewster wrote:
>> then loop through the records, find the schedule for that record (if any, if
>> not move on as mentioned earlier), compare t1 and t2 against the schedule,
>> and increment the appropriate bin counts using a bunch of if statements.
>> Functional, if ug
Israel Brewster wrote:
>
>> On Oct 19, 2017, at 10:02 AM, Stefan Ram wrote:
>>
>> Israel Brewster writes:
>>> t10 = {'daily': 0, 'WTD': 0, 'MTD': 0, 'YTD': 0,}
>>> increment the appropriate bin counts using a bunch of if statements.
>>
>> I can't really completely comprehend your requirement
> On Oct 19, 2017, at 10:02 AM, Stefan Ram wrote:
>
> Israel Brewster writes:
>> t10 = {'daily': 0, 'WTD': 0, 'MTD': 0, 'YTD': 0,}
>> increment the appropriate bin counts using a bunch of if statements.
>
> I can't really completely comprehend your requirements
> specification, you might hav
> On Oct 19, 2017, at 9:40 AM, Israel Brewster wrote:
>
> I am working on developing a report that groups data into a two-dimensional
> array based on date and time. More specifically, date is grouped into
> categories:
>
> day, week-to-date, month-to-date, and year-to-date
>
> Then, for eac
I am working on developing a report that groups data into a two-dimensional
array based on date and time. More specifically, date is grouped into
categories:
day, week-to-date, month-to-date, and year-to-date
Then, for each of those categories, I need to get a count of records that fall
into t
l home work assignment, even though stop asking for programs and
> > start asking how to make the same.
> >
> > anyway if you ever try to write code for this you have to split you
> > sentence and use a dict for counting
> >
> > Python has Counter from coll
split you
sentence and use a dict for counting
Python has Counter from collections but it is a little bit slower when
compared to defaultdict for this kind of purpose.
Regards
Srinivas Devaki
Senior (final yr) student at Indian Institute of Technology (ISM), Dhanbad
Computer Science and Engineering Dep
On Sat, Oct 1, 2016 at 5:12 AM, Jake wrote:
> Could you make the program for me or provide an outline?
No. In case you didn't read any of the other responses, this community
is not a plagiarism source. If you want to learn to be a programmer,
you're going to have to learn some key skills, one of
On Fri, 30 Sep 2016 11:37:19 -0700 (PDT), Jake wrote:
> Hi, I need a program which:
> 1) Asks the user for a sentence of their choice (not including punctuation)
> 2) Ask the user which word they would like to know is repeated
> 3) Print out to the user how many times the word came up which they c
f you ever try to write code for this you have to split you
> sentence and use a dict for counting
>
> Python has Counter from collections but it is a little bit slower when
> compared to defaultdict for this kind of purpose.
>
> Regards
> Srinivas Devaki
> Senior (final y
Jake wrote:
> Hi, I need a program which:
> 1) Asks the user for a sentence of their choice (not including punctuation)
> 2) Ask the user which word they would like to know is repeated
> 3) Print out to the user how many times the word came up which they chose
> from their sentence.
>
> It would
up which they chose
from their sentence.
>
typical home work assignment, even though stop asking for programs and
start asking how to make the same.
anyway if you ever try to write code for this you have to split you
sentence and use a dict for counting
Python has Counter from collections but it
Hi, I need a program which:
1) Asks the user for a sentence of their choice (not including punctuation)
2) Ask the user which word they would like to know is repeated
3) Print out to the user how many times the word came up which they chose from
their sentence.
It would help if you could comment
On 04/12/15 23:06, Peter Otten wrote:
> duncan smith wrote:
>
>> Hello,
>> I'm trying to find a computationally efficient way of identifying
>> unique subarrays, counting them and returning an array containing only
>> the unique subarrays and a co
On 04/12/15 22:36, Albert-Jan Roskam wrote:
> Hi
>
> (Sorry for topposting)
>
> numpy.ravel is faster than numpy.flatten (no copy)
> numpy.empty is faster than numpy.zeros
> numpy.fromiter might be useful to avoid the loop (just a hunch)
>
> Albert-Jan
>
Thanks, I'd forgotten the difference be
duncan smith wrote:
> Hello,
> I'm trying to find a computationally efficient way of identifying
> unique subarrays, counting them and returning an array containing only
> the unique subarrays and a corresponding 1D array of counts. The
> following code work
Hi
(Sorry for topposting)
numpy.ravel is faster than numpy.flatten (no copy)
numpy.empty is faster than numpy.zeros
numpy.fromiter might be useful to avoid the loop (just a hunch)
Albert-Jan
> From: duncan@invalid.invalid
> Subject: counting unique numpy subarrays
> Date: Fri, 4 Dec 2
Hello,
I'm trying to find a computationally efficient way of identifying
unique subarrays, counting them and returning an array containing only
the unique subarrays and a corresponding 1D array of counts. The
following code works, but is a bit slow.
###
from collections i
On Thu, Jun 25, 2015 at 12:49 PM, Eric Edmond wrote:
> Hi,
>
> I have been writing a C++ extension for Python recently, and am currently
> fixing the reference counting throughout the extension. As I am very new to
> this topic, my question may have a simple answer, but I was unabl
Hi,
I have been writing a C++ extension for Python recently, and am currently
fixing the reference counting throughout the extension. As I am very new to
this topic, my question may have a simple answer, but I was unable to find any
mention of the behavior online.
When using the
During the final test of a bit of embedded python, I wanted to see if
I had any hanging references. To my suprise, I ended up with a rather
large amount, after running combinerefs.py. And even with the
simplest[1] possible use of embedding, I end up with 13475 still-living
references.
If this i
On Thursday, December 20, 2012 12:21:57 AM UTC+13, Thomas Bach wrote:
> Hi,
>
>
>
> just as a side-note
>
>
>
> On Wed, Dec 19, 2012 at 02:45:13AM -0800, :
>
> > for word in list:
>
> > if word in dict:
>
> > count = dict[word]
>
> >
On Thursday, December 20, 2012 12:03:21 AM UTC+13, Steven D'Aprano wrote:
> On Wed, 19 Dec 2012 02:45:13 -0800, dgcosgrave wrote:
>
>
>
> > Hi Iam just starting out with python...My code below changes the txt
>
> > file into a list and add them to an empty dictionary and print how often
>
> >
On Wednesday, December 19, 2012 11:55:28 PM UTC+13, Jussi Piitulainen wrote:
>
>
>
>
> > Hi Iam just starting out with python...My code below changes the txt
>
> > file into a list and add them to an empty dictionary and print how
>
> > often the word occurs, but it only seems to recognise an
Hi,
just as a side-note
On Wed, Dec 19, 2012 at 02:45:13AM -0800, dgcosgr...@gmail.com wrote:
> for word in list:
> if word in dict:
> count = dict[word]
> count += 1
> dict[word] = count
> else:
> dict[wor
On Wed, 19 Dec 2012 02:45:13 -0800, dgcosgrave wrote:
> Hi Iam just starting out with python...My code below changes the txt
> file into a list and add them to an empty dictionary and print how often
> the word occurs, but it only seems to recognise and print the last entry
> of the txt file. Any
dgcosgr...@gmail.com writes:
> Hi Iam just starting out with python...My code below changes the txt
> file into a list and add them to an empty dictionary and print how
> often the word occurs, but it only seems to recognise and print the
> last entry of the txt file. Any help would be great.
>
>
Hi Iam just starting out with python...My code below changes the txt file into
a list and add them to an empty dictionary and print how often the word occurs,
but it only seems to recognise and print the last entry of the txt file. Any
help would be great.
tm =open('ask.txt', 'r')
dict = {}
for
lipska the kat, 29.07.2012 18:01:
> My most recent experience is with Java. The last project I was involved
> with included 6775 java source files containing 1,145,785 lines of code.
> How do I know this? because I managed to cobble together a python script
> that walks the source tree and counts t
The keys of globals() are the _names_. You're giving it the function
itself.
Ow, ok. I didn't caught it. I understand now.
> A decorator would be better.
Yes. I keep the solution with
foo=Wraper(foo)
Thanks a lot all !
Laurent
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Sep 29, 2011 at 10:08 AM, Laurent Claessens wrote:
> Hello
>
>
> Is it possible to count the number of time a function is called ?
> Of course, if I've access to the source code, it's easy.
>
> I tried the following :
>
> def foo():
> print "foo !"
>
>
> class wraper(object):
> d
On 29/09/2011 18:08, Laurent Claessens wrote:
Hello
Is it possible to count the number of time a function is called ?
Of course, if I've access to the source code, it's easy.
I tried the following :
def foo():
print "foo !"
class wraper(object):
def __init__(self,fun):
globals()[fun]=self.r
On Fri, Sep 30, 2011 at 3:08 AM, Laurent Claessens wrote:
> class wraper(object):
> def __init__(self,fun):
> globals()[fun]=self.replacement
> def replacement(*args):
> print "I'm replaced"
>
> foo()
> X=wraper(foo)
> foo()
>
> I was hoping that globals()[foo] would be replace
On Fri, Sep 30, 2011 at 3:08 AM, Laurent Claessens wrote:
> def foo():
> print "foo !"
>
>
> class wraper(object):
> def __init__(self,fun):
> globals()[fun]=self.replacement
> def replacement(*args):
> print "I'm replaced"
>
> foo()
> X=wraper(foo)
> foo()
Are you able to
Hello
Is it possible to count the number of time a function is called ?
Of course, if I've access to the source code, it's easy.
I tried the following :
def foo():
print "foo !"
class wraper(object):
def __init__(self,fun):
globals()[fun]=self.replacement
def replac
On Sep 26, 2011 1:49 AM, wrote:
> Is there an equivalent command in python that would immediately provide
the number of set bits in a large bit vector/string
Besides what others have said, if you expect the number of bits set to be
small, you might just use a set.
bits = set()
# set bit 1000
bit
On Sep 26, 12:56 am, Nizamov Shawkat
wrote:
> > Is there an equivalent command in python that would immediately provide the
> > number of set bits in a large bit vector/string
>
> You might be able to achieve this using numpy boolean array and, e.g,
> the arithmetic sum function or something simil
b = numpy.zeros(10**7, dtype=bool)
for x in 3, 4, 6: b[10**x] = True
> ...
b.sum()
> 3
Without numpy:
>>> counts = [bin(i).count('1') for i in range(256)]
>>> bytes = b"hello python"*10
>>> len(bytes)*8
960
>>> sum(map(counts.__getitem__, bytes))
480
Pretty fast as wel
bmacin...@comcast.net wrote:
> In Perl I can create a large bit vector as follows:
> vec($bitmap,1000,1) = 0;# this will create a bit string of all
> zeros
> To set bits I may using commands like:
> vec($bitmap,1000, 1) = 1 # turn on bit 1000
> vec($bitmap,1, 1) =
> Is there an equivalent command in python that would immediately provide the
> number of set bits in a large bit vector/string
>
You might be able to achieve this using numpy boolean array and, e.g,
the arithmetic sum function or something similar.
There is also another library http://pypi.pytho
In Perl I can create a large bit vector as follows:
vec($bitmap,1000,1) = 0;# this will create a bit string of all zeros
To set bits I may using commands like:
vec($bitmap,1000, 1) = 1 # turn on bit 1000
vec($bitmap,1, 1) = 1# turn on bit 1
, so both of
their refcounts will have been incremented to 2. You will need to
DECREF the objects at python__x and python__y before the C variables
python__x and python__y go out of scope.
But for single returns I do something like this
I realize that the 2 lines below are pointless,
O", python__x, python__y);
But for single returns I do something like this
I realize that the 2 lines below are pointless, but are they causing a
memory leak or problems with reference counting?
python__x = Py_BuildValue("s", x)
python__return_val = Py_BuildValue("
Op vrijdag 22 januari 2010 schreef Arnaud:
> Why not just start with (untested):
>
> import codecs
> from collections import defaultdict
>
> tcounters = defaultdict(int)
> f = codecs.open('/home/gavron/git/screen/src/screen.c', 'r', "utf-8")
>
> for c in f.read():
> tcounters[c] += 1
>
> f
On Jan 22, 10:30 pm, Steve Holden wrote:
> >> Oh, sorry, did I have the wrong opinion?
>
> > You had a condescending attitude.
>
> Towards someone who is fairly obviously not a Python neophyte.
>
> Please don't think we are telling you you can't have any opinion you
> like. Just don't expect to ge
On Jan 22, 7:51 pm, Phlip wrote:
> On Jan 21, 9:00 pm, Michele Simionato
> wrote:
>
> > Just for fun I have run cloc on our trunk:
>
> > SUM: 8743 272238 215871 1470139 x 1.84 =
> > 2708354.95
>
> Nice!
>
> My favorite version of a cloc system can distinguish test from
>
Op donderdag 21 januari 2010 schreef Michele:
> I need a small utility to count the lines of Python code in a
> directory, traversing subdirectories and ignoring comments and
> docstrings.
sloccount can do this.
http://www.dwheeler.com/sloccount/
Met vriendelijke groet,
Wilbert Berendsen
--
h
Robert Kern wrote:
> On 2010-01-21 15:31 , Phlip wrote:
>> Aahz wrote:
>>> In article
>>> <7e09df6a-cda1-480e-a971-8f8a70ac4...@b9g2000yqd.googlegroups.com>,
>>> Phlip wrote:
On Jan 20, 11:20=A0pm, Michele Simionato
wrote:
> pylint does too many things, I want something fast that ju
On Jan 21, 9:00 pm, Michele Simionato
wrote:
> Just for fun I have run cloc on our trunk:
>
> SUM: 8743 272238 215871 1470139 x 1.84 =
> 2708354.95
Nice!
My favorite version of a cloc system can distinguish test from
production code. That's why I always use executable c
On Jan 21, 9:24 pm, Phlip wrote:
> On Jan 20, 11:20 pm, Michele Simionato
> wrote:
>
> > pylint does too many things, I want something fast that just counts
> > the lines and can be run on thousands of files at once.
> > cloc seems fine, I have just tried on 2,000 files and it gives me a
> > repo
On 2010-01-21 15:31 , Phlip wrote:
Aahz wrote:
In article
<7e09df6a-cda1-480e-a971-8f8a70ac4...@b9g2000yqd.googlegroups.com>,
Phlip wrote:
On Jan 20, 11:20=A0pm, Michele Simionato
wrote:
pylint does too many things, I want something fast that just counts
the lines and can be run on thousands
Aahz wrote:
In article <7e09df6a-cda1-480e-a971-8f8a70ac4...@b9g2000yqd.googlegroups.com>,
Phlip wrote:
On Jan 20, 11:20=A0pm, Michele Simionato
wrote:
pylint does too many things, I want something fast that just counts
the lines and can be run on thousands of files at once.
cloc seems fine,
In article <7e09df6a-cda1-480e-a971-8f8a70ac4...@b9g2000yqd.googlegroups.com>,
Phlip wrote:
>On Jan 20, 11:20=A0pm, Michele Simionato
>wrote:
>>
>> pylint does too many things, I want something fast that just counts
>> the lines and can be run on thousands of files at once.
>> cloc seems fine, I
On Jan 20, 11:20 pm, Michele Simionato
wrote:
> pylint does too many things, I want something fast that just counts
> the lines and can be run on thousands of files at once.
> cloc seems fine, I have just tried on 2,000 files and it gives me a
> report in just a few seconds.
In my experience wit
On Jan 21, 8:12 am, Ben Finney wrote:
> Michele Simionato writes:
> > I need a small utility to count the lines of Python code in a
> > directory, traversing subdirectories and ignoring comments and
> > docstrings. I am sure there is already something doing that, what do
> > you suggest?
>
> Any
I did not known about cloc, it does more that I need, but it looks
cool (it is perl and not Python, by who cares? ;)
Thanks,
Michele
--
http://mail.python.org/mailman/listinfo/python-list
Michele Simionato writes:
> I need a small utility to count the lines of Python code in a
> directory, traversing subdirectories and ignoring comments and
> docstrings. I am sure there is already something doing that, what do
> you suggest?
Any of the static code checkers (‘pylint’, ‘pyflakes’,
On 21/01/2010 5:51 PM, Michele Simionato wrote:
I need a small utility to count the lines of Python code in a
directory, traversing subdirectories and ignoring comments and
docstrings. I am sure there is already something doing that, what do
you suggest?
I suggest typing your subject line into
I need a small utility to count the lines of Python code in a
directory, traversing subdirectories and ignoring comments and
docstrings. I am sure there is already something doing that, what do
you suggest?
TIA,
Michele Simionato
--
http://mail.python.org/mailman/listinfo
Kottiyath wrote:
So, in a higher level class, have a weakref list which contains a
reference to each person. Total count will be len(list) at any time.
Now, I couldnt find a weakref list - so I am using WeakKeyDictionary
with the value as None - since len(dict) also should give me the data
I ty
Thank you everyone for your very helpful comments and suggestions. I
have interacted in other newsgroups, but this is the most helpful of
them all.
As per the comments, I have now decided to go with the weakref
mechanism - as per Andreas suggestion, functionally it looks correct
that the person sh
Mark Wooding wrote:
> Andreas Waldenburger writes:
>
>> On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
>> wrote:
>>
>>> class a(object):
>>> counter = 0
>>> def __new__(cls, *args, **kwargs):
>>> a.counter += 1
>>> return object.__new__(cls, *args, **kwargs)
>
> Hmm.
On Mon, 26 Jan 2009 02:37:37 + Mark Wooding
wrote:
> > This looks OK, although I'd suggest using "cls.counter += 1" instead
> > of "a.counter += 1" in the __new__() method. Just seems clearer to
> > me, esp. when you think about subclassing.
>
> I'm not sure about clarity, but that would be
Andreas Waldenburger writes:
> On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
> wrote:
>
>> class a(object):
>> counter = 0
>> def __new__(cls, *args, **kwargs):
>> a.counter += 1
>> return object.__new__(cls, *args, **kwargs)
Hmm. Exceptions raised during object cr
En Sun, 25 Jan 2009 16:06:47 -0200, Andreas Waldenburger
escribió:
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
En Sun, 25 Jan 2009 16:06:47 -0200, Andreas Waldenburger
escribió:
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
er way to go would be to use the weakref module and create a
weakref-set (or list) as the counter. That way you would
only need to add the objects in the __new__() method and not worry
about removing them. I will admit that this is overengineering the
problem a bit, but might be a good exercise.
A
done Ok?
>
Yes. Just be aware that if instances become involved in cyclic data
structures (or in implementations other than CPython, where reference
counting isn't used) __del__ might not be called until garbage
collection kicks in, so you may want a more explicit way to stop an
instance
Hi,
I am creating a class called people - subclasses men, women, children
etc.
I want to count the number of people at any time.
So, I created code like the following:
class a(object):
counter = 0
def __new__(cls, *args, **kwargs):
a.counter += 1
return object.__new__(cls,
Mensanator wrote:
On Oct 14, 12:14 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
Mensanator wrote:
On Oct 13, 5:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
Mensanator wrote:
On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
Hi,
I just stumbled upon the following issue (I am running Debian):
$ py
On Oct 14, 12:14 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
> Mensanator wrote:
> > On Oct 13, 5:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
> >> Mensanator wrote:
> >>> On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
> Hi,
> I just stumbled upon the following issue (I am running Debian)
Mensanator wrote:
On Oct 13, 5:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
Mensanator wrote:
On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
Hi,
I just stumbled upon the following issue (I am running Debian):
$ python
Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
[GCC 4.3.2] on linux2
Type
On Oct 13, 5:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
> Mensanator wrote:
> > On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> I just stumbled upon the following issue (I am running Debian):
>
> >> $ python
> >> Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
> >> [GCC 4.3.2] on
On Oct 13, 12:43 pm, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just stumbled upon the following issue (I am running Debian):
>
> $ python
> Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> [2,
> None].
Mensanator wrote:
On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
Hi,
I just stumbled upon the following issue (I am running Debian):
$ python
Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> [2,
No
On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just stumbled upon the following issue (I am running Debian):
>
> $ python
> Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> [2,
> None].c
Hi,
I just stumbled upon the following issue (I am running Debian):
$ python
Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> [2, None].count(None)
1
>>> from gmpy import mpz
>>> [mpz(2), None].count
Ouray Viney wrote:
Hi All:
I am looking at writing a python script that will let me parse a
TestSuite xml file that contains n number of TestCases.
My goal is to be able to count the elements base on a key
value pair in the xml node.
Example
I would like to be able to count the number of T
On Aug 30, 2:17 pm, Paul Boddie <[EMAIL PROTECTED]> wrote:
> On 30 Aug, 19:37, Ouray Viney <[EMAIL PROTECTED]> wrote:
>
>
>
> >
>
> > I would like to be able to count the number of TestCases that contain
> > the "execute=true" but not the ones that contain "execute=false".
>
> With XPath-capable l
On 30 Aug, 19:37, Ouray Viney <[EMAIL PROTECTED]> wrote:
>
>
>
> I would like to be able to count the number of TestCases that contain
> the "execute=true" but not the ones that contain "execute=false".
With XPath-capable libraries, it should be enough to execute an XPath
query on the document. F
Ouray Viney wrote:
I am looking at writing a python script that will let me parse a
TestSuite xml file that contains n number of TestCases.
My goal is to be able to count the elements base on a key
value pair in the xml node.
Example
I would like to be able to count the number of TestCases
On Sat, Aug 30, 2008 at 7:37 PM, Ouray Viney <[EMAIL PROTECTED]> wrote:
> Hi All:
>
> I am looking at writing a python script that will let me parse a
> TestSuite xml file that contains n number of TestCases.
>
> My goal is to be able to count the elements base on a key
> value pair in the xml nod
Hi All:
I am looking at writing a python script that will let me parse a
TestSuite xml file that contains n number of TestCases.
My goal is to be able to count the elements base on a key
value pair in the xml node.
Example
I would like to be able to count the number of TestCases that contain
In article <[EMAIL PROTECTED]>,
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>En Fri, 29 Aug 2008 14:41:53 -0300, Ron Brennan <[EMAIL PROTECTED]>
>escribi�:
>
>> I am trying to find the amount of values there are pertaining to one key.
>>
>> For example:
>>
>> - To find the average of the value
En Fri, 29 Aug 2008 14:41:53 -0300, Ron Brennan <[EMAIL PROTECTED]>
escribi�:
I am trying to find the amount of values there are pertaining to one key.
For example:
- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram
What is a "mul
hello,
I am trying to find the amount of values there are pertaining to one key.
For example:
- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram
Also, how do reference a specific value for a key in a multipart?
Thanks,
Ron
--
FYI,
Jon Bowlas wrote:
> Hrmm, any ideas why I'd be getting 'SyntaxError: invalid syntax' for
> both of these?
>
>> sum(u'Level 2 Courses' in dct for dct in yourlist)
>> q = set(['1']); print q, sum(d.get('level') in q for d in thelist)
>
> The error occurs at the 'for'
> I'm afraid I can't use Pete
Jon Bowlas wrote:
I'm afraid I can't use Peters suggestion as I'm using python 2.3 and
it doesn't have the collection module. Thanks anyway.
Python 2.3 is the reason. It doesn't support the generator expression
syntax. Try sum([u'Level 2 Courses' in dct for dct in yourlist]) or
len([1 for dct
1 - 100 of 327 matches
Mail list logo