RE: data interpolation

2016-11-09 Thread Deborah Swanson
On Thursday, November 03, 2016 3:08 AM, Heli wrote: > I have a question about data interpolation using python. I have a big > ascii file containg data in the following format and around 200M > points. > > id, xcoordinate, ycoordinate, zcoordinate > > then I have a second file containing data

Mergesort problem

2016-12-21 Thread Deborah Swanson
I'm not a beginning python coder, but I'm not an advanced one either. I can't see why I have this problem, though at this point I've probably been looking at it too hard and for too long (several days), so maybe I'm just too close to it. Can one of you guys see the problem (besides my childish codi

RE: Mergesort problem

2016-12-21 Thread Deborah Swanson
> On Thu, Dec 22, 2016 at 11:55 AM, Deborah Swanson > wrote: > > The problem is that while mergeSort puts the list ls in > perfect order, > > which I can see by looking at result on merge's final return to > > mergeSort, and at the left and the right once bac

Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
I've already learned one neat trick to collapse a conditional: a = expression1 if condition else expression2 Here I have a real mess, in my opinion: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st] elif len(l2[st]) == 0: if

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
BartC wrote: > Sent: Friday, December 30, 2016 2:11 PM > > On 30/12/2016 21:20, Deborah Swanson wrote: > > I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > > Here I have a rea

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On Fri, 30 Dec 2016 13:20:15 -0800, "Deborah Swanson" > declaimed the following: > > >I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > >Here I have a rea

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31 December 2016 at 10:00, Deborah Swanson > wrote: > > > > Oops, indentation was messed up when I copied it into the email. > > The indentation of your latest message looks completely > broken now, you can see it here: > https://mail.python.org/pipermai

