Re: pattern

2018-06-14 Thread Cameron Simpson
On 14Jun2018 20:01, Sharan Basappa wrote: >Can anyone explain to me the purpose of "pattern" in the line below: > >documents.append((w, pattern['class'])) > >documents is declared as a list as follows: >documents.append((w, pattern['class'])) Not without a lot more context. Where did you find t

Re: pattern

2018-06-14 Thread Sharan Basappa
> >Can anyone explain to me the purpose of "pattern" in the line below: > > > >documents.append((w, pattern['class'])) > > > >documents is declared as a list as follows: > >documents.append((w, pattern['class'])) > > Not without a lot more context. Where did you find this code? > > Cheers, I am

Re: mutable sequences

2018-06-14 Thread Sharan Basappa
Thanks, All, for the responses. -- https://mail.python.org/mailman/listinfo/python-list

Re: How can I verify if the regex exist in a file without reading ?

2018-06-14 Thread Cameron Simpson
On 15Jun2018 00:24, Steven D'Aprano wrote: On Fri, 15 Jun 2018 10:00:59 +1000, Cameron Simpson wrote: Francois, unless your regex can cross multiple lines it is better to search files like this: with open(the_filename) as f: for line in f: ... search the line for the regexp ... T

Re: How can I verify if the regex exist in a file without reading ?

2018-06-14 Thread Steven D'Aprano
On Fri, 15 Jun 2018 10:00:59 +1000, Cameron Simpson wrote: > Francois, unless your regex can cross multiple lines it is better to > search files like this: > > with open(the_filename) as f: > for line in f: > ... search the line for the regexp ... > > That way you only need to keep o

Re: How to apply filters to posts

2018-06-14 Thread Cameron Simpson
On 14Jun2018 19:42, Dennis Lee Bieber wrote: On Fri, 15 Jun 2018 05:39:08 +1000, Ben Finney declaimed the following: Don't choose the daily digest, because it makes a special “digest” message for you each day. That message is disconnected from any other message, and so you will not be able to

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
Dennis Lee Bieber writes: > On Fri, 15 Jun 2018 05:39:08 +1000, Ben Finney > declaimed the following: > > >Don't choose the daily digest, because it makes a special “digest” > >message for you each day. That message is disconnected from any other > >message, and so you will not be able to reply

Re: How can I verify if the regex exist in a file without reading ?

2018-06-14 Thread Cameron Simpson
On 14Jun2018 16:54, Steven D'Aprano wrote: On Thu, 14 Jun 2018 09:26:44 -0700, francois.rabanel wrote: My problem is, if I work on a huge file, I'll try to avoid to read the file because it will be crash my computer :) How does reading a file crash your computer? Likely because he tried to

Re: Flask not responding after installation

2018-06-14 Thread Sivan Greenberg
How did you install flask? Can you paste the content of your flask app .py file? -Sivan On Fri, 15 Jun 2018 12:15 am Tamara Berger, wrote: > It seems I can’t progress a single step without encountering a wall. > I’m trying to build a webapp with flask. I installed flask. I followed > the workbo

Re: How to apply filters to posts

2018-06-14 Thread Cameron Simpson
On 14Jun2018 09:23, Tamara Berger wrote: Thanks, Rhodri. One more question. What is a daily digest? I'm wondering whether to choose that option. Please don't use the digest mode. They're a terrible way to read lists, and an even worse way to participate - your replies will never be correctly

Re: How to apply filters to posts

2018-06-14 Thread Mark Lawrence
On 14/06/18 17:23, T Berger wrote: On Thursday, June 14, 2018 at 11:26:00 AM UTC-4, Rhodri James wrote: On 14/06/18 16:00, T Berger wrote: On Thursday, June 14, 2018 at 8:02:44 AM UTC-4, Chris Angelico wrote: They're connected. "Subscribe to the list" makes you a member of the mailing list (a

Flask not responding after installation

2018-06-14 Thread Tamara Berger
It seems I can’t progress a single step without encountering a wall. I’m trying to build a webapp with flask. I installed flask. I followed the workbook-provided prompts, which should have resulted in a flask confirmation. Nothing happened. Any ideas what’s gone wrong: Last login: Thu Jun 14 13:31

Re: How to apply filters to posts

2018-06-14 Thread T Berger
On Thursday, June 14, 2018 at 3:39:44 PM UTC-4, Ben Finney wrote: > T Berger writes: > > > Thanks, Rhodri. One more question. What is a daily digest? I'm > > wondering whether to choose that option. > > Don't choose the daily digest, because it makes a special “digest” > message for you each day

Re: mutable sequences

2018-06-14 Thread Ben Finney
Larry Martell writes: > A string and a list go into a bar. The string asks for a cup of > coffee. The bartender says "We don't have coffee." The string asks for > a cup of coffee. The bartender says "I told you we don't have coffee." > The string asks for a cup of coffee. The bartender says to th

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
T Berger writes: > Thanks, Rhodri. One more question. What is a daily digest? I'm > wondering whether to choose that option. Don't choose the daily digest, because it makes a special “digest” message for you each day. That message is disconnected from any other message, and so you will not be ab

Re: Django-hotsauce 1.0 LTS (Commercial Edition) now available for preorder!!

2018-06-14 Thread Jim Lee
On 06/13/2018 11:38 PM, Chris Angelico wrote: On Thu, Jun 14, 2018 at 11:07 AM, Jim Lee wrote: I haven't purchased commercial software in decades, so I'm not up on the prevailing business model, but I have to ask: Why would anyone purchase software and then agree to wait 14 weeks for it to b

