Re: What's an elegant way to test for list index existing?

2018-09-28 Thread Ben Finney
Chris Green writes: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. Because of what an index means for the 'list' type, that's equivalent to saying "the result of `len(fld)` may be 3, 4, or 5". > What's the neatest

Re: Which class method is being called when we declare below expression?

2018-09-28 Thread Ben Finney
Ben Finney writes: > Ajay Patel writes: > > > L = [1,2,3] > > That's not an expression; it is an assignment statement. > > The right-hand side is an expression. […] in this case, [the object] a new > instance of 'list' […] is the result of evaluating the right-hand side > of the expression. I g

What's an elegant way to test for list index existing?

2018-09-28 Thread Chris Green
I have a list created by:- fld = shlex.split(ln) It may contain 3, 4 or 5 entries according to data read into ln. What's the neatest way of setting the fourth and fifth entries to an empty string if they don't (yet) exist? Using 'if len(fld) < 4:' feels clumsy somehow. -- Chris Green · --

Re: What's an elegant way to test for list index existing?

2018-09-28 Thread jladasky
On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. > What's the neatest way of setting the fourth and fifth entries to an > empty string if they don'

Re: JPEGImage() hangs

2018-09-28 Thread Cameron Simpson
On 28Sep2018 20:12, Chris Green wrote: Peter Pearson wrote: On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote: > Chris Green wrote: >> Brian Oney wrote: >> > Could you please try another tool like `convert'? E.g. >> > >> > $ convert 102_PANA/P1020466.JPG test.png >> > >> > What does tha

Re: Anaconda with Python 3.7

2018-09-28 Thread Russell Owen
On Sep 3, 2018, gvim wrote (in article <5b8d0122.1030...@gmail.com>): > Anyone have any idea when Anaconda might ship a version compatible with > Python 3.7. I sent them 2 emails but no reply. I heard a rumor today that it will be a few more months. They are short on resources and are also deali

Re: JPEGImage() hangs

2018-09-28 Thread Chris Green
Peter Pearson wrote: > On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote: > > Chris Green wrote: > >> Brian Oney wrote: > >> > Could you please try another tool like `convert'? E.g. > >> > > >> > $ convert 102_PANA/P1020466.JPG test.png > >> > > >> > > >> > What does that say? > >> > >>

Re: JPEGImage() hangs

2018-09-28 Thread Peter Pearson
On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote: > Chris Green wrote: >> Brian Oney wrote: >> > Could you please try another tool like `convert'? E.g. >> > >> > $ convert 102_PANA/P1020466.JPG test.png >> > >> > >> > What does that say? >> >> Well, after having returned home with the l

Re: I am not able to run Python in Powershell

2018-09-28 Thread praveenjain04121997
On Friday, 1 September 2017 19:37:41 UTC+1, The Cat Gamer wrote: > fter I installed Python I try to open it in Powershell, by typing > python/python.exe. > It gives me an error: > python : The term 'python' is not recognized as the name of a cmdlet, > function, script file, or operable program. Ch

EuroPython 2019: RFP for Venues

2018-09-28 Thread M.-A. Lemburg
Dear EuroPython'istas, We are happy to announce that we have started the RFP for venues to host the EuroPython 2019 conference. We have sent out the details to almost 40 venues. For more details about the RFP, please see our blog post: https://www.europython-society.org/post/178541594370/europy

Re: JPEGImage() hangs

2018-09-28 Thread Chris Green
Chris Green wrote: > Brian Oney wrote: > > Could you please try another tool like `convert'? E.g. > > > > $ convert 102_PANA/P1020466.JPG test.png > > > > > > What does that say? > > Well, after having returned home with the laptop where this was > failing and doing exactly the same thing aga

Re: JPEGImage() hangs

2018-09-28 Thread Chris Green
Brian Oney wrote: > Could you please try another tool like `convert'? E.g. > > $ convert 102_PANA/P1020466.JPG test.png > > > What does that say? Well, after having returned home with the laptop where this was failing and doing exactly the same thing again, it now works. However it did take s

Re: What's needed for jpegtran in Python 3?

2018-09-28 Thread Chris Green
Chris Angelico wrote: > On Fri, Sep 28, 2018 at 3:51 AM Chris Green wrote: > > > > Chris Angelico wrote: > > > On Fri, Sep 28, 2018 at 2:51 AM Chris Green wrote: > > > > > > > > I'm converting an existing Python2 program to Python3, it uses > > > > jpegtran and I can't find what to install to g

cx_Freeze window app path question

2018-09-28 Thread Grant Edwards
[I tried without success to post this question to the cx_Freeze mailing list (which seems to have suddenly died at the beginning of the year).] You freeze an app on Windows producing a 'build' directory. The contents of that build directory get installed in some arbitrary location. When you run

Re: How to change '\\' to '\'

2018-09-28 Thread Jach Fong
Yes, you are right, it's just the way Python display the '\'. Thank you. Gregory Ewing at 2018/9/28 PM 02:02 wrote: Jach Fong wrote: I get a string item, for example path[0], from path = os.get_exec_path() It's something like "\\Borland\\Bcc55\\Include" It doesn't actually have double backsla