Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Vlastimil Brom
2016-04-21 5:07 GMT+02:00 Steven D'Aprano : > I want to group repeated items in a sequence. For example, I can group > repeated sequences of a single item at a time using groupby: > > > from itertools import groupby > for key, group in groupby("BBCDDEEE"): > group = list(group) > pr

Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Michael Selik
On Thu, Apr 21, 2016 at 2:35 AM Michael Selik wrote: > On Wed, Apr 20, 2016 at 11:11 PM Steven D'Aprano > wrote: > >> I want to group [repeated] subsequences. For example, I have: >> "ABCABCABCDEABCDEFABCABCABCB" >> and I want to group it into repeating subsequences. I can see two >> ways... How

Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Michael Selik
On Wed, Apr 20, 2016 at 11:11 PM Steven D'Aprano wrote: > I want to group [repeated] subsequences. For example, I have: > "ABCABCABCDEABCDEFABCABCABCB" > and I want to group it into repeating subsequences. I can see two > ways... How can I do this? Does this problem have a standard name and/or >

Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Chris Angelico
On Thu, Apr 21, 2016 at 1:07 PM, Steven D'Aprano wrote: > Now I want to group subsequences. For example, I have: > > "ABCABCABCDEABCDEFABCABCABCB" > > and I want to group it into repeating subsequences. I can see two ways to > group it: > > ABC ABC ABCDE ABCDE F ABC ABC ABC B > > or: > > ABC ABC A

Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Ethan Furman
On 04/20/2016 08:57 PM, Ethan Furman wrote: > [snip same pattern as Steven wrote] Nevermind. It's obviously time for me to go to bed. :/ -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Detecting repeated subsequences of identical items

2016-04-20 Thread Ethan Furman
On 04/20/2016 08:07 PM, Steven D'Aprano wrote: Now I want to group subsequences. For example, I have: "ABCABCABCDEABCDEFABCABCABCB" and I want to group it into repeating subsequences. I can see two ways to group it: ABC ABC ABCDE ABCDE F ABC ABC ABC B giving counts: (ABC) count = 2 (ABCDE)

Re: Running lpr on windows from python

2016-04-20 Thread eryk sun
On Wed, Apr 20, 2016 at 9:58 AM, Tim Golden wrote: > If it's not, then try copying the lpr.exe to c:\windows\syswow64 and try > again. (Or to some other place to which you have access). WOW64 in Windows 7+ has a virtual "SysNative" directory that accesses the native 64-bit system directory:

Detecting repeated subsequences of identical items

2016-04-20 Thread Steven D'Aprano
I want to group repeated items in a sequence. For example, I can group repeated sequences of a single item at a time using groupby: from itertools import groupby for key, group in groupby("BBCDDEEE"): group = list(group) print(key, "count =", len(group)) outputs: A count = 4 B

Re: Failed install scipy lib

2016-04-20 Thread eryk sun
On Wed, Apr 20, 2016 at 8:04 AM, Oscar Benjamin wrote: > On 20 April 2016 at 12:30, wrote: > >> from ._ufuncs import * >> File "scipy\special\_ufuncs.pyx", line 1, in init scipy.special._ufuncs >> (scipy\special\_ufuncs.c:26242) >> ImportError: DLL load failed: The specified module could

RE: Xlms namespace

2016-04-20 Thread Joaquin Alzola
>> The problem: >> test\ntest\ntest<{[£ EURO&%]}> >If I had to make a guess, you need to escape the <, >, and &characters or else >they'll get parsed by the XML parser. Try sending >"test\ntest\ntest<{[£ EURO&%>]}>" Yes it is the xml itself. Putting the & and also the < I can make it work wit

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Steven D'Aprano
On Thu, 21 Apr 2016 05:34 am, Ken Seehart wrote: > Currently the common pattern for yielding the elements in a sequence is as > follows: > > for x in sequence: yield x > > I propose the following replacement (the result would be identical): > > yield *sequence Others have already pointed o

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Chris Angelico
On Thu, Apr 21, 2016 at 8:26 AM, wrote: > Anyway, thanks for the link. And I suppose checking Python 3 for > implementation would be a good prior step as well! Sadly, "yield from" is not > in python 2.7, but it's presence in python 3.3 renders my proposal dead as a > parrot without a liver. >

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread kenseehart
On Wednesday, April 20, 2016 at 1:00:45 PM UTC-7, Ethan Furman wrote: > On 04/20/2016 12:34 PM, Ken Seehart wrote: > > New ideas for Python are typically vetted on Python Ideas. [1] > > > Currently the common pattern for yielding the elements in a sequence > > is as follows: > > > >for x in

