Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Marko Rauhamaa
Jussi Piitulainen : > Michael Torrie writes: > >> On 06/15/2016 08:57 AM, Jussi Piitulainen wrote: >>> Marko Rauhamaa writes: And nothing in alister's answer suggests that. >>> >>> Now *I'm* surprised. >> >> He simply said, here's a regex that can parse the example string the OP >> gave us (

What is structured programming (was for/while else doesn't make sense)

2016-06-15 Thread Rustom Mody
On Thursday, June 16, 2016 at 8:25:10 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Thursday, June 16, 2016 at 1:51:54 AM UTC+12, Random832 wrote: > > ... and in particular it does not establish that break is in any way > > less structured than any other constructs that have keywords. > > Interesti

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Jussi Piitulainen
Michael Torrie writes: > On 06/15/2016 08:57 AM, Jussi Piitulainen wrote: >> Marko Rauhamaa writes: >>> And nothing in alister's answer suggests that. >> >> Now *I'm* surprised. > > He simply said, here's a regex that can parse the example string the OP > gave us (which maybe looked a bit like HT

Re: for / while else doesn't make sense

2016-06-15 Thread Lawrence D’Oliveiro
On Thursday, June 16, 2016 at 1:51:54 AM UTC+12, Random832 wrote: > ... and in particular it does not establish that break is in any way > less structured than any other constructs that have keywords. Interesting that those who objected to my use of while-True-break loops could not come up with a

Re: Bulk Adding Methods Pythonically

2016-06-15 Thread Lawrence D’Oliveiro
On Thursday, June 16, 2016 at 5:37:14 AM UTC+12, Rob Gaddi wrote: > I've got a whole lot of methods I want to add to my Channel class, all > of which following nearly the same form. The below code works, but > having to do the for loop outside of the main class definition feels > kludgey. No, tha

Re: for / while else doesn't make sense

2016-06-15 Thread Lawrence D’Oliveiro
On Thursday, June 16, 2016 at 2:32:00 AM UTC+12, Rustom Mody wrote: > Here is C.A.R Hoare's Turing award speech: > https://www.cs.fsu.edu/~engelen/courses/COP4610/hoare.pdf > > in which (2nd last page) he claims that Ada is a threat to civilization... > because it has something as terrible as exc

Re: how to for loop append a list [] when using parallel programming

2016-06-15 Thread meInvent bbird
is there like c# have concurrent list ? i find something these, but how can it pass an initlist list variable is it doing the same function as itertools.combinations ? def comb(n, initlist): # the argument n is the number of items to select res = list(itertools.combinations(initlist, n)) # c

Re: how to for loop append a list [] when using parallel programming

2016-06-15 Thread John Gordon
In meInvent bbird writes: > how to for loop append a list [] when using parallel programming items = [] for item in parallelized_object_factory(): items.append(item) If you want a more specific answer, ask a more specific question. -- John Gordon A is for A

PyQt5: is the wrapper incomplete?

2016-06-15 Thread jladasky
I am developing a data acquisition system for a custom device that communicates over USB. On the host computer side, I am using PyQt5.4. My Linux box has both Qt4 and Qt5 installed on it. I assume that PyQt5.4 compiled on top of Qt5 automatically. I'm not sure how to check that. In any case

how to for loop append a list [] when using parallel programming

2016-06-15 Thread meInvent bbird
how to for loop append a list [] when using parallel programming -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-06-15 Thread Steven D'Aprano
On Thu, 16 Jun 2016 03:03 am, Rustom Mody wrote: > So break also has its uses. Lets just not pretend its structured What's your definition of "structured" that makes "break" unstructured? Suppose I have a language, L, with a keyword "fnord". How do I tell whether the fnord feature makes the lan

Re: Bulk Adding Methods Pythonically

2016-06-15 Thread Steven D'Aprano
On Thu, 16 Jun 2016 04:39 am, Rob Gaddi wrote: >> class Channel: >> frequency = mkmeasure('frequency', 'FREQ') >> falltime = mkmeasure('falltime', 'FTIM') > > Thought about it, but whenever I'm dropping 20-someodd of those there's > inevitably some place where I screw up the replication of the qu

how to change itertools.combinations(initlist, 2) to parallel for running in multiprocessor environment?

2016-06-15 Thread meInvent bbird
how to change itertools.combinations(initlist, 2) to parallel for running in multiprocessor environment? -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-06-15 Thread Steven D'Aprano
On Wed, 15 Jun 2016 09:19 pm, Rustom Mody wrote: > On Wednesday, June 15, 2016 at 8:42:33 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 15 Jun 2016 01:33 am, Rustom Mody wrote: [...] >> > And break is a euphemism for goto >> >> Sort of. A break is a jump, and a goto is a jump, but apart from tha

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Michael Torrie
On 06/15/2016 08:57 AM, Jussi Piitulainen wrote: > Marko Rauhamaa writes: >> And nothing in alister's answer suggests that. > > Now *I'm* surprised. He simply said, here's a regex that can parse the example string the OP gave us (which maybe looked a bit like HTML, but like you say, may not be),

Re: pip vs pip2 vs pip2.7?

2016-06-15 Thread Chupo via Python-list
In article , Random832 says... > The idea is, if you have multiple python installations on your path, > "pip" will find the first one, "pip2" will find the first python2 one > (so if the first one was python3, or vice versa), and pip2.7 will find > 2.7 even if e.g. 2.6 was before it on the path.

Recommended courses/materials for Python/Django course...

2016-06-15 Thread Fred Stluka
Python programmers, Any Python and/or Django courses/materials to recommend? I may be teaching a Python/Django class soon. My client may be willing to jumpstart by buying existing course materials (lecture slides, notes, homeworks, labs, reference links, any other materials). W

Re: PEP8 needs revision

2016-06-15 Thread Ethan Furman
On 06/15/2016 12:18 PM, Kyle Thomas wrote: Knuth's quote refers to the output of TeX, the programming language he authored. The quote cannot be interpreted to speak about formatting of source-code. PEP 8 is primarily concerned with the readability of source code, so if Knuth was speaking abou

Re: pip vs pip2 vs pip2.7?

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 16:34, Chupo via Python-list wrote: > I am assuming multiple copies of the same file with different names are > because of some compatibility issues but couldn't find any explanations > so I hope someone can point me to some docs explaining the issue. The idea is, if you

python-2.7.11.msi destroys PATH env var?

2016-06-15 Thread Chupo via Python-list
After installing Python 2.7.11 through python-2.7.11.msi Windows installer OS couldn't anymore detect antivirus software so after some investigation I found that PATH environment variable was completely removed from the system. I had to recreate the PATH var and add: %SystemRoot%\system32;%Syst

pip vs pip2 vs pip2.7?

2016-06-15 Thread Chupo via Python-list
Hi everyone, this is my first post here. I've been using Python occasionally to accomplish some specific tasks but now I decided to study it more seriously. I am successfully using both Python 2.6.2 and Python 3.2.2 instaled on Windows. I installed 2.6.2 back in 2009. and 3.2.2 came along with

Re: PEP8 needs revision

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 15:18, Kyle Thomas wrote: > To Whom It May Concern, > Knuth's quote refers to the output of TeX, the programming language he > authored. The quote cannot be interpreted to speak about formatting of > source-code. It speaks about what is more readable, and is mentioned in

PEP8 needs revision

2016-06-15 Thread Kyle Thomas
To Whom It May Concern, Knuth's quote refers to the output of TeX, the programming language he authored. The quote cannot be interpreted to speak about formatting of source-code. One bit of evidence I can offer is that TeX's source only cares about multiple newlines in considering the multiplicity

Re: Bulk Adding Methods Pythonically

2016-06-15 Thread Ethan Furman
On 06/15/2016 10:37 AM, Rob Gaddi wrote: I've got a whole lot of methods I want to add to my Channel class, all of which following nearly the same form. The below code works, but having to do the for loop outside of the main class definition feels kludgey. Am I missing some cleaner answer? I

Re: Anyone know a donation app codebase?

2016-06-15 Thread Albert
On Monday, June 6, 2016 at 10:17:35 AM UTC-3, Michael Selik wrote: > On Sun, Jun 5, 2016 at 3:26 PM Ben Finney <> > wrote: > > > Albert <> writes: > > > > > Thank you for your answer Ben, > > > > You're welcome. Please note that top-posting is poor etiquette for > > discussions; instead, interleav

Re: Bulk Adding Methods Pythonically

2016-06-15 Thread Rob Gaddi
Random832 wrote: > On Wed, Jun 15, 2016, at 13:37, Rob Gaddi wrote: >> I've got a whole lot of methods I want to add to my Channel class, all >> of which following nearly the same form. The below code works, but >> having to do the for loop outside of the main class definition feels >> kludgey.

Re: Bulk Adding Methods Pythonically

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 13:37, Rob Gaddi wrote: > I've got a whole lot of methods I want to add to my Channel class, all > of which following nearly the same form. The below code works, but > having to do the for loop outside of the main class definition feels > kludgey. Am I missing some cleane

Re: for / while else doesn't make sense

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 13:18, Michael Selik wrote: > On Wed, Jun 15, 2016, 10:28 AM Rustom Mody wrote: > > > Where did the question of "break can be written as goto" come from? > > > > Stephen said the "else" in for-else was "unconditional". He argued that > neither the presence nor absence of

Bulk Adding Methods Pythonically

2016-06-15 Thread Rob Gaddi
I've got a whole lot of methods I want to add to my Channel class, all of which following nearly the same form. The below code works, but having to do the for loop outside of the main class definition feels kludgey. Am I missing some cleaner answer? I thought about just checking for all of it in

Re: for / while else doesn't make sense

2016-06-15 Thread BartC
On 15/06/2016 18:03, Rustom Mody wrote: OTOH Duff's device shows terrifyingly unstructured code with nary a goto/break in sight I agree, and these mostly originate in C. It's full of crude features that should have been pensioned off decades ago, but amazingly it is still around and highly i

Re: for / while else doesn't make sense

2016-06-15 Thread Michael Selik
On Wed, Jun 15, 2016, 10:28 AM Rustom Mody wrote: > Where did the question of "break can be written as goto" come from? > Stephen said the "else" in for-else was "unconditional". He argued that neither the presence nor absence of a break should be considered a condition, because we don't conside

Re: for / while else doesn't make sense

2016-06-15 Thread Rustom Mody
On Wednesday, June 15, 2016 at 9:24:21 PM UTC+5:30, Random832 wrote: > On Wed, Jun 15, 2016, at 10:20, Rustom Mody wrote: > > Claim is that the damaging propensities of goto are replicable with > > break. > > The "damaging propensity" in this particular case simply comes from the > fact that it's

Re: GoPiGo distence sensor

2016-06-15 Thread William Ray Wing
> On Jun 15, 2016, at 10:59 AM, Joel Goldstick wrote: > > On Wed, Jun 15, 2016 at 10:15 AM, wrote: >> I have a small robot on wheels named the GoPiGo. >> What I want is if the distence sensor read the same distence for let say 5 >> seconds then the GoPiGo go's backward. >> When I look at th

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Jussi Piitulainen
alister writes: > On Wed, 15 Jun 2016 15:55:42 +0300, Jussi Piitulainen wrote: > >> alister writes: >> >>> On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: >>> Hi everyone, I am struggling writing a right regex that match what I want: Problem Description: Give

Re: for / while else doesn't make sense

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 10:20, Rustom Mody wrote: > Claim is that the damaging propensities of goto are replicable with > break. The "damaging propensity" in this particular case simply comes from the fact that it's a statement that can appear in the body of an if statement (the real flaw that ca

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread alister
On Wed, 15 Jun 2016 15:55:42 +0300, Jussi Piitulainen wrote: > alister writes: > >> On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: >> >>> Hi everyone, >>> I am struggling writing a right regex that match what I want: >>> >>> Problem Description: >>> >>> Given a string like this: >>> >>>

Re: GoPiGo distence sensor

2016-06-15 Thread Joel Goldstick
On Wed, Jun 15, 2016 at 11:00 AM, MRAB wrote: > On 2016-06-15 15:15, ldompel...@casema.nl wrote: >> >> I have a small robot on wheels named the GoPiGo. >> What I want is if the distence sensor read the same distence for let say 5 >> seconds then the GoPiGo go's backward. >> >> But I don't now how

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen writes: > >> alister writes: >> >>> On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: Given a string like this: >>>string = "false_head aaa bbb false_tail \ true_head some_text_here ccc ddd eee t

Re: GoPiGo distence sensor

2016-06-15 Thread MRAB
On 2016-06-15 15:15, ldompel...@casema.nl wrote: I have a small robot on wheels named the GoPiGo. What I want is if the distence sensor read the same distence for let say 5 seconds then the GoPiGo go's backward. But I don't now how to program this in python. The Api functions for the GoPiGo are

Re: GoPiGo distence sensor

2016-06-15 Thread Joel Goldstick
On Wed, Jun 15, 2016 at 10:15 AM, wrote: > I have a small robot on wheels named the GoPiGo. > What I want is if the distence sensor read the same distence for let say 5 > seconds then the GoPiGo go's backward. > > But I don't now how to program this in python. > The Api functions for the GoPiGo

Re: for / while else doesn't make sense

2016-06-15 Thread Rustom Mody
On Wednesday, June 15, 2016 at 7:21:54 PM UTC+5:30, Random832 wrote: > On Wed, Jun 15, 2016, at 07:19, Rustom Mody wrote: > > I thought there'd be many examples for showing that break is just goto in > > disguise... Evidently not > > > > So here is an example in more detail for why/how break=goto

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Marko Rauhamaa
Jussi Piitulainen : > alister writes: > >> On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: >>> Given a string like this: >>> >>> >>>string = "false_head aaa bbb false_tail \ >>> true_head some_text_here ccc ddd eee >>> true_tail" >>> >>> I want to match the all

Re: for / while else doesn't make sense

2016-06-15 Thread Rustom Mody
On Wednesday, June 15, 2016 at 7:21:54 PM UTC+5:30, Random832 wrote: > On Wed, Jun 15, 2016, at 07:19, Rustom Mody wrote: > > I thought there'd be many examples for showing that break is just goto in > > disguise... Evidently not > > > > So here is an example in more detail for why/how break=goto

GoPiGo distence sensor

2016-06-15 Thread ldompeling
I have a small robot on wheels named the GoPiGo. What I want is if the distence sensor read the same distence for let say 5 seconds then the GoPiGo go's backward. But I don't now how to program this in python. The Api functions for the GoPiGo are here: http://www.dexterindustries.com/GoPiGo/prog

Re: Python 3.6.0a2 is now available

2016-06-15 Thread MRAB
On 2016-06-15 14:38, cjw wrote: On Monday, 13 June 2016 23:57:20 UTC-4, Ned Deily wrote: On behalf of the Python development community and the Python 3.6 release team, I'm happy to announce the availability of Python 3.6.0a2. 3.6.0a2 is the first of four planned alpha releases of Python 3.6, th

Re: for / while else doesn't make sense

2016-06-15 Thread Chris Angelico
On Wed, Jun 15, 2016 at 11:51 PM, Random832 wrote: > if(x) true_body; else false_body; > > is syntactic sugar for: > > if(!x) goto else; > true_body; > goto end; > else: false_body; > end: ; And I remember writing GW-BASIC code like this, because we didn't have block if. You could put a single st

Re: for / while else doesn't make sense

2016-06-15 Thread Random832
On Wed, Jun 15, 2016, at 07:19, Rustom Mody wrote: > I thought there'd be many examples for showing that break is just goto in > disguise... Evidently not > > So here is an example in more detail for why/how break=goto: > > http://blog.languager.org/2016/06/break-is-goto-in-disguise.html So? S

Re: Python 3.6.0a2 is now available

2016-06-15 Thread cjw
On Monday, 13 June 2016 23:57:20 UTC-4, Ned Deily wrote: > On behalf of the Python development community and the Python 3.6 release > team, I'm happy to announce the availability of Python 3.6.0a2. > 3.6.0a2 is the first of four planned alpha releases of Python 3.6, > the next major release of Pyt

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Jussi Piitulainen
alister writes: > On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: > >> Hi everyone, >> I am struggling writing a right regex that match what I want: >> >> Problem Description: >> >> Given a string like this: >> >> >>>string = "false_head aaa bbb false_tail \ >> true_head

Re: for / while else doesn't make sense

2016-06-15 Thread Rustom Mody
On Wednesday, June 15, 2016 at 5:57:51 PM UTC+5:30, BartC wrote: > On 15/06/2016 12:19, Rustom Mody wrote: > > On Wednesday, June 15, 2016 at 8:42:33 AM UTC+5:30, Steven D'Aprano wrote: > > >> Sort of. A break is a jump, and a goto is a jump, but apart from that, > >> they're not really the same t

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread alister
On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: > Hi everyone, > I am struggling writing a right regex that match what I want: > > Problem Description: > > Given a string like this: > > >>>string = "false_head aaa bbb false_tail \ > true_head some_text_here ccc ddd eee >

Re: for / while else doesn't make sense

2016-06-15 Thread BartC
On 15/06/2016 12:19, Rustom Mody wrote: On Wednesday, June 15, 2016 at 8:42:33 AM UTC+5:30, Steven D'Aprano wrote: Sort of. A break is a jump, and a goto is a jump, but apart from that, they're not really the same thing. A goto can jump (almost) anywhere. Depending on the language, they can ju

mayavi mlab mesh plot3d grid from mesh

2016-06-15 Thread Edward Montague
Hi, I'm wondering if there's any way to overlay a grid upon a mlab.mesh or mlab.surf graph. As an example of what I mean I shall attempt to attach a small file maya2.jpg . -- https://mail.python.org/mailman/listinfo/python-list

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Lawrence D’Oliveiro
On Wednesday, June 15, 2016 at 3:28:37 PM UTC+12, Yubin Ruan wrote: > I want to match the all the text surrounded by those " ", You are trying to use regex (type 3 grammar) to parse HTML (type 2 grammar) ? No can do

Re: for / while else doesn't make sense

2016-06-15 Thread Rustom Mody
On Wednesday, June 15, 2016 at 8:42:33 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 15 Jun 2016 01:33 am, Rustom Mody wrote: > > > On Tuesday, June 14, 2016 at 8:13:53 AM UTC+5:30, Steven D'Aprano wrote: > >> No. The sun exploding was me gently mocking you for your comment > >> disputing the "unc

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Vlastimil Brom
2016-06-15 5:28 GMT+02:00 Yubin Ruan : > Hi everyone, > I am struggling writing a right regex that match what I want: > > Problem Description: > > Given a string like this: > > >>>string = "false_head aaa bbb false_tail \ > true_head some_text_here ccc ddd eee > true_tail" > > I w

Re: log file.

2016-06-15 Thread Paul Rudin
Joaquin Alzola writes: > This email is confidential and may be subject to privilege. If you are > not the intended recipient, please do not copy or disclose its content > but contact the sender immediately upon receipt. Probably not a good idea to send it to a publicly accessible resource then :