Re: What is wrong with this regex for matching emails?

2017-12-21 Thread Peter J. Holzer
On 2017-12-20 08:21:02 +1100, Chris Angelico wrote: > If there are no MX records for a domain, either the domain doesn't > exist, or it doesn't receive mail. This is not necessarily correct. An MTA has to fall back to A and records if no MX record exists, so a domain can receive mail without

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread Random832
On Mon, Dec 18, 2017, at 02:01, Chris Angelico wrote: > Hmm, is that true? I was under the impression that the quoting rules > were impossible to match with a regex. Or maybe it's just that they're > impossible to match with a *standard* regex, but the extended > implementations (including Python'

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread alister via Python-list
On Wed, 20 Dec 2017 08:21:02 +1100, Chris Angelico wrote: > On Wed, Dec 20, 2017 at 7:21 AM, alister via Python-list > wrote: >> On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: >>> A more correct match would boil down to: >>> >>> * Match any printable Unicode characters (not just ASCII). >>

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread Chris Angelico
On Wed, Dec 20, 2017 at 7:21 AM, alister via Python-list wrote: > On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: >> A more correct match would boil down to: >> >> * Match any printable Unicode characters (not just ASCII). >> >> * Locate the *last* ‘@’ character. (An email address may contai

Re: What is wrong with this regex for matching emails?

2017-12-19 Thread alister via Python-list
On Mon, 18 Dec 2017 07:57:27 +1100, Ben Finney wrote: > Peng Yu writes: > >> Hi, >> >> I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". > > Others have address this question. I'll answer a separate one: > >> Does anybody see what is wrong with it? Thanks. > > One thing th

Re: What is wrong with this regex for matching emails?

2017-12-17 Thread Chris Angelico
On Mon, Dec 18, 2017 at 5:43 PM, Random832 wrote: > On Sun, Dec 17, 2017, at 10:46, Chris Angelico wrote: >> But if you're trying to *validate* an email address - for instance, if >> you receive a form submission and want to know if there was an email >> address included - then my recommendation i

Re: What is wrong with this regex for matching emails?

2017-12-17 Thread Random832
On Sun, Dec 17, 2017, at 10:46, Chris Angelico wrote: > But if you're trying to *validate* an email address - for instance, if > you receive a form submission and want to know if there was an email > address included - then my recommendation is simply DON'T. You can't > get all the edge cases right

Re: What is wrong with this regex for matching emails?

2017-12-17 Thread Ben Finney
Peng Yu writes: > Hi, > > I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". Others have address this question. I'll answer a separate one: > Does anybody see what is wrong with it? Thanks. One thing that's wrong with it is that it is far too restrictive. > email_regex = re

Re: What is wrong with this regex for matching emails?

2017-12-17 Thread Ned Batchelder
On 12/17/17 10:29 AM, Peng Yu wrote: Hi, I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". Does anybody see what is wrong with it? Thanks. $ cat main.py #!/usr/bin/env python # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: import re email_re

Re: What is wrong with this regex for matching emails?

2017-12-17 Thread Chris Angelico
On Mon, Dec 18, 2017 at 2:29 AM, Peng Yu wrote: > Hi, > > I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". > Does anybody see what is wrong with it? Thanks. > > $ cat main.py > #!/usr/bin/env python > # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 > fileencoding

What is wrong with this regex for matching emails?

2017-12-17 Thread Peng Yu
Hi, I would like to extract "a...@efg.hij.xyz". But it only shows ".hij". Does anybody see what is wrong with it? Thanks. $ cat main.py #!/usr/bin/env python # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: import re email_regex = re.compile('[a-zA-Z0-9_.+-]+@[a-z

Re: what is wrong with this property setter

2016-06-09 Thread Peter Otten
Nagy László Zsolt wrote: > >>> Yes, and more. That property will also have a get method! Is it >>> intentional? >> It's a logical effect of how the setter() method works. The above is >> syntactic sugar for >> >> def set_parent(...): >>... >> set_parent = parent.setter(set_parent) >> >> and p

Re: what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
>> Yes, and more. That property will also have a get method! Is it >> intentional? > It's a logical effect of how the setter() method works. The above is > syntactic sugar for > > def set_parent(...): >... > set_parent = parent.setter(set_parent) > > and parent.setter() creates a new property

Re: what is wrong with this property setter

2016-06-09 Thread Peter Otten
Nagy László Zsolt wrote: > >>> @parent.setter >>> def set_parent(self, new_parent): >>> self._parent = new_parent >> This creates a settable property with the name "set_parent" and leaves >> the read-only property "parent" alone. > Yes, and more. That property will also have a ge

Re: what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
>> @parent.setter >> def set_parent(self, new_parent): >> self._parent = new_parent > This creates a settable property with the name "set_parent" and leaves the > read-only property "parent" alone. Yes, and more. That property will also have a get method! Is it intentional? -- h

Re: what is wrong with this property setter

2016-06-09 Thread Peter Otten
Nagy László Zsolt wrote: > class Test: > def __init__(self): > self._parent = None > > @property > def parent(self): > return self._parent > > @parent.setter > def set_parent(self, new_parent): > self._parent = new_parent > > > p, c = Test(), Test()

Re: what is wrong with this property setter

2016-06-09 Thread Steven D'Aprano
On Thursday 09 June 2016 17:28, Nagy László Zsolt wrote: > class Test: Are you using Python 3 or 2? In Python 2, property doesn't work correctly with classes unless they inherit from object (directly or indirectly). > def __init__(self): > self._parent = None > > @property >

Re: what is wrong with this property setter

2016-06-09 Thread Mark Summerfield
On Thursday, June 9, 2016 at 8:28:47 AM UTC+1, Nagy László Zsolt wrote: > class Test: > def __init__(self): > self._parent = None > > @property > def parent(self): > return self._parent > > @parent.setter > def set_parent(self, new_parent): > self._pare

what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
class Test: def __init__(self): self._parent = None @property def parent(self): return self._parent @parent.setter def set_parent(self, new_parent): self._parent = new_parent p, c = Test(), Test() c.parent = p >py -3 test.py Traceback (most recent c

Re: what is wrong with this script and how do I get the value in a php script

2014-10-12 Thread Denis McMahon
On Sun, 12 Oct 2014 07:24:52 -0700, martijnperdaan wrote: > what is wrong with this script and how do I get the value Rij1 and Rij2 > and Rij3 and Rij4 and Rij5 and Rij6 in a php script I can see several pythonic errors in your script, however as for "what is wrong", I see no

Re: what is wrong with this script and how do I get the value in a php script

2014-10-12 Thread Peter Pearson
On Sun, 12 Oct 2014 07:24:52 -0700 (PDT), martijnperd...@gmail.com wrote: > what is wrong with this script and how do I get the value Rij1 and > Rij2 and Rij3 and Rij4 and Rij5 and Rij6 in a php script > > import RPi.GPIO as GPIO > GPIO.setmode(GPIO.BCM) > > GPIO.setup(17,

what is wrong with this script and how do I get the value in a php script

2014-10-12 Thread martijnperdaan
what is wrong with this script and how do I get the value Rij1 and Rij2 and Rij3 and Rij4 and Rij5 and Rij6 in a php script import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.IN) GPIO.setup(21, GPIO.IN) GPIO.setup(22, GPIO.IN) GPIO.setup(23, GPIO.IN

RE: What is wrong with this code?

2011-09-19 Thread Shambhu Rajak
st@python.org Subject: Re: What is wrong with this code? On Sun, 18 Sep 2011 21:07:22 +, superhappyfuntime wrote: > On 09-15-2011, Ulrich Eckhardt wrote: > >> superhappyfuntime wrote: >>> #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. > >>

Re: What is wrong with this code?

2011-09-18 Thread Steven D'Aprano
On Sun, 18 Sep 2011 21:07:22 +, superhappyfuntime wrote: > On 09-15-2011, Ulrich Eckhardt wrote: > >> superhappyfuntime wrote: >>> #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. > >> It's LaTeX, not Python. > >> Uli > > no, it's a cap for LaTeX written in python If

Re: What is wrong with this code?

2011-09-18 Thread superhappyfuntime
On 09-15-2011, Ulrich Eckhardt wrote: > superhappyfuntime wrote: >> #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. > It's LaTeX, not Python. > Uli no, it's a cap for LaTeX written in python -- I'm trying a new usenet client for Mac, Nemo OS X, since 0 days. You can dow

Re: What is wrong with this code?

2011-09-15 Thread John Gordon
In superhappyfuntime writes: > it's not running. here it is: > #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. > #this is defines what means what. you can just read howto.pdf instead > of this part. > here it is: = '\begin{document}' > it's an article = '\documentclass a

Re: What is wrong with this code?

2011-09-15 Thread Ulrich Eckhardt
superhappyfuntime wrote: > #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. It's LaTeX, not Python. Uli -- http://mail.python.org/mailman/listinfo/python-list

What is wrong with this code?

2011-09-15 Thread superhappyfuntime
it's not running. here it is: #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. #this is defines what means what. you can just read howto.pdf instead of this part. here it is: = '\begin{document}' it's an article = '\documentclass article' it's a book = '\documentclass{book

Re: What is wrong with this

2008-02-09 Thread Steven D'Aprano
On Sat, 09 Feb 2008 19:40:25 -0800, nure123 wrote: > But I am still interested in knowing why did the original > programmer did not get any error whereas I got an error with the > statement : Y=array([1/S, 0*lam]) *shrug* How do you know it worked fine for the original programmer? Maybe he rel

Re: What is wrong with this

2008-02-09 Thread nure123
On Feb 9, 8:56 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 09 Feb 2008 16:44:52 -0800, nure123 wrote: > > Hi, > > > I am new to Python and would be grateful if anyone could tell me what is > > wrong with the following statement. > > > Y=array([1/S, 0*lam]) > > > wher

Re: What is wrong with this

2008-02-09 Thread Steven D'Aprano
On Sat, 09 Feb 2008 16:44:52 -0800, nure123 wrote: > Hi, > > I am new to Python and would be grateful if anyone could tell me what is > wrong with the following statement. > > Y=array([1/S, 0*lam]) > > where > S=[1, 2, 3, 4] > lam=[5, 6, 7, 8] Oh, a guessing game! I love guessing games. Let'

What is wrong with this

2008-02-09 Thread nure123
Hi, I am new to Python and would be grateful if anyone could tell me what is wrong with the following statement. Y=array([1/S, 0*lam]) where S=[1, 2, 3, 4] lam=[5, 6, 7, 8] I am using Numeric not the NumPy and the original module in which this statement appears is supposed to be working perfect

Re: HELP PLEASE: What is wrong with this?

2006-04-15 Thread Thomas Jollans
Ralph H. Stoos Jr. wrote: > File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ please post the entire output and the surrounding code (as much as reasonable). It may well be some paranthesis error, as alreasy stated. -- Thomas Jollans - http:

Re: HELP PLEASE: What is wrong with this?

2006-04-15 Thread Sybren Stuvel
Ralph H. Stoos Jr. enlightened us with: > File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ Please post the entire traceback, so we can see the actual error message. Posting the context of the bad line also wouldn't hurt. Sybren -- The probl

Re: HELP PLEASE: What is wrong with this?

2006-04-14 Thread Steve Bergman
Welcome to Python! :-) You may find this mailing list useful: http://mail.python.org/mailman/listinfo/tutor -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP PLEASE: What is wrong with this?

2006-04-14 Thread David Isaac
"Ralph H. Stoos Jr." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > HELP PLEASE: What is wrong with this?File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ Probably the parenthe

HELP PLEASE: What is wrong with this?

2006-04-14 Thread Ralph H. Stoos Jr.
File "autotp.py", line 21 ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") ^ -- http://mail.python.org/mailman/listinfo/python-list