Hello
I'm stuck at why Python doesn't return the first line in this simple
regex:
===
response = "Address :\r\t\t\r\t\t\t3 Abbey Road,
St Johns Wood \r\t\t\tLondon, NW8 9AY\t\t"
re_address = re.compile('Address
:.+?(.+?)',re.I | re.S | re.M)
address = re_address.search(response)
if addr
On Mon, 16 Mar 2009 01:14:00 +0100, Gilles Ganault
wrote:
>I'm stuck at why Python doesn't return the first line in this simple
>regex
Found it: Python does extract the token, but displaying it requires
removing hidden chars:
=
response = "Address :\r\t\t\r\t\t\t3 Abbey Road,
St Johns Wood \
On Mar 15, 6:25 pm, John Machin wrote:
> A couple of issues here:
>
> (1) The number of days in a month is not a constant, so "a
> mathematician's sense of logic" is quite irrelevant.
It's relevant in the sense that some commenters on this thread seem to
want to apply some semblance of mathematic
On Mar 15, 7:26 pm, Chris Rebert wrote:
> [...] the point is that there are likewise reasonable usecases
> for the other behaviors too and one should refuse to guess in
> the face of ambiguity; the std lib has, merely by default in
> this case, taken this to the extreme of not implementing any
> o
On Sun, Mar 15, 2009 at 8:14 PM, Gilles Ganault wrote:
> Hello
>
> I'm stuck at why Python doesn't return the first line in this simple
> regex:
>
> ===
> response = "Address :\r\t\t\r\t\t\t3 Abbey Road,
> St Johns Wood \r\t\t\tLondon, NW8 9AY\t\t"
>
> re_address = re.compile('Address
> :
2009/3/14 Hendrik van Rooyen :
> No account seems to be taken of the fact that the locale approach
> is a global one that forces uniformity on everything done on a PC
> or by a user.
Not so. Under .NET, for instance, the global settings will give you a
default CultureInfo class, but you can creat
On Sun, 15 Mar 2009 19:00:43 -, MRAB
wrote:
Rhodri James wrote:
[snip]
Frankly, I'd much rather fix the locale system and extend
the format syntax to override the default locale. Perhaps
something like
financial = Locale(group_sep=",", grouping=[3])
print("my number is {0:10n:finan
John Posner wrote:
> Summary: I no longer suspect that "Python is broken". I *do* think that
> there's a situation that is potentially quite confusing:
>
> * In the statement "self.x = self.x + 1", the two "self.x" names can
> sometimes refer to different objects.
But this is fundamental to Py
Rhodri James wrote:
On Sun, 15 Mar 2009 19:00:43 -, MRAB
wrote:
Rhodri James wrote:
[snip]
Frankly, I'd much rather fix the locale system and extend
the format syntax to override the default locale. Perhaps
something like
financial = Locale(group_sep=",", grouping=[3])
print("my nu
Earlier, I said:
> I'll look into what the standard Python doc set says on this
> matter.
>
RTFM, in section "Augmented assignment statements" of python301.chm:
---
For targets which are attribute references, the initial value is retrieved with
a getattr() and the result is assigned with a se
On Sun, 15 Mar 2009 23:26:04 -, Aaron Brady
wrote:
On Mar 15, 1:50 pm, "Rhodri James"
wrote:
On Sun, 15 Mar 2009 17:55:25 -, Aaron Brady
wrote:
> On Mar 15, 12:39 pm, John Posner wrote:
>> (My apologies if the thread has already covered this.) I believe I
>> understand the WH
bearophileh...@lycos.com wrote:
> Some C# designers come from Pascal (where overflow is considered an
> important thing), and they have added to dotnet ways to find when an
> overflow occurs, globally in a program, locally in a piece of code, or
> even in a single part of an expression. This is mu
andrew cooke wrote:
> Fuzzyman wrote:
>> On Mar 15, 3:46 pm, Gerhard Häring wrote:
> [...]
>>> Me too. I doubt it, though. From an outside view, the project seems to
>>> lack focus. To me, it looks like a research platform, and producing a
>>> successor to CPython seems to be just one out of a do
On Sun, 2009-03-15 at 10:39 -0700, John Posner wrote:
> (My apologies if the thread has already covered this.) I believe I understand
> the WHAT in this situation, but I don't understand the WHY ...
> Is there a beneficial effect of silently creating the instance attribute,
> which outweighs the
On Mon, 2009-03-16 at 04:02 +, Tim Wintle wrote:
> On Sun, 2009-03-15 at 10:39 -0700, John Posner wrote:
Doh, reply out of thread there - I meant to reply to Rhodi's comment
further down.
> Is there any actual advantage to self.attribute picking up
> Class.attribute instead of raising a NameEr
In article ,
Roy Smith wrote:
>In article ,
> Chris Rebert wrote:
>>
>> Besides your behavior, one could equally well argue that a 31st repeat
>> on months without a 31st should just be dropped, or that it should
>> carry over onto the 1st of the next month (ignoring the complications
>> of Febr
On Mar 16, 11:25 am, Gilles Ganault wrote:
> On Mon, 16 Mar 2009 01:14:00 +0100, Gilles Ganault
> wrote:
>
> >I'm stuck at why Python doesn't return the first line in this simple
> >regex
>
> Found it: Python does extract the token, but displaying it requires
> removing hidden chars:
>
> =
>
i did this because this will read colors into a nested variable
How would i make this work the way you suggest? I already have it working
now :)
Not able to set to dict value with setattr, how to do this too(sorry if off
subject)?
I can set it like this:
for i in self.opt['p
what is I just set
"colors": self.opt['arg_opts_options']['imp_colors']
then they are both pointing to the same place, correct?
-Alex Goretoy
http://www.goretoy.com
On Sun, Mar 15, 2009 at 11:16 PM, alex goretoy
wrote:
> i did this because this will read colors into a nested variable
>
> How
Why is it that you can setattr() on an instance of a class that
inherits from "object", but you can't on an instance of "object"
itself?
>>> o = object()
>>> setattr(o, "x", 1000)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'object' object has no attribute 'x'
>>> cl
On Mar 16, 3:08 pm, a...@pythoncraft.com (Aahz) wrote:
> In article ,
> Roy Smith wrote:
>
> >In article ,
> > Chris Rebert wrote:
>
> >> Besides your behavior, one could equally well argue that a 31st repeat
> >> on months without a 31st should just be dropped, or that it should
> >> carry over
On Mar 15, 6:19 am, Aaron Brady wrote:
>
> Your code hung on my machine. The call to 'main()' should be in an
> 'if __name__' block:
>
> if __name__== '__main__':
> main()
>
> Is it possible you are just seeing the effects of the non-atomic
> '__iadd__' operation? That is, the value is read,
JanC:
> In most "modern" Pascal dialects the overflow checks can be (locally)
> enabled or disabled with compiler directives in the source code,
I think that was possible in somewhat older versions of Pascal-like
languages too (like old Delphi versions, and maybe TurboPascals too).
>so the "spee
Tim Golden wrote:
John Nagle wrote:
Well, of some other packages I use:
MySQLdb: "Python versions 2.3-2.5 are supported."
Ref: http://sourceforge.net/projects/mysql-python
M2Crypto: Latest version is for Python 2.6.
Ref: http://chandlerproject.org/bin/view/Projects/Me
John Posner wrote:
(My apologies if the thread has already covered this.) I believe I understand
the WHAT in this situation, but I don't understand the WHY ...
Given this class definition:
class Cls(object):
x = 345
... I observe the following, using IDLE 2.6.1:
inst = Cls()
Cls.
Hi all,
I have to write an application which does a move and copy of a
file from a remote machine to the local machine. I tried something
like:
file = ur"venuwin2008\\C\\4Folders\\Folder02\\Folder002\
\TextFile_06.txt"
dest = "C:\\test"
shutil.copy(file,dest)
But it is throwing an error
On Mar 16, 1:21 pm, Sean DiZazzo wrote:
> Why is it that you can setattr() on an instance of a class that
> inherits from "object", but you can't on an instance of "object"
> itself?
>
> >>> o = object()
> >>> setattr(o, "x", 1000)
>
> Traceback (most recent call last):
> File "", line 1, in
>
On Mar 16, 7:27 am, Tim Golden wrote:
[snip]
> people take to categorise their packages appropriately. It
> could well be the case that a number of packages will work
> in Python 3.x without modification but their entry probably
> won't reflect that unless their maintainer's gone to the
> troubl
On Sun, Mar 15, 2009 at 10:24 PM, venutaurus...@gmail.com
wrote:
> Hi all,
> I have to write an application which does a move and copy of a
> file from a remote machine to the local machine. I tried something
> like:
>
> file = ur"venuwin2008\\C\\4Folders\\Folder02\\Folder002\
> \TextFile
Joshua Kugler schrieb:
dot wrote:
has anyone experience with installing Python and pywin32 to Windows XP
Pro running in a VMware environment?
At the end of installing pywin32 I get following error:
Traceback (most recent
Joshua Kugler schrieb:
dot wrote:
has anyone experience with installing Python and pywin32 to Windows XP
Pro running in a VMware environment?
At the end of installing pywin32 I get following error:
Traceback (most recent
Joshua Kugler schrieb:
dot wrote:
has anyone experience with installing Python and pywin32 to Windows XP
Pro running in a VMware environment?
At the end of installing pywin32 I get following error:
Traceback (most recent
John Posner wrote:
Matthew Woodcraft said:
I doubt it's because anyone particularly wanted this
behaviour; it just
falls out of the way '+=' is defined.
At the point where 'inst.x += 1' is compiled,
Python doesn't know
whether 'inst.x' is going to turn out to be a class
attribute or an
inst
101 - 133 of 133 matches
Mail list logo