Re: Running lpr on windows from python

2016-04-20 Thread Stephen Hansen
On Wed, Apr 20, 2016, at 06:57 AM, loial wrote: > process = subprocess.Popen(commandline, shell=True, > stdout=subprocess.PIPE, stderr=subprocess.PIPE) > > where command line is > C:/windows/system32/lpr.exe -S 172.28.84.38 -P RAW C:/john/myfile Try making command line: commandline = r"C:\windows

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Alan Evangelista
Currently the common pattern for yielding the elements in a sequence is as follows: for x in sequence: yield x I propose the following replacement (the result would be identical): yield *sequence imho the current syntax is much more intuitive, it is obvious to infer what it does by

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Ethan Furman
On 04/20/2016 12:34 PM, Ken Seehart wrote: New ideas for Python are typically vetted on Python Ideas. [1] Currently the common pattern for yielding the elements in a sequence > is as follows: for x in sequence: yield x I propose the following replacement (the result would be identical):

Re: PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Random832
On Wed, Apr 20, 2016, at 15:34, Ken Seehart wrote: > Currently the common pattern for yielding the elements in a sequence is > as follows: > > for x in sequence: yield x > > I propose the following replacement (the result would be identical): > > yield *sequence yield from sequence -- http

PEP proposal: sequence expansion support for yield statement: yield *