Re: How can I verify if the regex exist in a file without reading ?

2018-06-14 Thread Steven D'Aprano
On Thu, 14 Jun 2018 09:26:44 -0700, francois.rabanel wrote: > Hi, > > Here is my script : > > It propose to replace some words in a file with a regular expression. It > create a copy to write on it, and if there isn't an error, it delete the > original by the copy with "os.rename" at the end. >

How can I verify if the regex exist in a file without reading ?

2018-06-14 Thread francois . rabanel
Hi, Here is my script : It propose to replace some words in a file with a regular expression. It create a copy to write on it, and if there isn't an error, it delete the original by the copy with "os.rename" at the end. My problem is, if I work on a huge file, I'll try to avoid to read the file

Re: How to apply filters to posts

2018-06-14 Thread T Berger
On Thursday, June 14, 2018 at 11:26:00 AM UTC-4, Rhodri James wrote: > On 14/06/18 16:00, T Berger wrote: > > On Thursday, June 14, 2018 at 8:02:44 AM UTC-4, Chris Angelico wrote: > > > >> They're connected. "Subscribe to the list" makes you a member of the > >> mailing list (and thus you will sta

Re: How to apply filters to posts

2018-06-14 Thread Rhodri James
On 14/06/18 16:00, T Berger wrote: On Thursday, June 14, 2018 at 8:02:44 AM UTC-4, Chris Angelico wrote: They're connected. "Subscribe to the list" makes you a member of the mailing list (and thus you will start receiving posts), which also entitles you to send to the list. Sending email to tha

Re: How to apply filters to posts

2018-06-14 Thread T Berger
On Thursday, June 14, 2018 at 8:02:44 AM UTC-4, Chris Angelico wrote: > They're connected. "Subscribe to the list" makes you a member of the > mailing list (and thus you will start receiving posts), which also > entitles you to send to the list. Sending email to that address will > send it to the

Re: Stefan's headers [was:Names and identifiers]

2018-06-14 Thread Mark Lawrence
On 08/06/18 18:34, Marko Rauhamaa wrote: PS IMO copyright laws should be abolished altogether. At the very least one should pay for copyright protection. One €1 for the first year, €2 for the second, €4 for the third and so on exponentially. Thoughts on the proposed new EU copyright laws are

Re: mutable sequences

2018-06-14 Thread Larry Martell
On Wed, Jun 13, 2018 at 10:56 PM, Sharan Basappa wrote: > The term mutable appears quite often in Python. > Can anyone explain what is meant by mutable and immutable sequences. A string and a list go into a bar. The string asks for a cup of coffee. The bartender says "We don't have coffee." The s

RE: mutable sequences

2018-06-14 Thread Schachner, Joseph
No, it says lists are mutable and tuples are immutable. Mutable has the same root as "mutation". Mutable means "can be changed in place". Immutable means "cannot be changed in place". Examples: 1) pass your list to a function, the function modifies the list. When the function returns your

How to delete a branch permanently in mercurial/bitbucket?

2018-06-14 Thread Etienne Robillard
Hi, I need to delete a branch in mercurial in order to move it into a private repository. I have heard of the "hg strip" method but Bitbucket is warning me that this operation will affect branches I would prefer keeping... So I just have no idea right now how to prune this specific branch ou

Re: How to apply filters to posts

2018-06-14 Thread Chris Angelico
On Thu, Jun 14, 2018 at 3:47 PM, T Berger wrote: > On Tuesday, April 10, 2018 at 1:21:53 AM UTC-4, Chris Angelico wrote: > >> I recommend, instead, joining the mailing list: >> >> https://mail.python.org/mailman/listinfo/python-list > > There seem to be two options on the Python-list Information P

Re: Design of my program

2018-06-14 Thread ftg
Thanks for your answer. The term "picture" was more a metaphor ;) I am not sure I want to dive into ORM, since I am newbie, maybe I want to code something more from scratch to understand well program designing. What would be the best way: - create 2 classes, one that deals with web scraping, the

Re: Design of my project

2018-06-14 Thread ftg
Hello, thanks for this nice answer I didn't see at first (I have parallely asked again in the list, sorry about the inconvenience). I will read deeply your proposal I will come bakc with my quesitons if any ;) Thanks! June 14 2018 12:37 AM, "Cameron Simpson" wrote: > On 13Jun2018 15:23, Fabien

Re: pattern

2018-06-14 Thread Cameron Simpson
On 13Jun2018 19:51, Sharan Basappa wrote: Can anyone explain to me the purpose of "pattern" in the line below: documents.append((w, pattern['class'])) documents is declared as a list as follows: documents.append((w, pattern['class'])) Not without a lot more context. Where did you find this c

Re: pep8 Re: Posting warning message

2018-06-14 Thread Cameron Simpson
On 14Jun2018 02:35, Tamara Berger wrote: On Thu, Jun 14, 2018 at 1:49 AM Cameron Simpson wrote: Just as you can run your code before you install it, you can lint your code beforehand also. In fact, you should be doing both: run and test the code _before_ installing it, and also lint it (when y

Re: PEP8 compliance

2018-06-14 Thread Gregory Ewing
Chris Angelico wrote: ... and THIS RIGHT HERE is why the tool should not be called "pep8". Didn't this exact discussion come up and the tool got renamed? Seems it's been renamed to pycodestyle, but there's still an old project called pep8 on pypi.org. I guess there's always going to be some con