[issue30362] Launcher add list and list with paths options

2017-06-28 Thread Steve Dower
Steve Dower added the comment: Thanks, Steve! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30362] Launcher add list and list with paths options

2017-06-28 Thread Steve Dower
Steve Dower added the comment: New changeset 5b8f972e093157cc55185841db9ad33fa332a641 by Steve Dower (Steve (Gadget) Barnes) in branch 'master': bpo-30362 : Add list options to launcher. (#1578) https://github.com/python/cpython/commit/5b8f972e093157cc55185841db9ad33fa332a641 --

[issue30362] Launcher add list and list with paths options

2017-06-14 Thread Steve Barnes
Steve Barnes added the comment: If this option is added into the py launcher it will make it usable for a multipy script/utility that would call py -0 to get a list of installed pythons and then call it for each of the returned versions with the remaining parameters. I personally would find

[issue30362] Launcher add list and list with paths options

2017-05-24 Thread Steve Barnes
Steve Barnes added the comment: Note that the -0, --list, -0p & --list-path options will only be invoked if they are the only argument to py.exe this mirrors the original implementation of --help. -- ___ Python tracker

[issue30362] Launcher add list and list with paths options

2017-05-24 Thread Steve Barnes
Steve Barnes added the comment: --list and --list-paths added back in following review by paul.moore. The short options -0 & -0p left in as short forms. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.o

[issue30362] Launcher add list and list with paths options

2017-05-21 Thread Paul Moore
Paul Moore added the comment: I'm also not a fan of the -0 option. I'm OK with the ability to list available interpreters, but there's nothing about -0 as an option that says to me that's what it's for. I'm not a huge fan of including the list in the standard help, as py -h already generates

[issue30362] Launcher add list and list with paths options

2017-05-21 Thread Steve Barnes
Steve Barnes added the comment: Latest push still has -0 and -0p options for explicit discovery but also defaults to displaying the list if the requested version is not found. (As well as the default python being marked with a trailing * - I have also removed the less than helpful "default

[issue30362] Launcher add list and list with paths options

2017-05-20 Thread Steve Dower
Steve Dower added the comment: I agree with printing discovered interpreters in help text - not a fan of the -0 option. IDEs should probably go directly to the registry to discover Python installations (or use pep514tools), since the launcher will only launch a subset of them (i.e. per-user

[issue30362] Launcher add list and list with paths options

2017-05-20 Thread Eryk Sun
Eryk Sun added the comment: I'm -0 on the "-0" option, but I think printing the list of registered Python installations would be useful in the --help text and when the launcher fails to find a requested version. -- nosy: +eryksun ___ Python tracker

[issue30362] Launcher add list and list with paths options

2017-05-20 Thread Steve Barnes
Steve Barnes added the comment: @terry.reedy - Very good points and I like the shortness of -0 note that there is already an accepted change to allow -x.y-64 to specifically require the 64 bit versions so we don't need the complex logic to distinguish cases where -x.y will run 32 bit because

[issue30362] Launcher add list and list with paths options

2017-05-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: py already has the -number option space. To avoid conflict, use -0 (zero). I think only one option is needed -- print 'x.y path' for each binary it can find and run. 'x.y' should be the exact option needed to start the particular binary. This enhancement

[issue30362] Launcher add list and list with paths options

2017-05-15 Thread Steve Barnes
about dropping the short flags, (-l & -L), and making the long flags more launcher specific, i.e. --launcher-list and --launcher-list-paths spring to mind. I really do think that this change would be really useful, e.g. in the short form to generate a list of installed targets that might all

[issue30362] Launcher add list and list with paths options

2017-05-15 Thread Steve Dower
Steve Dower added the comment: The problem with taking more command line options is that we prevent real Python from ever using those options (or we end up with obscure rules like the "-3" one). Perhaps you'd be interested in using/contributing to my pep514tools project:

[issue30362] Launcher add list and list with paths options

2017-05-14 Thread Steve Barnes
Changes by Steve Barnes : -- pull_requests: +1671 ___ Python tracker ___ ___

[issue30362] Launcher add list and list with paths options

2017-05-14 Thread Steve Barnes
options currently available. -L print the list with the paths of the executable files. In either case the launcher should terminate after printing the list. This would be useful for deciding which python(s) to test with and for producing a list to be able to deploy critical updates to all

Re: List of paths

2009-04-08 Thread Nico Grubert
Here's a tricky case that doesn't show up in your example: In each case above, the directory names are distinct. how about: ['/desk', '/desk/ethanallen', '/desk/ikea', '/desktop', /desktop/pc', '/desktop/mac'] Should the answer be ['/desk'] or ['/desk', '/desktop'] ? Hi Scott good point.

List of paths

2009-04-01 Thread Nico Grubert
Dear Python developers I have the following (sorted) list. ['/notebook', '/notebook/mac', '/notebook/mac/macbook', '/notebook/mac/macbookpro', '/notebook/pc', '/notebook/pc/lenovo', '/notebook/pc/hp', '/notebook/pc/sony', '/desktop', '/desktop/pc/dell', '/desktop/mac/imac',

Re: List of paths

2009-04-01 Thread andrew cooke
def filter(values): ... last = None ... for value in values: ... if last is None or not value.startswith(last): ... yield value ... last = value ... for x in filter(['/notebook', ]): ... print(x) ... /notebook /desktop /server/hp/proliant andrew Nico Grubert wrote:

Re: List of paths

2009-04-01 Thread dorzey
You could use the followingm, where the_list is your list. (I'm new to python so there might be a better way): toremove = [] for x in the_list: for y in the_list: if y.startswith(x) and y != x: toremove.append(y) difference = filter(lambda x:x not

Re: List of paths

2009-04-01 Thread Nico Grubert
May be not so much pythonic, but works for i in range(len(q)): for x in q[i:]: if x.startswith(q[i]) and x!=q[i]: q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to Andrew. Your example works fine, too. Thanks to remind me of the 'yield' statement! ;-)

Re: List of paths

2009-04-01 Thread andrew cooke
Nico Grubert wrote: May be not so much pythonic, but works for i in range(len(q)): for x in q[i:]: if x.startswith(q[i]) and x!=q[i]: q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to Andrew. Your example works fine, too. Thanks to remind me of the

Re: List of paths

2009-04-01 Thread Eugene Perederey
Sure, generators rock! :-) 2009/4/1 andrew cooke and...@acooke.org: Nico Grubert wrote: May be not so much pythonic, but works for i in range(len(q)):     for x in q[i:]:        if x.startswith(q[i]) and x!=q[i]:            q.remove(x) ...but works fine. Thanks, Eugene. Also thanks to

Re: List of paths

2009-04-01 Thread Paul McGuire
On Apr 1, 3:57 am, Nico Grubert nicogrub...@gmail.com wrote: Dear Python developers I have the following (sorted) list. ['/notebook',   '/notebook/mac',   '/notebook/mac/macbook',   '/notebook/mac/macbookpro',   '/notebook/pc',   '/notebook/pc/lenovo',   '/notebook/pc/hp',  

Re: List of paths

2009-04-01 Thread Scott David Daniels
Nico Grubert wrote: Dear Python developers... I have the following (sorted) list I want to remove all paths x from the list if there is a path y in the list which is part of x so y.startswith(x) is true. The list I want to have is: ['/notebook', '/desktop', '/server/hp/proliant'] Any

reading from list with paths

2008-06-25 Thread antar2
Hello, Suppose this is a stupid question, but as a python beginner I encounter a lot of obstacles... so I would be very grateful with some help for following question: I would like to read files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are

Re: reading from list with paths

2008-06-25 Thread Larry Bates
antar2 wrote: Hello, Suppose this is a stupid question, but as a python beginner I encounter a lot of obstacles... so I would be very grateful with some help for following question: I would like to read files, of which the complete filepaths are mentioned in another textfile. In this textfile

reading from list with paths

2008-06-25 Thread antar2
Hello, I would like to read and print files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are for example the following paths: /data/chorec/chorec-nieuw/s01/S01C001M1/S01C001M1_1LG_f01.TextGrid /data/chorec/chorec-nieuw/s01/S01C001M1/

Re: reading from list with paths

2008-06-25 Thread Cédric Lucantis
Le Wednesday 25 June 2008 20:59:38 antar2, vous avez écrit : Hello, I would like to read and print files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are for example the following paths:

Re: reading from list with paths

2008-06-25 Thread [EMAIL PROTECTED]
On 25 juin, 20:59, antar2 [EMAIL PROTECTED] wrote: Hello, (snip repost of the very same question) I already got one answer for this question, but it did not work For which definition of did not work ? How is your code ? What did you expect, and what did you get ? Sorry to ask these

Re: reading from list with paths

2008-06-25 Thread Lie
On Jun 26, 1:59 am, antar2 [EMAIL PROTECTED] wrote: Hello, I would like to  read and print files, of which the complete filepaths are  mentioned in another textfile. In this textfile (list.txt)  are for  example the following paths:

Re: reading from list with paths

2008-06-25 Thread norseman
antar2 wrote: Hello, I would like to read and print files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are for example the following paths: /data/chorec/chorec-nieuw/s01/S01C001M1/S01C001M1_1LG_f01.TextGrid

Re: reading from list with paths

2008-06-25 Thread MRAB
On Jun 25, 10:00 pm, norseman [EMAIL PROTECTED] wrote: antar2 wrote: Hello, I would like to  read and print files, of which the complete filepaths are  mentioned in another textfile. In this textfile (list.txt)  are for  example the following paths: