Re: Sharing code between different projects?

2017-09-27 Thread dieter
> On Monday, August 13, 2012 at 7:53:32 PM UTC+3, andrea crotti wrote: >> I am in the situation where I am working on different projects that >> might potentially share a lot of code. >> >> I started to work on project A, then switched completely to project B >> and in the transiction I copied ove

Re: Spacing conventions

2017-09-27 Thread Bill
Steve D'Aprano wrote: Similarly for break and continue. I can still see their use causing potential trouble in (really-long) real-world code. How so? Besides, if your code is "really long", you probably should factorise it into smaller, meaningful chunks. I worked in maintenance programm

Re: Spacing conventions

2017-09-27 Thread Steve D'Aprano
On Wed, 27 Sep 2017 05:50 pm, Bill wrote: [...] > If you are teaching beginning students, do you expect them to try to > follow these sorts of conventions? Yes, but not to the point of being a dick about it. It is better to learn good habits first, rather than to learn bad habits then unlearn the

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread Dan Sommers
On Wed, 27 Sep 2017 12:41:24 -0400, leam hall wrote: > The question is, what should a person "know" when hiring out as a > programmer? What is 'know" and what should be "known"? Specifically > with Python. The longer I claim to be a programmer, the more I discover how wide a net that is. Web sit

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread Chris Angelico
On Thu, Sep 28, 2017 at 11:18 AM, Larry Hudson via Python-list wrote: > > It had turned out his company had paid for him to take the course. Since he > failed, it suddenly came to the attention of his employer that he didn't > know how to program, and now his job was in jeopardy. As I hung up the

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread Larry Hudson via Python-list
On 09/27/2017 09:41 AM, leam hall wrote: On Sat, Sep 23, 2017 at 5:26 PM, Ned Batchelder wrote: [snip] The question is, what should a person "know" when hiring out as a programmer? What is 'know" and what should be "known"? Specifically with Python. Hopefully NOT like this person... (Sourc

Re: Real Programmers Write Docs

2017-09-27 Thread Ned Batchelder
On 9/27/17 6:55 PM, Rob Gaddi wrote: Anyone have any good references on using Sphinx to generate a mix of autogenerated API docs and hand-written "Yeah, but this is what you DO with it" docs?  Free is good but I'm happy to drop money on books if they're worthwhile. I can offer you an exampl

Real Programmers Write Docs

2017-09-27 Thread Rob Gaddi
Anyone have any good references on using Sphinx to generate a mix of autogenerated API docs and hand-written "Yeah, but this is what you DO with it" docs? Free is good but I'm happy to drop money on books if they're worthwhile. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com E

Re: None is None but not working

2017-09-27 Thread Gary Herron
On 09/27/2017 01:05 PM, Sayth Renshaw wrote: Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'Race

Re: None is None but not working

2017-09-27 Thread Ben Finney
Sayth Renshaw writes: > When I call data = r.json() it says its type is None if it is not > successful so I thought it easier to check that. Can you show the interactive session where you do that check? >>> data = r.json() >>> data is None True That's what I understand your stateme

Re: None is None but not working

2017-09-27 Thread Daniele Forghieri
Il 27/09/2017 22:05, Sayth Renshaw ha scritto: Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'Ra

None is None but not working

2017-09-27 Thread Sayth Renshaw
Hi I have got a successful script setup to rotate through dates and download json data from the url. As the api returns 200 whether successful I want to check if the file returned is not successful. when a file doesn't exist the api returns {'RaceDay': None, 'ErrorInfo': {'SystemId': 200, 'Err

Re: Spacing conventions

2017-09-27 Thread Bill
Thank you for all of the feedback provided! It was just what I was looking for. : ) I'm going to go back and read some of the links more carefully. Bill -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 14:48 Peter Otten <__pete...@web.de> wrote: > > Reproducing the original string exactly the best I've managed is 260: > > That's a bit long, don't you think, as it can be beaten even by plain old > zipping: > ha! tbh yes It's longer than I was expecting to manage. $ cat bo

Re: auto installing dependencies with pip to run a python zip application ?

2017-09-27 Thread Irmen de Jong
On 09/27/2017 09:50 AM, Paul Moore wrote: >>> What you could do is pip install your binary dependencies into a >>> directory in $TEMP using --target, then add that directory to >>> sys.path. Probably easier than building a full virtualenv. Bundle pip >>> with your app if you can't assume your user

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 16:38, Matt Wheeler wrote: > On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > >>> Reproducing the original string exactly the best I've managed is 260: >>> >>> t,f,a,o,n='True','False','and','or','not' >> >> The Not is capitalized in the original string. >> > > I guess you didn

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread Larry Martell
On Wed, Sep 27, 2017 at 12:41 PM, leam hall wrote: > The question is, what should a person "know" when hiring out as a > programmer? What is 'know" and what should be "known"? Specifically with > Python. Fake it till you make it! -- https://mail.python.org/mailman/listinfo/python-list

Re: Beginners and experts (Batchelder blog post)

2017-09-27 Thread leam hall
On Sat, Sep 23, 2017 at 5:26 PM, Ned Batchelder wrote: > On 9/23/17 2:52 PM, Leam Hall wrote: > >> On 09/23/2017 02:40 PM, Terry Reedy wrote: >> >>> https://nedbatchelder.com//blog/201709/beginners_and_experts.html >>> >>> Great post. >>> >> >> Yup. Thanks for the link. I often have that "I bet >

Re: Pyhton

2017-09-27 Thread Irving Duran
Besides being easy to learn and develop, there is a large number of dev supporters. Which it makes it more compelling. Thank You, Irving Duran On Wed, Sep 27, 2017 at 9:27 AM, wrote: > On Wednesday, September 27, 2017 at 3:10:30 PM UTC+1, darwi...@gmail.com > wrote: > > Whats the reason that

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > > Reproducing the original string exactly the best I've managed is 260: > > > > t,f,a,o,n='True','False','and','or','not' > > The Not is capitalized in the original string. > I guess you didn't try it? (or see `upper()` in the body of the `for

Re: Pyhton

2017-09-27 Thread breamoreboy
On Wednesday, September 27, 2017 at 3:10:30 PM UTC+1, darwi...@gmail.com wrote: > Whats the reason that python is growing fast? It would be growing faster but it is only the second best language in the world. Please see https://mail.python.org/pipermail/python-list/2002-November/141486.html --

Pyhton

2017-09-27 Thread darwinbin19
Whats the reason that python is growing fast? -- https://mail.python.org/mailman/listinfo/python-list

Re: Sharing code between different projects?

2017-09-27 Thread yoni
On Monday, August 13, 2012 at 7:53:32 PM UTC+3, andrea crotti wrote: > I am in the situation where I am working on different projects that > might potentially share a lot of code. > > I started to work on project A, then switched completely to project B > and in the transiction I copied over a lot

Re: Even Older Man Yells At Whippersnappers

2017-09-27 Thread Robin Becker
On 20/09/2017 10:54, Chris Angelico wrote: What, you take silicon that someone else created?! ChrisA well I had germanium for flipflops and dekatron tubes with neon for counters never built anything digital with valves though -- Robin Becker -- https://mail.python.org/mailman/listi

Re: Printing a Chunk Of Words

2017-09-27 Thread Peter Otten
Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >> > Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list.append >> for b in

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 13:51, Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >>> Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list

Re: Spacing conventions

2017-09-27 Thread Christopher Reimer
On Sep 27, 2017, at 12:50 AM, Bill wrote: > > Ever since I download the MyCharm IDE a few days ago, I've been noticing all > sort of "spacing conventions (from PEP) that are suggested. How do folks > regard these in general? > > For instance, the conventions suggest that > > if x>y : >

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
With deepest apologies to all involved... On Tue, 26 Sep 2017 at 08:42 Gregory Ewing wrote: > Ben Bacarisse wrote: > > Think functional! This is 257 characters: > > 250 chars, 17 shorter than the text it produces: > > a=[];o=[];n=[];A=list.append > for b in range(3,-1,-1): > x=bool(b>>1);y=bo

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread ROGER GRAYDON CHRISTMAN
On Tue, Sep 26, 2017 11:00 PM, Steve D'Aprano wrote: > The critical distinction here is whether the names refer to each other: > >a <---> b > >or whether they merely refer to the same value: > >a ---> [ value ] <--- b > > >Python uses the second model. Var parameters in Pascal and references in C

Re: Spacing conventions

2017-09-27 Thread Peter Otten
Bill wrote: > Ever since I download the MyCharm IDE a few days ago, I've been noticing > all sort of "spacing conventions (from PEP) that are suggested. How do > folks regard these in general? > > For instance, the conventions suggest that > > if x>y : > pass > > should be written > if

Re: Boolean Expressions

2017-09-27 Thread Cai Gengyang
On Wednesday, September 27, 2017 at 1:01:50 PM UTC+8, Cameron Simpson wrote: > On 26Sep2017 20:55, Cai Gengyang wrote: > >On Wednesday, September 27, 2017 at 6:45:00 AM UTC+8, Cameron Simpson wrote: > >> On 26Sep2017 14:43, Cai Gengyang wrote: > >> >C) Set bool_three equal to the result of > >> >

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 09:38 schreef Steven D'Aprano: No, the model that C++ and Pascal use is not different in this aspect. > that Pascal var parameters and C++ reference variables operate the same > way as Python variable assignment, the *kindest* thing I can say is that > you are ignorant. The kind

Re: Parentheses (as after "print")

2017-09-27 Thread Thomas Jollans
On 26/09/17 17:56, Stefan Ram wrote: > What happened? I woke up today in parens mood. So I typed: > > import( operator ) > > Python told me that I should type: > > import operator This is an interesting case: >>> import (os, sys) File "", line 1 import (os, sys) ^ SyntaxError

Re: Spacing conventions

2017-09-27 Thread Tim Golden
On 27/09/17 09:50, Bill wrote: If you are teaching beginning students, do you expect them to try to follow these sorts of conventions? Is it perfectly fine to let "taste" guide you (I'm just trying to get a feel for the philosophy here)? I few years ago I wrote a few short blog posts about

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 10:11 schreef Chris Angelico: > On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano > wrote: >> Twice you have claimed to be able to write such a swap procedure for >> lists. You can't. If you think you can, it is only because you have >> misunderstood the problem and are writing somet

Re: Spacing conventions

2017-09-27 Thread Chris Angelico
On Wed, Sep 27, 2017 at 6:10 PM, Thomas Jollans wrote: > Personally I've found that my preferred tool, the Anaconda plugin for > Sublime Text, sometime gets PEP 8 operator spacing wrong, and complains > operators without spaces even where PEP8 explicitly recommends not using > spaces. Read PEP 8,

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Chris Angelico
On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano wrote: > Twice you have claimed to be able to write such a swap procedure for > lists. You can't. If you think you can, it is only because you have > misunderstood the problem and are writing something else that does > something different from what

Re: Spacing conventions

2017-09-27 Thread Thomas Jollans
On 27/09/17 09:50, Bill wrote: > Ever since I download the MyCharm IDE a few days ago, I've been > noticing all sort of "spacing conventions (from PEP) that are > suggested. How do folks regard these in general? PEP 8 (https://www.python.org/dev/peps/pep-0008), the officially recommended style g

Spacing conventions

2017-09-27 Thread Bill
Ever since I download the MyCharm IDE a few days ago, I've been noticing all sort of "spacing conventions (from PEP) that are suggested. How do folks regard these in general? For instance, the conventions suggest that if x>y : pass should be written if x > y: pass Personally, I l

Re: auto installing dependencies with pip to run a python zip application ?

2017-09-27 Thread Paul Moore
On 26 September 2017 at 23:48, Irmen de Jong wrote: > On 09/26/2017 10:49 PM, Paul Moore wrote: >> On 26 September 2017 at 19:47, Irmen de Jong wrote: >>> Any thoughts on this? Is it a good idea or something horrible? Has >>> someone attempted something like this before perhaps? >> >> When I've d

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Steven D'Aprano
On Wed, 27 Sep 2017 08:56:03 +0200, Antoon Pardon wrote: >> But that's not enough for the variable b to be an alias for the >> variable a. > > Yes it is! Since you seem to be intent on inventing your own meanings for well established words, for the confusion and misinformation of all, I can o

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 04:58 schreef Steve D'Aprano: > A pedantic difference that makes no difference to my argument. > > I see that you ignored the later assignment: > > b = 2; > > which also assigned to a. *That** is the fundamental point: b is certainly an > alias for a, and assigning to b assigns to a.

Re: Parentheses (as after "print")

2017-09-27 Thread Chris Angelico
On Wed, Sep 27, 2017 at 5:25 PM, Peter Otten <__pete...@web.de> wrote: > If you want that level of -- let's call it consistency -- you should either > plead for > > foo = import("foo") > > to spell an import Yeah no thanks. I work also with JavaScript, and there is no benefit whatsoever to having

Re: Parentheses (as after "print")

2017-09-27 Thread Peter Otten
Stefan Ram wrote: > Why do we newbies write »print 2«? Here's another hint. > This is an original transcript of what happened to me today: > > |>>> import( operator ) > | File "", line 1 > |import( operator ) > | ^ > |SyntaxError: invalid syntax > | > |>>> import operator > | >

Re: Parentheses (as after "print")

2017-09-27 Thread Steven D'Aprano
On Wed, 27 Sep 2017 02:48:41 +, Stefan Ram wrote: > Steve D'Aprano writes: >>"Do What I Mean" (DWIM) programming is a terrible idea. > > It's an anti-pattern, when one expects the implementation to follow > different and contradicting rules and then somehow guess what was in > the mind

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 04:58 schreef Steve D'Aprano: > On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote: > >> Steve D'Aprano writes: >>> On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: at that moment, but it still needed correction. If the assignment is an alias operator then after the statemen