Hi folks,
i'm new to python i understood the logging mechanism but unable to
understand how these are applied in real time examples can any body help me out
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 17, 2014 at 5:35 PM, Nikolaus Rath wrote:
> Hello,
>
> I have a problem with using select. I can reliably reproduce a situation ...
Can you reproduce it with a reasonably short amount of code? If so,
please post it.
> I'm running Python 3.3.3 under Linux 3.12.
Do you mean Linux kern
On Mon, Feb 17, 2014 at 5:21 PM, Steven D'Aprano
wrote:
> So before you ask: for-loops aren't things (values). Neither are while-
> loops, try...except blocks, pass statements, del statements, etc. Nor are
> names and other references -- I believe that there is a practice in
> certain areas of com
Hello,
I have a problem with using select. I can reliably reproduce a situation
where select.select((sock.fileno(),), (), (), 0) returns ((),(),())
(i.e., no data ready for reading), but an immediately following
sock.recv() returns data without blocking.
I am pretty sure that this is not a race c
On Sun, 16 Feb 2014 18:43:15 -0500, Roy Smith wrote:
> In article ,
> Ben Finney wrote:
>
>> Gregory Ewing writes:
>>
>> > Chris Angelico wrote:
>> > > Because everything in Python is an object, and objects always are
>> > > handled by their references.
>> >
>> > So, we have objects... and w
On Mon, 17 Feb 2014 11:54:45 +1300, Gregory Ewing wrote:
> Chris Angelico wrote:
>> Because everything in Python is an object, and objects always are
>> handled by their references.
>
> So, we have objects... and we have references to
> objects... but everything is an object... so does that mean
Hi all,
I have two version of python 2.4 and 2.7.
By default python version is 2.4 . I want to install need to install some
rpm
which needs python 2.7 interpreter. how can I enable 2.7 interpreter for
only those
packages which are requiring python 2.7, I don't want to change my default
python ver
On Mon, 17 Feb 2014 11:40:57 +1300, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>> And indeed numpy arrays do share state. Why? No idea. Somebody thought
>> that it was a good idea. (Not me though...)
>
> Probably because they're often large and people don't want to incur the
> overhead of copy
On Sun, 16 Feb 2014 20:01:46 +0200, Marko Rauhamaa wrote:
> As far as "x is None" is concerned, a key piece of information is
> presented on http://docs.python.org/3.2/library/constants.html>:
>
> None
> The sole value of the type NoneType.
Sole, adj. "being the only one; si
On Monday, February 17, 2014 8:58:23 AM UTC+5:30, Roy Smith wrote:
> Chris Angelico wrote:
> > > The correct statement is "all values are objects", or "all data is
> > > objects".
> > > When people mistakenly say "everything is an object", they are implicitly
> > > only thinking about data.
> >
Roy Smith writes:
> Chris Angelico wrote:
> > Part of the trouble is that some code is (represented by) objects. A
> > function is an object, ergo it's data; a module is an object (though
> > that's different); a class is an object; but no other block of code
> > is.
>
> Lambda?
The ‘lambda’ s
In article ,
Chris Angelico wrote:
> On Mon, Feb 17, 2014 at 12:43 PM, Ned Batchelder
> wrote:
> > The correct statement is "all values are objects", or "all data is
> > objects".
> > When people mistakenly say "everything is an object", they are implicitly
> > only thinking about data.
> >
>
On Saturday, February 8, 1997 12:00:00 AM UTC-8, Guido van Rossum wrote:
> > I installed modified versions of stringobject.c and stropmodule.c on our web
> > server. They are accessible via
> >
> > http://www.automatrix.com/~skip/python/
>
> Cool. I read your description and am very pleased
On Mon, Feb 17, 2014 at 12:46 PM, Ben Finney wrote:
> Rustom Mody writes:
>
>> On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote:
>> > Moi?
>>
>> See thats the problem with re's -- just 3 letters and completely
>> incomprehensible!
>
> Actually, that's a regexp pattern that matche
On Mon, Feb 17, 2014 at 12:43 PM, Ned Batchelder wrote:
> The correct statement is "all values are objects", or "all data is objects".
> When people mistakenly say "everything is an object", they are implicitly
> only thinking about data.
>
> That said, "all data is objects" is really mostly usefu
Rustom Mody writes:
> On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote:
> > Moi?
>
> See thats the problem with re's -- just 3 letters and completely
> incomprehensible!
Actually, that's a regexp pattern that matches two *or* three letters.
--
\ “If nature has made an
On 2/16/14 5:54 PM, Gregory Ewing wrote:
Chris Angelico wrote:
Because everything in Python is an object, and objects always are
handled by their references.
So, we have objects... and we have
references to objects... but everything is an object...
so does that mean references are objects too
On Sunday, February 16, 2014 9:44:00 PM UTC+5:30, Roy Smith wrote:
> Moi?
See thats the problem with re's -- just 3 letters and completely
incomprehensible!
It even resembles our resident unicode-troll
Oui?
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 17, 2014 at 10:46 AM, Roy Smith wrote:
>> References aren't themselves objects. Names, attributes, etc, etc,
>> etc, all refer to objects. Is it clearer to use the verb "refer"
>> rather than the noun "reference"?
>>
>> ChrisA
>
> I know functions are objects, but what about statements
Roy Smith writes:
> In article ,
> Ben Finney wrote:
>
> > Gregory Ewing writes:
> > > So, we have objects... and we have references
> > > to objects... but everything is an object... so does that mean
> > > references are objects too?
> >
> > My response: No, because references are not thi
In article ,
Chris Angelico wrote:
> On Mon, Feb 17, 2014 at 9:54 AM, Gregory Ewing
> wrote:
> > Chris Angelico wrote:
> >>
> >> Because everything in Python is an object, and objects always are
> >> handled by their references.
> >
> >
> > So, we have objects... and we have
> > references to
In article ,
Ben Finney wrote:
> Gregory Ewing writes:
>
> > Chris Angelico wrote:
> > > Because everything in Python is an object, and objects always are
> > > handled by their references.
> >
> > So, we have objects... and we have
> > references to objects... but everything is an object...
Gregory Ewing writes:
> Chris Angelico wrote:
> > Because everything in Python is an object, and objects always are
> > handled by their references.
>
> So, we have objects... and we have
> references to objects... but everything is an object...
> so does that mean references are objects too?
>
On Mon, Feb 17, 2014 at 9:54 AM, Gregory Ewing
wrote:
> Chris Angelico wrote:
>>
>> Because everything in Python is an object, and objects always are
>> handled by their references.
>
>
> So, we have objects... and we have
> references to objects... but everything is an object...
> so does that m
Chris Angelico wrote:
Because everything in Python is an object, and objects always are
handled by their references.
So, we have objects... and we have
references to objects... but everything is an object...
so does that mean references are objects too?
This is the kind of trouble you get in
Steven D'Aprano wrote:
And indeed numpy arrays do share state. Why? No idea. Somebody thought
that it was a good idea. (Not me though...)
Probably because they're often large and people don't
want to incur the overhead of copying them any more
than necessary. So slices are defined to return vie
On 02/16/2014 05:29 PM, Emile van Sebille wrote:
You
On 2/16/2014 6:00 AM, F.R. wrote:
Hi all,
Struggling to parse bank statements unavailable in sensible
data-transfer formats, I use pdftotext, which solves part of the
problem. The other day I encountered a strange thing, when one single
figur
On 2014-02-16 14:47, Terry Reedy wrote:
> > 2) the data has to be sorted for bisect to work
>
> cumulative sums are automatically sorted.
Ah, that they were *cumulative* was the key that I missed in my
understanding. It makes sense now and works like a charm.
Thanks to all who offered a hand
On 2/16/2014 9:22 AM, Tim Chase wrote:
On 2014-02-16 04:12, Terry Reedy wrote:
On 2/15/2014 11:41 PM, Tim Chase wrote:
data = (
("apple", 20),
("orange", 50),
("grape", 30),
)
If you actually start with date in this form, write the few lines
needed to produce the
On Sat, 15 Feb 2014 10:44:39 +0100, Christian Gollwitzer wrote:
> Am 15.02.14 01:57, schrieb Chris Angelico:
>> Can you give an example of an ambiguous case? Fundamentally, the 'is'
>> operator tells you whether its two operands are exactly the same
>> object, nothing more and nothing less, so I a
On Sun, 16 Feb 2014 10:33:39 -0500, Roy Smith wrote:
> In article ,
> "F.R." wrote:
>
>> Hi all,
>>
>> Struggling to parse bank statements unavailable in sensible
>> data-transfer formats, I use pdftotext, which solves part of the
>> problem. The other day I encountered a strange thing, when o
On 16/02/2014 18:01, Marko Rauhamaa wrote:
Rustom Mody :
But for that Ive to use is
And as a teacher Ive to explain is
Might as well use C and get on with pointers
To me 'is' is a can of worms
I'm not against "is," but it must be carefully defined and taught.
As far as "x is None" is concer
Rustom Mody :
> But for that Ive to use is
> And as a teacher Ive to explain is
> Might as well use C and get on with pointers
>
> To me 'is' is a can of worms
I'm not against "is," but it must be carefully defined and taught.
As far as "x is None" is concerned, a key piece of information is
pre
On 16/02/14 16:35, Charles Allen wrote:
How efficient does this thing need to be?
You can always just turn it into a two-dimensional sampling problem by
thinking of the data as a function f(x=item), generating a random x=xr
in [0,x], then generating a random y in [0,max(f(x))]. The xr is
accept
On Sunday, February 16, 2014 9:59:53 PM UTC+5:30, Ned Batchelder wrote:
> On 2/16/14 9:00 AM, Rustom Mody wrote:
> > On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote:
> >> Mark Lawrence:
> >>> I have no interest in understanding object identity, I can write code
> >>> quite
How efficient does this thing need to be?
You can always just turn it into a two-dimensional sampling problem by
thinking of the data as a function f(x=item), generating a random x=xr
in [0,x], then generating a random y in [0,max(f(x))]. The xr is
accepted if 0 < y <= max(f(xr)), or rejected (an
On 2/16/14 9:00 AM, Rustom Mody wrote:
On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote:
Mark Lawrence:
I have no interest in understanding object identity, I can write code
quite happily without it.
Luckily, what we are now debating is mostly terminology and points
You
On 2/16/2014 6:00 AM, F.R. wrote:
Hi all,
Struggling to parse bank statements unavailable in sensible
data-transfer formats, I use pdftotext, which solves part of the
problem. The other day I encountered a strange thing, when one single
figure out of many erroneously converted into letters.
Steven D'Aprano :
> On Sun, 16 Feb 2014 12:52:58 +0200, Marko Rauhamaa wrote:
>> The syntactic awkwardness, then, explains why numbers don't have an
>> evolved set of methods (unlike strings).
>
> But numbers do have an evolved set of methods.
> [...]
> py> from decimal import Decimal
> py> [name
In article ,
Rustom Mody wrote:
> On Sunday, February 16, 2014 8:53:47 PM UTC+5:30, Roy Smith wrote:
> > We get a lot of newbie questions on this list. People are eager to jump
> > in and answer them (which is wonderful), but sometimes we get off on
> > tangents about trivia and lose sight of
Tim Chase wrote:
> On 2014-02-16 04:12, Terry Reedy wrote:
>> On 2/15/2014 11:41 PM, Tim Chase wrote:
>> >data = (
>> > ("apple", 20),
>> > ("orange", 50),
>> > ("grape", 30),
>> > )
>
> To Ben, yes, this was just some sample data; the original gets built
> from an externa
On 16/02/14 05:08, Ben Finney wrote:
Tim Chase writes:
I'm not coming up with the right keywords to find what I'm hunting.
I'd like to randomly sample a modestly compact list with weighted
distributions, so I might have
data = (
("apple", 20),
("orange", 50),
("grape", 30),
On Sunday, February 16, 2014 8:53:47 PM UTC+5:30, Roy Smith wrote:
> We get a lot of newbie questions on this list. People are eager to jump
> in and answer them (which is wonderful), but sometimes we get off on
> tangents about trivia and lose sight of the real question, and our
> audience.
>
On 16/02/2014 15:20, MRAB wrote:
On 2014-02-16 15:06, Mark Lawrence wrote:
On 16/02/2014 14:25, Roy Smith wrote:
We tend not to upgrade stuff unless there's a good reason to. You never
know what will break (looking furtively in the direction of the Python
3.x mafiosi).
Yeah, those really u
In article ,
"F.R." wrote:
> Hi all,
>
> Struggling to parse bank statements unavailable in sensible
> data-transfer formats, I use pdftotext, which solves part of the
> problem. The other day I encountered a strange thing, when one single
> figure out of many erroneously converted into lett
We get a lot of newbie questions on this list. People are eager to jump
in and answer them (which is wonderful), but sometimes we get off on
tangents about trivia and lose sight of the real question, and our
audience.
The particular one that set me off just now (I'm leaving off the names
beca
On 2014-02-16 15:06, Mark Lawrence wrote:
On 16/02/2014 14:25, Roy Smith wrote:
We tend not to upgrade stuff unless there's a good reason to. You never
know what will break (looking furtively in the direction of the Python
3.x mafiosi).
Yeah, those really unpleasant, nasty, horrible mafiosi
Python*can* do functional programming, but, for learning, Haskell will work
better.
Sam wrote:
>I would like to learn and try out functional programming (FP). I love
>Python and would like to use it to try FP. Some have advised me to use
>Haskell instead because Python is not a good language for
On 16/02/2014 14:25, Roy Smith wrote:
We tend not to upgrade stuff unless there's a good reason to. You never
know what will break (looking furtively in the direction of the Python
3.x mafiosi).
Yeah, those really unpleasant, nasty, horrible mafiosi who have the
audacity to point out that p
It's solved now, oh my god I was so stupid! I created a package named "pybrain"
for testing PyBrain module, so obviously when I tryed to import something from
PyBrain library, Python would import all modules from this personal package I
created. The problem was not being reproduced outside Eclip
On 2/16/14 9:22 AM, Tim Chase wrote:
3) you meant to write "(10, 'apple')" rather than 0. With my original
example code, a 0-probability shouldn't ever show up in the sampling,
where it looks like it might when using this sample code. In my
particular use case, I can limit/ensure that 0-probabil
In article ,
Chris Angelico wrote:
> On Sun, Feb 16, 2014 at 11:18 PM, Chris âKwpolskaâ Warrick
> wrote:
> > On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith wrote:
> >> Maybe this is something which has changed in newer versions of pip?
> >> I've got 1.1 (and python 2.7.3). I'm pretty sure bo
On 2014-02-16 04:12, Terry Reedy wrote:
> On 2/15/2014 11:41 PM, Tim Chase wrote:
> >data = (
> > ("apple", 20),
> > ("orange", 50),
> > ("grape", 30),
> > )
To Ben, yes, this was just some sample data; the original gets built
from an external (i.e., client-supplied, thus t
On Saturday, February 15, 2014 7:14:39 PM UTC+5:30, Marko Rauhamaa wrote:
> Mark Lawrence:
> > I have no interest in understanding object identity, I can write code
> > quite happily without it.
> Luckily, what we are now debating is mostly terminology and points of
> view where the outcomes are
Hi all,
Struggling to parse bank statements unavailable in sensible
data-transfer formats, I use pdftotext, which solves part of the
problem. The other day I encountered a strange thing, when one single
figure out of many erroneously converted into letters. Adobe Reader
displays the figure 50
On Sunday, February 16, 2014 10:15:58 AM UTC+5:30, Sam wrote:
> I would like to learn and try out functional programming (FP). I love Python
> and would like to use it to try FP. Some have advised me to use Haskell
> instead because Python is not a good language for FP. I am sort of confused
> a
On Mon, Feb 17, 2014 at 12:20 AM, Mark Lawrence wrote:
> On 16/02/2014 08:00, Pat Johnson wrote:
>>
>> This made me grin. ;)
>>
>
> What did, using google groups? :)
"Well! I've often seen context without a grin," thought Alice; "but a grin
without context! It's the most curious thing I ever saw
On Sun, Feb 16, 2014 at 11:59 PM, Rita wrote:
> when I do profiling is it possible to find out if I am spending a lot of
> time in type conversion?
> it seems I am not.
I would guess that you don't. But in Python, type conversion is like
any other function call:
value = int("12345")
So you can
On Sun, Feb 16, 2014 at 11:18 PM, Chris “Kwpolska” Warrick
wrote:
> On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith wrote:
>> Maybe this is something which has changed in newer versions of pip?
>> I've got 1.1 (and python 2.7.3). I'm pretty sure both of these are what
>> came with Ubuntu Precise.
>
On 16/02/2014 08:00, Pat Johnson wrote:
This made me grin. ;)
What did, using google groups? :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
This email is free from viruses and malware because avast! Antivirus
Em sexta-feira, 14 de fevereiro de 2014 01h30min05s UTC-2, Renato escreveu:
> Hi guys, I'm using Python 2.7.5 64 bits and I have a problem when importing
> libraries that were installed via PIP when importing them inside Eclipse
> (version 4.3.1). Outside Eclipse (directly in Python's shell) eve
when I do profiling is it possible to find out if I am spending a lot of
time in type conversion?
it seems I am not. Also, is it possible to predeclare a type in python?
Similar to C: int i=0;
On Sat, Feb 15, 2014 at 10:06 PM, Rustom Mody wrote:
> On Sunday, February 16, 2014 4:45:04 AM UTC+5
Without any warranty.
>>> def z(r):
... # r: int > 0
... t = log10(r)
... if t >= 12.0:
... prefix = ''
... prefix2 = ''
... elif t >= 9.0:
... prefix = 'giga'
... prefix2 = 'G'
... r = r / 1.0e9
... elif t >= 6.0:
... prefix = 'm
On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith wrote:
> In article ,
> Roy Smith wrote:
>
>> > > $ pip install --no-index --quiet --find-links packages metar==1.4.0
>> > [snip]
>> > > ValueError: unknown url type: packages
>> >
>> > The path to your cache directory is incorrect. I suggest using
>>
On Sun, 16 Feb 2014 12:52:58 +0200, Marko Rauhamaa wrote:
> Ian Kelly :
>
> (1).__str__()
>> '1'
>
> Fair enough.
>
> The syntactic awkwardness, then, explains why numbers don't have an
> evolved set of methods (unlike strings).
But numbers do have an evolved set of methods.
py> [name fo
On Sun, Feb 16, 2014 at 9:52 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
> (1).__str__()
>> '1'
>
> Fair enough.
>
> The syntactic awkwardness, then, explains why numbers don't have an
> evolved set of methods (unlike strings).
No; it's more that numbers are more often used with either operator
Steven D'Aprano :
> On Sat, 15 Feb 2014 23:01:53 +0200, Marko Rauhamaa wrote:
> I demonstrated a situation where your claim:
>
> id(x) == id(y) implies x is y
>
> fails.
My from-the-hip formulation can obviously be inaccurate, but I was
hoping the point was clear.
The Python language specifi
Ian Kelly :
(1).__str__()
> '1'
Fair enough.
The syntactic awkwardness, then, explains why numbers don't have an
evolved set of methods (unlike strings).
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Feb 16, 2014 at 7:40 PM, Steven D'Aprano
wrote:
> There are three simple ways to get the effect that you want:
>
> py> x = 1; x.__str__() # don't use a literal
> '1'
> py> (1).__str__() # parenthesize the literal
> '1'
> py> 1 .__str__() # offset it from the dot with a space
> '1'
Four
On 2/15/2014 11:41 PM, Tim Chase wrote:
I'm not coming up with the right keywords to find what I'm hunting.
I'd like to randomly sample a modestly compact list with weighted
distributions, so I might have
data = (
("apple", 20),
("orange", 50),
("grape", 30),
)
If you ac
On Sun, 16 Feb 2014 10:08:22 +0200, Marko Rauhamaa wrote:
> Case in point, if everything is a reference, how come:
>
>>>> "hello".__str__()
>'hello'
>>>> 1.__str__()
>SyntaxError: invalid syntax
Because it is a syntax error, just like the parser tells you. When the
parser sees "
On 2/16/2014 1:38 AM, Devin Jeanpierre wrote:
On Sat, Feb 15, 2014 at 8:45 PM, Sam wrote:
I would like to learn and try out functional programming (FP). I love Python
and would like to use it to try FP. Some have advised me to use Haskell instead
because Python is not a good language for FP.
Marko Rauhamaa writes:
> Case in point, if everything is a reference, how come:
>
>>>> "hello".__str__()
>'hello'
>>>> 1.__str__()
>SyntaxError: invalid syntax
>>> (1).__str__()
'1'
>>> 1..__str__()
'1.0'
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/
Marko Rauhamaa writes:
> Marko Rauhamaa :
>
> > Conceptually, the "everything is a reference" and the "small"/"big"
> > distinction are equivalent (produce the same outcomes). The question
> > is, which model is easier for a beginner to grasp.
>
> Case in point, if everything is a reference, ho
On Sun, Feb 16, 2014 at 1:28 AM, Ian Kelly wrote:
>
> On Feb 16, 2014 1:11 AM, "Marko Rauhamaa" wrote:
>> Case in point, if everything is a reference, how come:
>>
>>>>> "hello".__str__()
>>'hello'
>>>>> 1.__str__()
>>SyntaxError: invalid syntax
>
> You need parentheses around the
On Feb 16, 2014 1:11 AM, "Marko Rauhamaa" wrote:
>
> Marko Rauhamaa :
>
> > Conceptually, the "everything is a reference" and the "small"/"big"
> > distinction are equivalent (produce the same outcomes). The question
> > is, which model is easier for a beginner to grasp.
>
> Case in point, if ever
I should emphasize that this is with the /same/ x.y version...
Installing 3.3 when the previous was 3.2 won't overlay.
Though I don't see anything in the ActiveState builds (which are all
I've ever used) to handle the #! type selection of the desired version.
Just got done updat
Marko Rauhamaa :
> Conceptually, the "everything is a reference" and the "small"/"big"
> distinction are equivalent (produce the same outcomes). The question
> is, which model is easier for a beginner to grasp.
Case in point, if everything is a reference, how come:
>>> "hello".__str__()
'h
This made me grin. ;)
--
https://mail.python.org/mailman/listinfo/python-list
79 matches
Mail list logo