RE: Re: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30/12/16 23:00, Deborah Swanson wrote: > > Oops, indentation was messed up when I copied it into the email. > > Should be this: > > > > if len(l1[st]) == 0: > > if len(l2[st]) > 0: > > l1[st] = l2

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31/12/16 00:26, Deborah Swanson wrote: > > As Mr. Bieber points out, what I had above greatly benefits > from the > > use of conjunctions. It now reads: > > > > if not len(l1[st]) and len(l2[st]): > > IMHO, "if not len(l)" is a _terrible_ way o

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30Dec2016 15:17, Deborah Swanson wrote: > >>Ever consider using conjunctions? > >> > >>if len(l1[st]) and not len(l2[st]): > >>#0 is considered a false -- no need to test for "==0" > >>#non-0 is conside

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 2016-12-31 00:48, Deborah Swanson wrote: > >> On 30/12/16 23:00, Deborah Swanson wrote: > >> > Oops, indentation was messed up when I copied it into the email. > >> > Should be this: > >> > > >> > if

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
Michael Torrie wrote: > On 12/30/2016 05:26 PM, Deborah Swanson wrote: > > I'm still wondering if these 4 lines can be collapsed to one or two > > lines. > > If the logic is clearly expressed in the if blocks that you > have, I don't see why collapsing an if bl

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Jussi Piitulainen wrote: > Sent: Saturday, December 31, 2016 8:30 AM > Deborah Swanson writes: > > > Is it possible to use some version of the "a = expression1 if > > condition else expression2" syntax with an elif? And for > expression1 > > and expressi

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
> From: Tim Chase > Sent: Saturday, December 31, 2016 12:41 PM > On 2016-12-30 19:59, Deborah Swanson wrote: > > Similar, actually the same as Cameron suggested. I really need to > > revisit testing for empty. I probably rejected it early on for some > > bad r

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Jussi Piitulainen wrote: > Sent: Saturday, December 31, 2016 8:30 AM > Deborah Swanson writes: > > > Is it possible to use some version of the "a = expression1 if > > condition else expression2" syntax with an elif? And for > expression1 > > and expressi

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Peter Otten wrote: > Deborah Swanson wrote: > > > Here I have a real mess, in my opinion: > > [corrected code:] > > > if len(l1[st]) == 0: > > if len(l2[st]) > 0: > > l1[st] = l2[st] > > elif len(

RE: learning and experimenting python.

2016-12-31 Thread Deborah Swanson
Erik wrote: > Yes, my message was to everyone, using a quote from > 'einstein1410' that > I thought demonstrated the point. > > The vast majority of the messages in this thread are from > 'einstein' nd > are short, nonsensical retorts to others who are trying to be > helpful, > that just see

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Chris Angelico wrote: > Sent: Saturday, December 31, 2016 2:19 PM > > On Sun, Jan 1, 2017 at 9:03 AM, Deborah Swanson > wrote: > > And didn't finish it because I couldn't see what a should > be. I want > > it to be l2[v] if the first clause is true, and

RE: Cleaning up conditionals

2016-12-31 Thread Deborah Swanson
Dennis Lee Bieber > Sent: Saturday, December 31, 2016 7:29 PM > > On Sat, 31 Dec 2016 14:35:46 -0800, "Deborah Swanson" > declaimed the following: > > >Here's the function I have so far: > > > >def comprows(l1,l2,st,ki,no): > >ret = &

RE: Cleaning up conditionals

2017-01-01 Thread Deborah Swanson
Sorry guys. I've read all your responses and I kind of get their general drift, but I'm about four sheets to the wind right now, and no way would I make it more than a step or two in playing around with these things and trying to get my head around them before it would all descend into a cacaphony

RE: Cleaning up conditionals

2017-01-01 Thread Deborah Swanson
Steve D'Aprano wrote > Sent: Saturday, December 31, 2016 10:25 PM > > On Sun, 1 Jan 2017 02:58 pm, Deborah Swanson wrote: > > >> It's possible to select either l1 or l2 using an > expression, and then > >> subscript that with [v]. However, this does n

RE: Cleaning up conditionals

2017-01-01 Thread Deborah Swanson
Chris Angelico wrote on Saturday, December 31, 2016 9:39 PM > > On Sun, Jan 1, 2017 at 2:58 PM, Deborah Swanson > wrote: > > I'm not sure I understand what you did here, at least not > well enough > > to try it. > > > > What conditional can I do

RE: Cleaning up conditionals

2017-01-01 Thread Deborah Swanson
ls > Importance: High > > > Deborah Swanson writes: > > > Jussi Piitulainen wrote: > >> Sent: Saturday, December 31, 2016 8:30 AM > >> Deborah Swanson writes: > >> > >> > Is it possible to use some version of the "a = expression1 if &

RE: Cleaning up conditionals

2017-01-01 Thread Deborah Swanson
Dennis Lee Bieber wrote, on Sunday, January 01, 2017 6:07 PM > > On Sun, 1 Jan 2017 15:50:25 -0800, "Deborah Swanson" > declaimed the following: > > >Maybe it would help if I give a couple rows of (made up) > data to show > >what I mean (first row is fi

RE: Unable to Debug

2017-01-02 Thread Deborah Swanson
Aritra Bhattacharjee wrote, on January 02, 2017 1:05 AM: > I am new to python programming. I wrote a code to search for > the product names on a page of snapdeal.com . > > Code: > import urllib.request > from bs4 import BeautifulSoup as BS > > url = > 'https://www.snapdeal.com/products/electron

RE: Cleaning up conditionals

2017-01-02 Thread Deborah Swanson
Jussi Piitulainen wrote, on January 02, 2017 1:44 AM > > Deborah Swanson writes: > > Jussi Piitulainen wrote: > > [snip] > > >> With your particular conditions of non-emptiness, which is > taken to > >> be truth, you can achieve variations of this

RE: Cleaning up conditionals

2017-01-02 Thread Deborah Swanson
Dennis Lee Bieber wrote, on January 02, 2017 8:30 AM: > > On Sun, 1 Jan 2017 18:30:03 -0800, "Deborah Swanson" > declaimed the following: > > >Dennis Lee Bieber wrote, on Sunday, January 01, 2017 6:07 PM > >> > >> > >> l1 2 br, Elk Plain

RE: Cleaning up conditionals

2017-01-02 Thread Deborah Swanson
Dennis Lee Bieber wrote on January 02, 2017 8:30 AM > > On Sun, 1 Jan 2017 18:30:03 -0800, "Deborah Swanson" > declaimed the following: > > Out of curiosity -- don't those listings have street > addresses? There must be lots of "2 br" u

RE: Cleaning up conditionals

2017-01-02 Thread Deborah Swanson
Gregory Ewing wrote, on Monday, January 02, 2017 3:28 PM > > Deborah Swanson wrote: > > flds = len(ls[0]) > > cl, ur, d1, de, lo, st, mi, ki, re, da, br, no, yn, ma, ar = > > range(0,flds) > > You might like to consider converting the row into a > namedtuple, t

RE: Cleaning up conditionals

2017-01-02 Thread Deborah Swanson
Gregory Ewing wrote, on January 02, 2017 7:58 PM > > Deborah Swanson wrote: > > Unless you know of, and are suggesting, a way to index a > sequence with > > strings instead of integers, so the code could remain > untouched with > > string indices when changes to

RE: Cleaning up conditionals

2017-01-03 Thread Deborah Swanson
Chris Angelico wrote, on January 03, 2017 12:14 AM > > On Tue, Jan 3, 2017 at 6:35 PM, Deborah Swanson > wrote: > > I think I'm right that core python sequences can't be > indexed in any > > fashion by strings, because strings aren't iterable. I suppos

RE: Numpy error

2017-01-03 Thread Deborah Swanson
> ImportError: > /home/conrado/Canopy/appdata/canopy-1.5.5.3123.rh5-x86_64/lib/ > libgfortran.so.3: > version `GFORTRAN_1.4' not found (required by /lib64/liblapack.so.3) Looks like you need to install the 'GFORTRAN_1.4' plugin into Canopy. I don't know where you'll find it, but Canopy's main we

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > Hi > > This is simple, but its getting me confused. > > I have a csv writer that opens a file and loops each line of > the file for each file and then closes, writing one file. > > I want to alter the behaviour to be a written file for each

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
> Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > Hi > > > > This is simple, but its getting me confused. > > > > I have a csv writer that opens a file and loops each line of > > the file for each file and then closes, writing one file. > > > > I want to alter the behaviour to be a wri

Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
Excel has a formula: =HYPERLINK(url,description) that will put a clickable link into a cell. Does python have an equivalent function? Probably the most common use for it would be output to the console, similar to a print statement, but clickable. -- https://mail.python.org/mailman/listinfo/pyt

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
> > Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > > > Hi > > > > > > This is simple, but its getting me confused. > > > > > > I have a csv writer that opens a file and loops each line of the > > > file for each file and then closes, writing one file. > > > > > > I want to alter the

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
> > > Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > > > > > Hi > > > > > > > > This is simple, but its getting me confused. > > > > > > > > I have a csv writer that opens a file and loops each line of the > > > > file for each file and then closes, writing one file. > > > > > > > >

RE: Re: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
lain text because your format parameters are %s. Maybe the trick, if there is one, is in a format parameter for urls. On Tue, Jan 3, 2017 at 11:46 AM, Deborah Swanson wrote: Excel has a formula: =HYPERLINK(url,description) that will put a clickable link into a cell. Does python have an

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Terry Reedy > > On 1/3/2017 3:53 PM, Deborah Swanson wrote: > > >> I think you're expecting > >> > >>for file in rootobs > >> > >> to get the next yield for you from rootobs, but unless someone > >> corrects me, I don&#x

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Chris Angelico wrote, on January 03, 2017 2:31 PM > > On Wed, Jan 4, 2017 at 8:19 AM, Deborah Swanson > wrote: > > while True: > > try: > > file = files.next() > > except StopIteration: > > break > > Small side point: Try to avoid c

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
-Original Message- From: Matt Wheeler [mailto:m...@funkyhat.org] Sent: Tuesday, January 03, 2017 1:47 PM To: pyt...@deborahswanson.net; Sayth Renshaw; python-list@python.org Subject: Re: Screwing Up looping in Generator On Tue, 3 Jan 2017 at 20:17 Deborah Swanson wrote: > Wha

RE: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
Grant Edwards wrote, on January 03, 2017 3:13 PM > > On 2017-01-03, Deborah Swanson wrote: > > > I'm sorry, I should have said a GUI console because I > wouldn't expect > > a text-based console to produce clickable links. > > What

RE: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:30 PM > To: python-list@python.org > Subject: Re: Clickable hyperlinks > > Hi. > > On 03/01/17 19:46, Deborah Swanson wrote: > > Excel has a formula: > > When you start a new topic on the list, could you please write a new > m

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:45 PM > > Hi, > > On 03/01/17 22:14, Deborah Swanson wrote: > > ...you have to create the generator object first and use it to call > > the next function. And I really don't think you can use a > generator as > > your ra

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:53 PM > > On 03/01/17 23:05, Deborah Swanson wrote: > > And yes, we usually used for loops for generators, unless you don't > > know when the generator will be exhausted. As in this case, > where the > > number of files the

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Chris Angelico wrote, on January 03, 2017 3:35 PM > > On Wed, Jan 4, 2017 at 10:05 AM, Deborah Swanson > wrote: > > Ok, I learned how to use generators in Python 2.7.8, which may be > > different from Python 3 for generators. But I learned from MIT's > > onli

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 5:36 PM > > So can I call the generator twice and receive the same file > twice in 2 for loops? > > Once to get the files name and the second to process? > > for file in rootobs: > base = os.path.basename(file.name) > write_to = os.pat

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 5:55 PM > > On Wednesday, 4 January 2017 12:36:10 UTC+11, Sayth Renshaw wrote: > > So can I call the generator twice and receive the same file > twice in 2 > > for loops? > > > > Once to get the files name and the second to process? > > > > for file i

RE: Screwing Up looping in Generator

2017-01-03 Thread Deborah Swanson
Erik wrote, on January 03, 2017 5:26 PM > Hi, > > On 04/01/17 01:12, Deborah Swanson wrote: > > The main reason you might want to catch the StopIteration > exception is > > to do something else before your code simply stops running. If all > > you're doing

RE: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
Steve D'Aprano wrote, on January 03, 2017 4:56 PM > On Wed, 4 Jan 2017 10:32 am, Deborah Swanson wrote: > > > > The GUI consoles I have are in Pycharm, the IDLE that comes with > > Anaconda, and Spyder. PyCharm and IDLE both ask for internet access > > when I

RE: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
David wrote, on January 03, 2017 6:36 PM > > On 4 January 2017 at 11:50, Deborah Swanson > wrote: > > Erik wrote, on January 03, 2017 3:30 PM > >> > >> When you start a new topic on the list, could you please > write a new > >> message ra

RE: Clickable hyperlinks

2017-01-03 Thread Deborah Swanson
Steven D'Aprano wrote, on January 03, 2017 8:04 PM > > On Wednesday 04 January 2017 14:04, Deborah Swanson wrote: > > > Steve D'Aprano wrote, on January 03, 2017 4:56 PM > [...] > >> Python can't force the console to treat something as a clickable >

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Michael Torrie wrote, on January 03, 2017 8:05 PM > > On 01/03/2017 08:46 PM, Deborah Swanson wrote: > > Actually it is, or at least it doesn't happen in all email readers. > > Mine, for instance, never breaks up threads. > > Mine doesn't either, which illus

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Steven D'Aprano wrote, on January 03, 2017 9:40 PM > > On Wednesday 04 January 2017 15:46, Deborah Swanson wrote: > > > Steven D'Aprano wrote, on January 03, 2017 8:04 PM > [...] > >> Of course you have to put quotes around them to enter them in your >

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:09 AM > > On Wed, 4 Jan 2017 08:00 pm, Deborah Swanson wrote: > > [speaking of threading emails] > > > I suppose. Times change of course, which always suits some and not > > others. Personally, I think putting messages

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:20 AM > > On Wed, 4 Jan 2017 03:46 pm, Deborah Swanson wrote: > > > As I've mentioned in other posts on this thread, I'm now > thinking that > > I need to write a class to do this, and find out how > Firefo

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:39 AM > > On Wed, 4 Jan 2017 08:32 pm, Deborah Swanson wrote: > > > Thanks, Steven. Yes, of course if you want to print strings > you must > > enclose them in quotes. I think you learn that in Week 1 of any >

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 4:16 AM > > On Wed, Jan 4, 2017 at 10:43 PM, Deborah Swanson > wrote: > > I'm quite well aware by now that there is no one-sentence > answer to my > > original question, if there's any coherent answer at all. > Th

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
gt; On 2017-01-04 04:32 AM, Deborah Swanson wrote: > > But we aren't trying to print strings here, the point is to produce > > clickable links. I didn't enclose them with quotes because I didn't > > see any point in printing plain text when I wanted > clicka

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 4:16 AM > > Yeah, there's no simple answer; however, you'll find that > Python on many platforms is entirely capable of popping a URL > up in the user's default browser. Check this out: > > >>> import antigravity I downloaded the code from the Package

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 3:49 PM > > On Thu, Jan 5, 2017 at 9:58 AM, Deborah Swanson > wrote: > > > > Thank you, thank you! Finally, at least one person on this list knows > > about something (anything) in the python world that is internet aware.

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 8:27 PM > > On Thu, Jan 5, 2017 at 3:19 PM, Deborah Swanson > wrote: > > I downloaded the code from the Package Index, but there really wasn't > > much in it. This is the entire .py file: > > Ehh, wrong file. Try

RE: Clickable hyperlinks

2017-01-04 Thread Deborah Swanson
Terry Reedy wrote, on January 04, 2017 3:58 PM > > On 1/4/2017 4:32 AM, Deborah Swanson wrote: > > > My original question was whether python had anything to provide this > > functionality, and the answer appears to be a resounding NO!!! > > I would say 'Yes, but

RE: Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
Terry Reedy wrote, on January 04, 2017 10:18 PM > > On 1/5/2017 12:11 AM, Deborah Swanson wrote: > > Terry Reedy wrote, on January 04, 2017 3:58 PM > > >> To have a string interpreted as a clickable link, you send the string to > >> software capable of cr

RE: Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
Rhodri James wrote, on January 05, 2017 3:53 AM > > On 05/01/17 04:52, Deborah Swanson wrote: > > My original question was in fact whether there was a way to make > > clickable hyperlinks in a console. I was persuaded after about 10 > > replies that the answer wa

RE: Numpy error

2017-01-05 Thread Deborah Swanson
> ImportError: > /home/conrado/Canopy/appdata/canopy-1.5.5.3123.rh5-x86_64/lib/ > libgfortran.so.3: > version `GFORTRAN_1.4' not found (required by /lib64/liblapack.so.3) Looks like you need to install the 'GFORTRAN_1.4' plugin into Canopy. I don't know where you'll find it, but Canopy's main web

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
> Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > Hi > > > > This is simple, but its getting me confused. > > > > I have a csv writer that opens a file and loops each line of > > the file for each file and then closes, writing one file. > > > > I want to alter the behaviour to be a written

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
> > Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > > > Hi > > > > > > This is simple, but its getting me confused. > > > > > > I have a csv writer that opens a file and loops each line of the > > > file for each file and then closes, writing one file. > > > > > > I want to alter the behav

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > Hi > > This is simple, but its getting me confused. > > I have a csv writer that opens a file and loops each line of > the file for each file and then closes, writing one file. > > I want to alter the behaviour to be a written file for each > inp

Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
Excel has a formula: =HYPERLINK(url,description) that will put a clickable link into a cell. Does python have an equivalent function? Probably the most common use for it would be output to the console, similar to a print statement, but clickable. -- https://mail.python.org/mailman/listinfo/py

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
> > > Sayth Renshaw wrote, on January 03, 2017 6:54 AM > > > > > > > > Hi > > > > > > > > This is simple, but its getting me confused. > > > > > > > > I have a csv writer that opens a file and loops each line of the > > > > file for each file and then closes, writing one file. > > > > > > > > I wa

RE: Re: Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
plain text because your format parameters are %s. Maybe the trick, if there is one, is in a format parameter for urls. On Tue, Jan 3, 2017 at 11:46 AM, Deborah Swanson wrote: Excel has a formula: =HYPERLINK(url,description) that will put a clickable link into a cell. Does python have an

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
Terry Reedy > > On 1/3/2017 3:53 PM, Deborah Swanson wrote: > > >> I think you're expecting > >> > >>for file in rootobs > >> > >> to get the next yield for you from rootobs, but unless someone > >> corrects me, I don't t

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
Chris Angelico wrote, on January 03, 2017 2:31 PM > > On Wed, Jan 4, 2017 at 8:19 AM, Deborah Swanson > wrote: > > while True: > > try: > > file = files.next() > > except StopIteration: > > break > > Small side point: Try to avoid calling a

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
-Original Message- From: Matt Wheeler [mailto:m...@funkyhat.org] Sent: Tuesday, January 03, 2017 1:47 PM To: pyt...@deborahswanson.net; Sayth Renshaw; python-list@python.org Subject: Re: Screwing Up looping in Generator On Tue, 3 Jan 2017 at 20:17 Deborah Swanson wrote: > What&#x

RE: Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
Grant Edwards wrote, on January 03, 2017 3:13 PM > > On 2017-01-03, Deborah Swanson wrote: > > > I'm sorry, I should have said a GUI console because I > wouldn't expect > > a text-based console to produce clickable links. > > What&#

RE: Screwing Up looping in Generator

2017-01-05 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:45 PM > > Hi, > > On 03/01/17 22:14, Deborah Swanson wrote: > > ...you have to create the generator object first and use it to call > > the next function. And I really don't think you can use a > generator as > > your range i

RE: Clickable hyperlinks

2017-01-05 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:30 PM > To: python-list@python.org > Subject: Re: Clickable hyperlinks > > Hi. > > On 03/01/17 19:46, Deborah Swanson wrote: > > Excel has a formula: > > When you start a new topic on the list, could you please write a new > m

RE: Screwing Up looping in Generator

2017-01-06 Thread Deborah Swanson
Erik wrote, on January 03, 2017 3:53 PM > > On 03/01/17 23:05, Deborah Swanson wrote: > > And yes, we usually used for loops for generators, unless you don't > > know when the generator will be exhausted. As in this case, > where the > > number of files the genera

RE: Screwing Up looping in Generator

2017-01-06 Thread Deborah Swanson
Chris Angelico wrote, on January 03, 2017 3:35 PM > > On Wed, Jan 4, 2017 at 10:05 AM, Deborah Swanson > wrote: > > Ok, I learned how to use generators in Python 2.7.8, which may be > > different from Python 3 for generators. But I learned from MIT's > > online in

RE: Screwing Up looping in Generator

2017-01-06 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 5:55 PM > > On Wednesday, 4 January 2017 12:36:10 UTC+11, Sayth Renshaw wrote: > > So can I call the generator twice and receive the same file > twice in 2 > > for loops? > > > > Once to get the files name and the second to process? > > > > for file in roo

RE: Screwing Up looping in Generator

2017-01-06 Thread Deborah Swanson
Sayth Renshaw wrote, on January 03, 2017 5:36 PM > > So can I call the generator twice and receive the same file > twice in 2 for loops? > > Once to get the files name and the second to process? > > for file in rootobs: > base = os.path.basename(file.name) > write_to = os.path.join

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
David wrote, on January 03, 2017 6:36 PM > > On 4 January 2017 at 11:50, Deborah Swanson > wrote: > > Erik wrote, on January 03, 2017 3:30 PM > >> > >> When you start a new topic on the list, could you please > write a new > >> message rather than r

RE: Screwing Up looping in Generator

2017-01-06 Thread Deborah Swanson
Erik wrote, on January 03, 2017 5:26 PM > Hi, > > On 04/01/17 01:12, Deborah Swanson wrote: > > The main reason you might want to catch the StopIteration > exception is > > to do something else before your code simply stops running. If all > > you're doing is

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steve D'Aprano wrote, on January 03, 2017 4:56 PM > On Wed, 4 Jan 2017 10:32 am, Deborah Swanson wrote: > > > > The GUI consoles I have are in Pycharm, the IDLE that comes with > > Anaconda, and Spyder. PyCharm and IDLE both ask for internet access > > when I

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Michael Torrie wrote, on January 03, 2017 8:05 PM > > On 01/03/2017 08:46 PM, Deborah Swanson wrote: > > Actually it is, or at least it doesn't happen in all email readers. > > Mine, for instance, never breaks up threads. > > Mine doesn't either, which illustra

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:09 AM > > On Wed, 4 Jan 2017 08:00 pm, Deborah Swanson wrote: > > [speaking of threading emails] > > > I suppose. Times change of course, which always suits some and not > > others. Personally, I think putting messages th

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steven D'Aprano wrote, on January 03, 2017 8:04 PM > > On Wednesday 04 January 2017 14:04, Deborah Swanson wrote: > > > Steve D'Aprano wrote, on January 03, 2017 4:56 PM > [...] > >> Python can't force the console to treat something as a clickable >

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steven D'Aprano wrote, on January 03, 2017 9:40 PM > > On Wednesday 04 January 2017 15:46, Deborah Swanson wrote: > > > Steven D'Aprano wrote, on January 03, 2017 8:04 PM > [...] > >> Of course you have to put quotes around them to enter them in your > >

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:20 AM > > On Wed, 4 Jan 2017 03:46 pm, Deborah Swanson wrote: > > > As I've mentioned in other posts on this thread, I'm now > thinking that > > I need to write a class to do this, and find out how > Firefox

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Steve D'Aprano wrote, on January 04, 2017 2:39 AM > > On Wed, 4 Jan 2017 08:32 pm, Deborah Swanson wrote: > > > Thanks, Steven. Yes, of course if you want to print strings > you must > > enclose them in quotes. I think you learn that in Week 1 of any > > introdu

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
gt; On 2017-01-04 04:32 AM, Deborah Swanson wrote: > > But we aren't trying to print strings here, the point is to produce > > clickable links. I didn't enclose them with quotes because I didn't > > see any point in printing plain text when I wanted > click

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 4:16 AM > > On Wed, Jan 4, 2017 at 10:43 PM, Deborah Swanson > wrote: > > I'm quite well aware by now that there is no one-sentence > answer to my > > original question, if there's any coherent answer at all. > Them&#

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Chris Angelico wrote, on January 04, 2017 4:16 AM > > Yeah, there's no simple answer; however, you'll find that > Python on many platforms is entirely capable of popping a URL > up in the user's default browser. Check this out: > > >>> import antigravity I downloaded the code from the Package Inde

RE: Python for WEB-page !?

2017-01-06 Thread Deborah Swanson
Ionut Predoiu wrote, on January 05, 2017 11:07 PM > > Good morning, > > Thanks to all for feedback and advice. > Because I am a beginner I will read more about versions of > Python recommended by you. > > On the other side I am interested to know if exist some sites > which have develop platfo

RE: Receiving a lot of double messages.

2017-01-06 Thread Deborah Swanson
Antoon Pardon wrote, on January 06, 2017 2:11 AM > > Is there something going on with the mailinglist? Because I > have receive a lot of double messages. One copy is fairly > normal and is part of the discussion thread, the other is > completely seperated. -- Antoon Pardon. Looks to me like th

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Terry Reedy wrote, on January 04, 2017 10:18 PM > > On 1/5/2017 12:11 AM, Deborah Swanson wrote: > > Terry Reedy wrote, on January 04, 2017 3:58 PM > > >> To have a string interpreted as a clickable link, you send the string to > >> software capable of cr

RE: Clickable hyperlinks

2017-01-06 Thread Deborah Swanson
Rhodri James wrote, on January 05, 2017 3:53 AM > > On 05/01/17 04:52, Deborah Swanson wrote: > > My original question was in fact whether there was a way to make > > clickable hyperlinks in a console. I was persuaded after about 10 > > replies that the answer was no, >

RE: Python for WEB-page !?

2017-01-06 Thread Deborah Swanson
Ionut Predoiu wrote, on January 05, 2017 11:07 PM > > Good morning, > > Thanks to all for feedback and advice. > Because I am a beginner I will read more about versions of > Python recommended by you. > > On the other side I am interested to know if exist some sites > which have develop platform wh

RE: Receiving a lot of double messages.

2017-01-06 Thread Deborah Swanson
Antoon Pardon wrote, on January 06, 2017 2:11 AM > > Is there something going on with the mailinglist? Because I > have receive a lot of double messages. One copy is fairly > normal and is part of the discussion thread, the other is > completely seperated. -- Antoon Pardon. Looks to me like the ma

  1   2   3   >