2016-04-20 Thread Ken Seehart
Currently the common pattern for yielding the elements in a sequence is as follows: for x in sequence: yield x I propose the following replacement (the result would be identical): yield *sequence The semantics are somewhat different from argument expansion (from which the syntax is borrow

Re: Xlms namespace

2016-04-20 Thread sohcahtoa82
On Wednesday, April 20, 2016 at 10:05:02 AM UTC-7, Joaquin Alzola wrote: > Hi Guys > > I am currently doing this: > > IP client(Python) --> send SOAPXML request --> IP Server (Python) > > SOAP request: > http://schemas.xmlsoap.org/soap/envelope/"; > xmlns:req="http:/ > /request.messagepush.inte

Xlms namespace

2016-04-20 Thread Joaquin Alzola
Hi Guys I am currently doing this: IP client(Python) --> send SOAPXML request --> IP Server (Python) SOAP request: http://schemas.xmlsoap.org/soap/envelope/"; xmlns:req="http:/ /request.messagepush.interfaces.comviva.com" xmlns:xsd="http://request.messagepush.interfaces .comviva.com/xsd"> test

Re: Creating Dict of Dict of Lists with joblib and Multiprocessing

2016-04-20 Thread Michael Selik
On Wed, Apr 20, 2016 at 10:50 AM Sims, David (NIH/NCI) [C] < david.si...@nih.gov> wrote: > Hi, > > Cross posted at > http://stackoverflow.com/questions/36726024/creating-dict-of-dicts-with-joblib-and-multiprocessing, > but thought I'd try here too as no responses there so far. > > A bit new to pyt

Re: Failed install scipy lib

2016-04-20 Thread Gonzalo V
oscar instálate mejor anaconda y listo. Saludos, Gonzalo 2016-04-20 10:04 GMT-03:00 Oscar Benjamin : > On 20 April 2016 at 12:30, wrote: > > On Wednesday, April 20, 2016 at 2:09:10 PM UTC+3, liran@gmail.com > wrote: > >> On Tuesday, April 19, 2016 at 9:21:42 PM UTC+3, eryk sun wrote: > >>

Re: Running lpr on windows from python

2016-04-20 Thread Tim Golden
On 20/04/2016 15:21, loial wrote: > As I said, the lpr command works fine from the command prompt but not from > python. Sorry; I did miss that. > Everything is 64-bit (windows server 2012). > Is the Python installation also 64-bit? c:\python27\python.exe -c "import platform; print platform.a

Creating Dict of Dict of Lists with joblib and Multiprocessing

2016-04-20 Thread Sims, David (NIH/NCI) [C]
Hi, Cross posted at http://stackoverflow.com/questions/36726024/creating-dict-of-dicts-with-joblib-and-multiprocessing, but thought I'd try here too as no responses there so far. A bit new to python and very new to parallel processing in python. I have a script that will process a datafile an

Re: Running lpr on windows from python

2016-04-20 Thread loial
I get the same issue if I just specify "lpr" rather than a full path, i.e. it works from the command prompt(with forward slashes), but not from python -- https://mail.python.org/mailman/listinfo/python-list

Re: Running lpr on windows from python

2016-04-20 Thread loial
As I said, the lpr command works fine from the command prompt but not from python. Everything is 64-bit (windows server 2012). -- https://mail.python.org/mailman/listinfo/python-list

Re: Running lpr on windows from python

2016-04-20 Thread Tim Golden
On 20/04/2016 14:57, loial wrote: > I am trying to run lpr from python 2.7.10 on windows > > However I always get the error > 'C:/windows/system32/lpr.exe ' is not recognized as an internal or external > command, > operable program or batch file. > > Even though typing the same at the command p

Re: Running lpr on windows from python

2016-04-20 Thread Random832
On Wed, Apr 20, 2016, at 09:57, loial wrote: > I am trying to run lpr from python 2.7.10 on windows > > However I always get the error > 'C:/windows/system32/lpr.exe ' is not recognized as an internal or > external command, > operable program or batch file. > > Even though typing the same at the

Re: Running lpr on windows from python

2016-04-20 Thread Chris Angelico
On Wed, Apr 20, 2016 at 11:57 PM, loial wrote: > I am trying to run lpr from python 2.7.10 on windows > > However I always get the error > 'C:/windows/system32/lpr.exe ' is not recognized as an internal or external > command, > operable program or batch file. > > Even though typing the same at th

Running lpr on windows from python

2016-04-20 Thread loial
I am trying to run lpr from python 2.7.10 on windows However I always get the error 'C:/windows/system32/lpr.exe ' is not recognized as an internal or external command, operable program or batch file. Even though typing the same at the command prompt works OK Any ideas? I am using subprocess

Re: Failed install scipy lib

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 12:30, wrote: > On Wednesday, April 20, 2016 at 2:09:10 PM UTC+3, liran@gmail.com wrote: >> On Tuesday, April 19, 2016 at 9:21:42 PM UTC+3, eryk sun wrote: >> > On Tue, Apr 19, 2016 at 12:05 PM, Oscar Benjamin >> > wrote: >> > > On 19 Apr 2016 17:01, wrote: >> > >> >> >

Just-in-Time Static Type Checking for Dynamic Languages

2016-04-20 Thread Neal Becker
I saw this article, which might interest some of you. It discusses application to ruby, but perhaps might have ideas useful for python. https://arxiv.org/abs/1604.03641 -- https://mail.python.org/mailman/listinfo/python-list

Re: djqgrid 0.2.4 error import json_helpers

2016-04-20 Thread Chris Angelico
On Wed, Apr 20, 2016 at 9:00 PM, asimkon . wrote: > Inside my templatetags folder (djqgrid.py), i have the following commands: > > from django import template > from djqgrid import json_helpers > > Any idea to get a solution ? > You're attempting to import from yourself, there. Is that what you

Re: Failed install scipy lib

2016-04-20 Thread liran . maymoni
On Wednesday, April 20, 2016 at 2:09:10 PM UTC+3, liran@gmail.com wrote: > On Tuesday, April 19, 2016 at 9:21:42 PM UTC+3, eryk sun wrote: > > On Tue, Apr 19, 2016 at 12:05 PM, Oscar Benjamin > > wrote: > > > On 19 Apr 2016 17:01, wrote: > > >> > > >> i'm trying to use: > > >> "py -m pip inst

Re: Failed install scipy lib

2016-04-20 Thread liran . maymoni
On Tuesday, April 19, 2016 at 9:21:42 PM UTC+3, eryk sun wrote: > On Tue, Apr 19, 2016 at 12:05 PM, Oscar Benjamin > wrote: > > On 19 Apr 2016 17:01, wrote: > >> > >> i'm trying to use: > >> "py -m pip install scipy" > >> and after couple of lines a get an error saying: > > > > I thought that bin

djqgrid 0.2.4 error import json_helpers

2016-04-20 Thread asimkon .
Hello! I want to use this wrapper for a module in my Django 1.9.4 version. I have configured all the steps mentioned successfully but in the end i get the following error message in my browser: Invalid template library specified. ImportError raised whe

Re: Guido sees the light: PEP 8 updated

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 02:38, Steven D'Aprano wrote: > > "Oh no! We're having trouble displaying this Scratch project. > > If you are on a mobile phone or tablet, try visiting this project on a > computer. > > If you're on a computer, your Flash player might be disabled, missing, or > out of date." >

Re: Guido sees the light: PEP 8 updated

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 07:08, Terry Reedy wrote: > On 4/19/2016 11:41 PM, Chris Angelico wrote: >> >> On Wed, Apr 20, 2016 at 1:23 PM, Terry Reedy wrote: It kinda looks like Hypertalk syntax, which some of you may remember I'm exceedingly fond of. There's no reason why a GUI editor co