Re: Odd truth result with in and ==

2018-11-21 Thread DL Neil
Serhiy, On 22/11/18 10:50, Serhiy Storchaka wrote: 21.11.18 22:17, Cameron Simpson пише: Can someone show me a real world, or failing that - sane looking, chained comparison using "in"?     s[0] == s[-1] in '\'"' Tests that string s starts and ends with a single or double quote. Am admir

Re: What Python books to you recommend to beginners?

2018-12-03 Thread DL Neil
Songbird, [post ok'd by them] =this time I've remembered to hit ReplyAll. Duh! There are plenty of Python books 'about'. Beyond the 'basics' they tend to become more topical, eg Scientific, Financial, Data Analysis... so what suits you might not me. i'm pretty well read so i can adapt

Re: the python name

2019-01-03 Thread DL Neil
On 3/01/19 2:03 PM, Avi Gross wrote: Challenge: Can we name any computer language whose name really would suggest it was a computer language? I think the name is the least important aspect of a computer language. Perhaps not. If you subscribe to the wider StackOverflow Driven Design philoso

Re: Recommendations for a novice user.

2019-01-07 Thread DL Neil
Hüseyin, On 7/01/19 3:35 PM, rbowman wrote: On 01/02/2019 05:14 AM, Hüseyin Ertuğrul wrote: I don't know the software language at all. What do you recommend to beginners to learn Python. What should be the working systematic? How much time should I spend every day or how much time should I spe

Re: the python name

2019-01-07 Thread DL Neil
On 7/01/19 9:09 AM, Avi Gross wrote: [Can we ever change the subject line?] {REAL SUBJECT: degrees of compilation.} Peter wrote: "... Hoever, this is the Python list and one of the advantages of Python is that we don't have to compile our code. So we need a different excuse for fencing on offi

Re: the python name

2019-01-07 Thread DL Neil
On 7/01/19 2:52 PM, rbowman wrote: On 01/04/2019 09:34 AM, Avi Gross wrote: Although I used FORTRAN ages ago and it still seems to be in active use, I am not clear on why the name FORMULA TRANSLATOR was chosen. I do agree it does sound more like a computer language based on both the sound and

Re: the python name

2019-01-07 Thread DL Neil
On 7/01/19 3:25 PM, rbowman wrote: On 01/04/2019 10:45 AM, Peter J. Holzer wrote: FORTRAN is older than most of us. So it influenced what we think a computer language should sound like. Sadly, not for all of us...  FORTRAN seeded later languages with terms that are obscure, like rewind().  A

Re: the python name

2019-01-10 Thread DL Neil
On 8/01/19 4:59 PM, rbowman wrote:> On 01/07/2019 02:10 PM, DL Neil wrote: >> Why is that obscure? It makes perfect sense - to those of us who have >> used tape/serial storage! Perhaps less-so to [bobble-heads], sorry I >> mean people who grew-up with 'bubble memo

Re: the python name

2019-01-10 Thread DL Neil
On 8/01/19 12:04 PM, Dennis Lee Bieber wrote: On Tue, 8 Jan 2019 10:10:13 +1300, DL Neil declaimed the following: Why is that obscure? It makes perfect sense - to those of us who have used tape/serial storage! Perhaps less-so to [bobble-heads], sorry I mean people who grew-up with 'b

Re: the python name

2019-01-10 Thread DL Neil
On 11/01/19 8:57 AM, Chris Angelico wrote: On Fri, Jan 11, 2019 at 6:48 AM DL Neil wrote: Working with a bunch of younger folk (who may technically be of the age of 'grand-children' - pardon me, I almost fell over my (long, grey) beard), I am frequently the butt of their gentle,

Re: the python name

2019-01-10 Thread DL Neil
Chris, On 11/01/19 10:06 AM, Chris Angelico wrote: On Fri, Jan 11, 2019 at 8:01 AM DL Neil wrote: PS the smart reply: who do you think coded the Alt-Tab window-switching mechanism? or, whose shoulders' do you young, whipper-snappers think you're standing on? (and, "please get d

Re: Python read text file columnwise

2019-01-12 Thread DL Neil
On 12/01/19 1:03 PM, Piet van Oostrum wrote: [email protected] writes: Hello I'm very new in python. I have a file in the format: 2018-05-31 16:00:0028.90 81.77 4.3 2018-05-31 20:32:0028.17 84.89 4.1 2018-06-20 04:09:0027.36 88.01 4.8 2

Re: Pythonic Y2K

2019-01-16 Thread DL Neil
On 17/01/19 4:45 PM, Larry Martell wrote: On Wed, Jan 16, 2019 at 9:35 PM Avi Gross wrote: Chris, The comparison to Y2K was not a great one. I am not sure what people did in advance, but all it took was to set the clock forward on a test system and look for anomalies. Not everything would be

Re: the python name

2019-01-17 Thread DL Neil
On 17/01/19 6:10 PM, Gregory Ewing wrote: Avi Gross wrote: The question that seems to come up too often about the python name is a distraction. In particular, it is answered fairly prominently in many places as just being a nonsensical name because a founder once liked a comedic entity that ch

Re: the python name

2019-01-17 Thread DL Neil
On 18/01/19 8:20 AM, Dennis Lee Bieber wrote: On Thu, 17 Jan 2019 18:12:33 +1300, Gregory Ewing declaimed the following: Dennis Lee Bieber wrote: Getting too close to REXX (which was something like Restructured EXtended eXecutor). And if we continue the theme of dinosaur evolution,

Re: Pythonic Y2K

2019-01-17 Thread DL Neil
On 17/01/19 6:53 PM, Chris Angelico wrote: On Thu, Jan 17, 2019 at 3:55 PM Avi Gross wrote: The forthcoming UNIX 2038 problem will, paradoxically happen on January 19. Paradoxically? What do you mean by that? First we had to duck the Y2K problem. By moving everything to 64-bits, we duck t

Re: Pythonic Y2K

2019-01-17 Thread DL Neil
Back in the computer world, Y2K gave such managers some cover. There was a FIRM deadline. I wonder how many used the impending arrival of the year 2000 as an excuse to perhaps clean up other parts of their act and charge it to prevention. I mean they might suggest they rewrite some legacy COBOL or

Re: checking protocols.

2019-01-23 Thread DL Neil
Avi Haven't noticed an answer to this. Did I miss anything? On 20/01/19 11:07 AM, Avi Gross wrote: Short question. Checking if a protocol is set up? =do you mean that to check/require that a class exhibits a particular protocol we should use abstract classes - will not instantiate unless a

Re: checking protocols.

2019-01-24 Thread DL Neil
Avi Haven't noticed an answer to this. Did I miss anything? I never saw the original message appear and thus expected no replies. I see a later post by Chris indicating he did not see it either. I assumed perhaps a moderator needed to approve it. =a silly question on my part. A quick check

Re: preferences file

2019-01-24 Thread DL Neil
Dave, On 25/01/19 8:42 AM, Dave wrote: I'm doing a small application and want to add user preferences.  Did some googling to see if there are standard Python ways/tools, but it seems not so much.  My specific questions are: 1. Best practices for a user preference file/system? > [edited] > Wo

Re: preferences file

2019-01-27 Thread DL Neil
On 25/01/19 4:22 PM, Bill Campbell wrote: On Thu, Jan 24, 2019, Dave wrote: I'm doing a small application and want to add user preferences. Did some googling to see if there are standard Python ways/tools, but it seems not so much. My specific questions are: 1. Best practices for a user prefe

Re: preferences file

2019-01-28 Thread DL Neil
On 29/01/19 1:29 AM, Karsten Hilbert wrote: On Mon, Jan 28, 2019 at 07:02:47AM -0500, songbird wrote: What about running a multi-tenant application (for multiple users who are not also system-users) - cf them logging-on to run their own. It is appropriate, possibly even "required" to keep Fred'

Re: preferences file

2019-01-28 Thread DL Neil
On 29/01/19 7:11 AM, songbird wrote: DL Neil wrote: On 29/01/19 1:29 AM, Karsten Hilbert wrote: On Mon, Jan 28, 2019 at 07:02:47AM -0500, songbird wrote: What about running a multi-tenant application (for multiple users who are not also system-users) - cf them logging-on to run their own. It

Re: Trying to figure out the data type from the code snippet

2019-01-29 Thread DL Neil
On 30/01/19 5:12 PM, Cameron Simpson wrote: On 30Jan2019 04:24, Chupo wrote: I am trying to figure out what data type is assigned to variable p in this code snippet: for p in game.players.passing():    print p, p.team, p.passing_att, p.passer_rating() Well, Python comes with a type() builtin

Re: Trying to figure out the data type from the code snippet

2019-01-30 Thread DL Neil
On 31/01/19 3:38 PM, Chupo via Python-list wrote: In article , DL Neil says... Alternately/additionally, if you ask help(p), it will reveal-all about the "class" (of which p is an "instance") - including some answers to your second question (and perhaps others which logical

Re: Trying to figure out the data type from the code snippet

2019-01-31 Thread DL Neil
On 1/02/19 9:00 AM, Chris Angelico wrote: On Fri, Feb 1, 2019 at 6:56 AM Chupo via Python-list wrote: In article <[email protected]>, Rick Johnson says... I was thought there aren't stupid questions, just stupid answers and I for sure won't apologize for

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
When a client demanded his way on this issue, the action we took was, as below, to create a list (called ordinal) and to use the dd (day) value as an index. [ nthSuffix(day) for day in range(1,32)] ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th'

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Chris, On 3/02/19 9:45 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 7:40 PM DL Neil wrote: This would normally see us coding "2019-02-03". The arrangement of larger to ever more precise time-units is very useful in databases and applications such as file-names, because it

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
On 3/02/19 10:16 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 8:09 PM DL Neil wrote: On 3/02/19 9:45 PM, Chris Angelico wrote: Which is why I always write dates in sorted format, usually eschewing delimiters: //CJA 20160511: Is this still happening? I don't remember seeing it in

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Christian, On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third,

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread DL Neil
On 4/02/19 9:25 PM, Christian Gollwitzer wrote: Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ord

Loop with else clause

2019-02-04 Thread DL Neil
What is the pythonic way to handle the situation where if a condition exists the loop should be executed, but if it does not something else should be done? Why am I asking? Today's code review included a for...else structure. I've rarely seen such a thing, and even knowing it exists, cannot r

Re: Loop with else clause

2019-02-04 Thread DL Neil
... = Footnote: Zamboni locks up after running into large patch of loose teeth. -Original Message- From: Python-list On Behalf Of DL Neil Sent: Monday, February 4, 2019 11:29 PM To: 'Python' Subject: Loop with else clause What is the pythonic way to handle the situa

Re: Loop with else clause

2019-02-07 Thread DL Neil
Further to our discussion of how to improve a code review's discovery of the mistaken handling of a for...else... construct:- Yesterday was a national holiday, but today gave some opportunity to research. Way back in 2009 there was spirited discussion over on the Python Ideas list (warning, e

Re: Loop with else clause

2019-02-09 Thread DL Neil
Possibly the final contribution:- On 9/02/19 1:30 AM, Adriaan Renting wrote: Wow, you dug deep. =Thank you. It started to 'bug' me, so I really was 'scratching an itch'! My example was the reverse of the "toy example"'s you mention as I find that often code becomes much clearer if you ord

Re: how to exit from a nested loop in python

2019-02-09 Thread DL Neil
On 8/02/19 7:45 PM, Kaka wrote: for i in range(len(A.hp)): for j in range(len(run_parameters.bits_Mod)): req_slots[j] = math.ceil((A.T[i]) for g in Temp[i]["Available_ranges"][j]: for s in range(g[0], g[-1]): if (s+req_slots[j]-1) <= g[-1]

Re: A limit to writing to a file from a loop?

2019-02-12 Thread DL Neil
Steve, On 13/02/19 7:56 AM, Steve wrote: My program reads from a text file (A), modifies the data, and writes to another file (B). This works until I reach about 300 writes and no more lines are written to file (B). I had to create a Counter and increment it to 250 when it gets reset. Upon res

Re: Sum of few numbers by using for and range

2019-02-17 Thread DL Neil
^Bart, Which course are you attempting? What are you using as learning material? (it seems ineffectual) - further comments interspersed, below:- On 18/02/19 5:30 AM, Chris Angelico wrote: On Mon, Feb 18, 2019 at 3:26 AM ^Bart wrote: I need to do what I wrote in the subject but... I don't u

Re: Sum of few numbers by using for and range

2019-02-17 Thread DL Neil
On 18/02/19 8:32 AM, Chris Angelico wrote: On Mon, Feb 18, 2019 at 6:12 AM DL Neil wrote: The reason this course caught my attention (and which is relevant to you, per Chris' and Dennis' recent advice) is that the course revolves around an 'active textbook'. This interspers

Re: How to play with Python in an existing app

2019-02-20 Thread DL Neil
Edmer, On 21/02/19 7:56 AM, [email protected] wrote: So I'm a newbie to Python. I got access to an existing RavenDB and am supposed to install it on aws.amazon.com. If I succeed in setting this up, I am supposed to write some Python code. But how can I play with Python and test some querrie

Re: Multiprocessing performance question

2019-02-20 Thread DL Neil
George On 21/02/19 1:15 PM, george trojan wrote: def create_box(x_y): return geometry.box(x_y[0] - 1, x_y[1], x_y[0], x_y[1] - 1) x_range = range(1, 1001) y_range = range(1, 801) x_y_range = list(itertools.product(x_range, y_range)) grid = list(map(create_box, x_y_range)) Which creates

Re: Multiprocessing performance question

2019-02-21 Thread DL Neil
rewster Software Engineer Alaska Volcano Observatory Geophysical Institute - UAF 2156 Koyukuk Drive Fairbanks AK 99775-7320 Work: 907-474-5172 cell:  907-328-9145 On Feb 20, 2019, at 4:30 PM, DL Neil <mailto:[email protected]>> wrote: George On 21/02/19 1:15 PM, geor

Re: sys.modules

2019-02-21 Thread DL Neil
Hello, On 22/02/19 5:40 AM, ast wrote: Is it normal to have 151 entries in dictionary sys.modules just after starting IDLE or something goes wrong ? >>> import sys >>> len(sys.modules) 151 I don't use Idle. Written in python, doesn't it require various packages to run before it even talks

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
Vergos, Please provide more information and show how you've debugged the code so far... On 25/02/19 7:03 AM, [email protected] wrote: pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, downloads, authuser FROM guests

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
Vergos, On 25/02/19 11:53 AM, [email protected] wrote: Τη Δευτέρα, 25 Φεβρουαρίου 2019 - 12:38:43 π.μ. UTC+2, ο χρήστης [email protected] έγραψε: Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε: Vergos, Please provide more information and show how

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-25 Thread DL Neil
On 26/02/19 7:47 AM, Dennis Lee Bieber wrote: On Mon, 25 Feb 2019 13:00:03 -0500, Dennis Lee Bieber declaimed the following: My apologies for the mis-attribution -- due to spam, I tend to filter out @gmail.com posts (the one flaw with Forte Agent -- it only filters news groups on subje

Re: Quirk difference between classes and functions

2019-02-25 Thread DL Neil
On 26/02/19 5:25 AM, ast wrote: I noticed a quirk difference between classes and functions >>> x=0 >>> class Test:     x = x+1     print(x)     x = x+1     print(x) ... Previous code doesn't generate any errors. x at the right of = in first "x = x+1" line is the global on

Re: Connector/Python, MySQL Workbench Issue

2019-02-25 Thread DL Neil
Scott, On 26/02/19 2:15 PM, Scott Sorgent wrote: I was trying to install MySQL Workbench and it asked me to install the Connector/Python 3.7. I installed Python 3.7.2, restarted the computer and tried to install MySQL workbench again and it told me again that I needed to install Connector/P

Re: Connector/Python, MySQL Workbench Issue

2019-02-25 Thread DL Neil
r.  I opted for the Full Installation on the MySQL Workbench program though which tries to install everything.  I'm going to be using for a big MySQL database through AWS. *From:* Python-list on behalf of DL Ne

Re: Using PyArg_ParseTuple to with optional fields.

2019-02-28 Thread DL Neil
Anthony, On 28/02/19 10:18 PM, Anthony Flury via Python-list wrote: I am trying to write an extension module with a function (actually an __init__ method, but I am not sure that matters) where the function can be called as either :     my_func() or     my_func( a, b, c, d) - where a,b,c,d a

Re: Class Issue`

2019-03-05 Thread DL Neil
Milt, On 6/03/19 11:39 AM, Milt wrote: The following code gives me unusual results - base on experience with C++. class Car:    # carColor = None    # mileage = None    def __init__(self, color = None, miles = None):   self.mileage = miles   self.carColor = color    def print(self)

Re: System Beep?

2019-03-08 Thread DL Neil
Dear Squeak, sorry, Dear Steve, Back in the ?good, old days when we used to walk alongside a mainframe CPU whilst it cogitated, we would often use the BEL character to alert us to job completion (and meantime bunk-off to go have a coffee, cakes, ...) - more seriously, it alerted telegraph and

Re: System Beep?

2019-03-08 Thread DL Neil
Steve, On 9/03/19 11:03 AM, Steve wrote: I tried all three, nothing audio. I am beginning to wonder if something I the operating system is at fault. The three lines do produce symbols. The first two are a rectangle with a space in the middle and the last one spelled out "bel" in short/small

Re: Python resources recommendations

2019-03-09 Thread DL Neil
Hello Arup, On 10/03/19 3:01 AM, Arup Rakshit wrote: Hello Python, This is my first time in this mailing list. I am a Ruby/JS developer by day. I have decided to learn Python now this year. Being an experienced developer as I said above which resources I should pick to learn Python in and out?

Re: Python resources recommendations

2019-03-09 Thread DL Neil
AK, On 10/03/19 12:41 PM, Alex Kaye wrote: DL, Good advice. U of M is well done and interesting. Actually, I criticised them - but was looking at matters such as "delivery" and from a cognitive psychology perspective - on behalf of, but quite different to, the needs of 'the average' trainee

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread DL Neil
Dear Joyce, On 11/03/19 7:30 AM, [email protected] wrote: ... A = [ 4, 5, 1] #TASK0 def displayVector(v) : print(v) displayVector(A) ... B = buildRandomVector(A) def vectorMagnitude(v) : tsum = 0 for i in v: tsum = tsum + i**2 x = math.sqrt(tsum)

Re: Help!!! How to apply my created function to another function

2019-03-10 Thread DL Neil
Luuk, On 11/03/19 8:02 AM, Luuk wrote: On 10-3-2019 19:30, [email protected] wrote: Please see the last line When reading above, i was thinking about this joke: ...> ;) Yes, I had a similar reaction to the wording: why not put *it* first. Having lived and worked in many countries/culture

Re: "use strict"

2019-03-11 Thread DL Neil
Abdur-Rahmaan, with greetings, On 12/03/19 6:45 AM, Abdur-Rahmaan Janhangeer wrote: Greetings, would it be a good idea to add a use strict in py like js? recently i was helping someone and that was one annoying part where a typo in a var name caused an unintended variable to slip in. maybe some

Re: "use strict"

2019-03-11 Thread DL Neil
On 12/03/19 8:00 AM, Abdur-Rahmaan Janhangeer wrote: about the editor part i think yes it'd underline unused variables or somewhat similar. is that the best we can hope for (coupled with type annotations)? the problem was that i was reviewing the code, since everything worked (no errors but

Re: Python scope question

2019-03-12 Thread DL Neil
Arup, On 13/03/19 3:38 AM, Arup Rakshit wrote: I have questions how nonlocal and global affecting the variable assignment. Also how each print statement looking up the values for the spam variable. This scope thing in python is very confusing too me still. Can anyone help me to understand th

Re: UG Announcement - Python Mauritius User-Group (pymug)

2019-03-14 Thread DL Neil
On 14/03/19 6:53 PM, Abdur-Rahmaan Janhangeer wrote: As per requirements, i'm announcing the existence of the Python User-Group for Mauritius, an island in the Indian Ocean. Below are some info. Congratulations! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Jack, On 15/03/19 3:05 AM, Jack Dangler wrote: Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Just getting started with tutorials and such, and don't understand this - Did you answer the post asking which tutorial you were following/copying? Sorry - it is this - https://www.learnpython.org/en/ .. The section is on classes and objects - https://www.learnpython.org/en/Classes_and_Objects

Re: Not Defined error in basic code

2019-03-14 Thread DL Neil
Thank you sir. I think you may be on to something there. I've done mainframe, machine, 3GL, and 4GL languages, but the last couple I've taken on have given me headaches. I guess I'll have to just read a bunch first and then try and write something simpler than what I'm attempting to take on...

Re: I wrote a free book about TDD and clean architecture in Python

2019-03-19 Thread DL Neil
On 17/03/19 12:29 AM, [email protected] wrote: I published on Leanpub a free book, "Clean Architectures in Python". It's a humble attempt to organise and expand some posts I published on my blog in the last years. You can find it here: https://leanpub.com/clean-architectures-in-python

Re: I wrote a free book about TDD and clean architecture in Python

2019-03-19 Thread DL Neil
On 20/03/19 7:18 AM, Leonardo Giordani wrote: Ha ha ha, yes I get it! =) I'm sorry, that depends entirely on the LeanPub processing chain (I believe, I'll have a look just to be sure). I hope the book will be useful even with this little issue. Thanks for reading it! To be fair, that was one

Re: File not closed

2019-03-20 Thread DL Neil
On 2019-03-20, ast wrote: In the following snippet, a file is opened but without any variable referring to it. So the file can't be closed. [line.split(":")[0] for line in open('/etc/passwd') if line.strip() and not line.startswith("#")] What do you think about this practice ? As other

Re: Might be doing this wrong? (Turtle graphics)

2019-03-20 Thread DL Neil
Jason, On 21/03/19 12:34 PM, [email protected] wrote: So, I typed in code: from turtle import * forward(100) right(120) clear() It didn't work! It kept on saying that there was an indent and the first line was wrong. Help! It would be most helpful if you gave us the exact error msg, in

Re: log file

2019-03-21 Thread DL Neil
On 22/03/19 4:25 PM, Sharan Basappa wrote: I am running a program and even though the program runs all fine, the log file is missing. I have pasted first few lines of the code. Any suggestions where I maybe going wrong? import os import csv import logging import assertion_design as asd import

Re: Multiple log files using logging module

2019-03-24 Thread DL Neil
On 25/03/19 6:13 AM, Sharan Basappa wrote: I have a test program that imports a design program. Both the programs need to log messages. ...> I would like to get comment from members here as well as some simple programs to illustrate this ... Have you copied this code from somewhere? Which tu

Re: Python 3.7 Bug

2019-03-25 Thread DL Neil
Bassam, Greetings. On 26/03/19 1:14 AM, Bassam Abdul-Baki wrote: Greetings, In the following code, there's a bug on certain parameters. -- def per(n, steps = 0): digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j steps += 1 print(steps, result, sep

Re: Your IDE's?

2019-03-25 Thread DL Neil
On 26/03/19 10:38 AM, John Doe wrote: What is your favorite Python IDE? In case you are tempted to reply, neither of "John"'s supposed domains resolves (to a web site)/has been registered. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Your IDE's?

2019-03-25 Thread DL Neil
On 26/03/19 12:55 PM, Gene Heskett wrote: On Monday 25 March 2019 18:20:29 DL Neil wrote: On 26/03/19 10:38 AM, John Doe wrote: What is your favorite Python IDE? In case you are tempted to reply, neither of "John"'s supposed domains resolves (to a web site)/has been register

Re: configparser - which one?

2019-03-25 Thread DL Neil
Dave, On 26/03/19 1:10 PM, Dave wrote: I use Python3 3, and expected learning how to use configparser would be no big deal.  Well!  Seems there is configparser, stdconfigparser, and safeconfigparser, and multiple ways to set the section and entries to the section.  A little confusing.  I want

OT Re: Your IDE's?

2019-03-26 Thread DL Neil
Those of delicate disposition should look away now... The invention is not mine: aside from his name, have a look at the OP's purported email address, and his requested ReplyTo: address. Then check the veracity of those domainNMs... I only rarely do so as I can usually detect such from the pu

Re: configparser - which one?

2019-03-26 Thread DL Neil
On 27/03/19 2:44 AM, Grant Edwards wrote: On 2019-03-26, Cameron Simpson wrote: Like JSON, YAML etc are far far easier than XML for the reader. If "far far easier than XML for the reader" is the bar, then we'll have to keep "nailgun to the eyeballs" on the list... That said, I agree with th

Handy utilities = Friday Filosofical Finking

2019-03-28 Thread DL Neil
How do you keep, use, and maintain those handy snippets, functions, classes... - units of code, which you employ over-and-over again? Having coded 'stuff' once, most of us will keep units of code, "utilities", which we expect will be useful in-future (DRY principle), eg functions to rename fi

Re: Understanding the MRO with multiple inheritance

2019-03-29 Thread DL Neil
Arup, There is a minefield here. Are you using Python 2 or 3? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
Gidday Cameron, Thanks for this - some thoughts below:- On 2/04/19 11:57 AM, Cameron Simpson wrote: On 29Mar2019 09:32, DL Neil wrote: How do you keep, use, and maintain those handy snippets, functions, classes... - units of code, which you employ over-and-over again? Having coded '

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
On 2/04/19 1:25 PM, Chris Angelico wrote: On Tue, Apr 2, 2019 at 11:16 AM DL Neil wrote: One of the points which intrigue me is that my colleagues don't keep snippets/a library, preferring to remember (hah!) when/where they used particular techniques in the past, and copying/duplicatin

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
On 2/04/19 1:56 PM, Cameron Simpson wrote: On 02Apr2019 13:14, DL Neil wrote: On 2/04/19 11:57 AM, Cameron Simpson wrote: On 29Mar2019 09:32, DL Neil wrote: Do you 'keep' these, or perhaps next time you need something you've 'done before' do you remember when/w

Re: Clicking a specific item within a drop down list

2019-04-02 Thread DL Neil
On 3/04/19 7:53 AM, [email protected] wrote: What code would allow me to automatically select and click the "Quarterly" value from the drop-down box labeled "Statement Type" on the web page below. I'm new to Python and have been struggling with this one. Any help is immensely appreciated. Tha

Re: Clicking a specific item within a drop down list

2019-04-02 Thread DL Neil
Richard, (this is a Python list, and whilst the question is quite proper - your are using Python after all, the answer delves into Selenium and then dives into HTML and finally disappears into 'the dark side' of JavaScript!) On 3/04/19 2:02 PM, [email protected] wrote: Hi dn, Thank you kind

Re: fs package question - cp -p semantics when copying files?

2019-04-02 Thread DL Neil
Skip, On 3/04/19 8:06 AM, Skip Montanaro wrote: I posed this yesterday on the PyFilesystem discussion Google Group but it's so far not even garnered a single view, so perhaps that group is defunct. I turn to the knowledgeable folks here: I am copying files from one filesystem instance to anothe

Re: Logging module and datetime - oil & water for some reason?

2019-04-02 Thread DL Neil
Skip, On 2/04/19 9:54 AM, Skip Montanaro wrote: I assiduously avoided using Python's logging package for about the first dozen years of its existence. I eventually gave in and started I'm glad you're stepping-up! I'm never sure whether to be amazed or dismayed by the huge number of folk exp

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread DL Neil
Arup, On 5/04/19 7:33 AM, Arup Rakshit wrote: I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understanding some parts of the program. ... A technique for solving this sort of comprehension-problem is to simulate the opera

Logging cf Reporting = Friday Filosofical Finking

2019-04-04 Thread DL Neil
Is the logging module an ideal means to provide (printed) user reports, or is it a 'bad fit' and not designed/fit for such a purpose? PSL's logging module (per discussion 'here' earlier this week) is often quietly avoided by 'the average Python programmer'. It is unwieldy, yet that is, in-par

Re: I want understand how this word wrap program playing on input

2019-04-06 Thread DL Neil
er come to me. Thanks again to all of you. Thanks, Arup Rakshit [email protected] On 05-Apr-2019, at 1:24 AM, DL Neil wrote: Arup, On 5/04/19 7:33 AM, Arup Rakshit wrote: I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understand

Re: Logging cf Reporting = Friday Filosofical Finking

2019-04-08 Thread DL Neil
Is logging an unpopular package? Is extending its use, as described, interesting/inappropriate/illogical/downright-crazy? On 5/04/19 8:34 AM, DL Neil wrote: Is the logging module an ideal means to provide (printed) user reports, or is it a 'bad fit' and not designed/fit for such

Python list and Python Journeymen*

2019-04-13 Thread DL Neil
se if it feels embarrassing. Please allow me to explain... Hello DL Neil, Sorry if it feels like random. I need some advices about the Python. I am learning Python to learn basically Flask, because I am a web developer and understands it well. Having prior knowledge in Ruby, JS, I thought it

Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
(I know it's not Friday [exp], and after personal apologies[apo]) Do you bother with exception handling for import statements? Most of the code I read, both in books and during code review, eschews any form of ImportError check. Even data science people who 'clean' every data field towards i

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
On 18/04/19 8:53 AM, Larry Martell wrote: On 2019-04-17 21:20, DL Neil wrote: Do you bother with exception handling for import statements? I often have to do something like this: try: from settings import SITE_WAFER_DIAMETER except ImportError: SITE_WAFER_DIAMETER = 300 That&#

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
On 18/04/19 8:45 AM, MRAB wrote: On 2019-04-17 21:20, DL Neil wrote: Do you bother with exception handling for import statements? Can we assume that if such a catastrophic error occurs, it is quite acceptable for the code to fall-over in a tumbling-fumble? [snip] Catch only what you (well

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
On 18/04/19 8:44 AM, Grant Edwards wrote: On 2019-04-17, DL Neil wrote: Do you bother with exception handling for import statements? Sometimes. There are two cases when I do that: 1. When the module has different names under Python2 and Python3 and the program tries first one, then

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
On 18/04/19 8:29 AM, Chris Angelico wrote: On Thu, Apr 18, 2019 at 6:21 AM DL Neil wrote: Do you bother with exception handling for import statements? Can we assume that if such a catastrophic error occurs, it is quite acceptable for the code to fall-over in a tumbling-fumble? I try/except

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread DL Neil
On 18/04/19 1:24 PM, Cameron Simpson wrote: On 17Apr2019 21:45, MRAB wrote: On 2019-04-17 21:20, DL Neil wrote: Do you bother with exception handling for import statements? [...] Catch only what you (well, the script) can fix. If it needs numpy, but can't import numpy, then when can

Re: Function to determine list max without itertools

2019-04-17 Thread DL Neil
On 18/04/19 4:10 PM, Sayth Renshaw wrote: I have created a function that takes a list as an argument. Without using itertools I want to compare each item in the list to find the max. However instead of the max I keep getting the last item in the list. Where is my logic wrong here? ... Seems

Re: Function to determine list max without itertools

2019-04-18 Thread DL Neil
On 19/04/19 5:22 PM, Sayth Renshaw wrote: In English rather than Python, how do you find the maximum element in a list? -- Rob Gaddi, Highland Technology Get first 1 item in the list and compare it to the rest. If it is larger than rest its the max. However if another list member is larger

Re: Function to determine list max without itertools

2019-04-19 Thread DL Neil
> On 19/04/19 7:23 PM, Sayth Renshaw wrote: In English: Set the first item in the list as the current largest. Compare each subsequent integer to the first. if this element is larger, set integer. Criticism: (because this does NOT match the code, below!) - should

Re: Function to determine list max without itertools

2019-04-19 Thread DL Neil
On 20/04/19 4:41 AM, Rob Gaddi wrote: On 4/19/19 12:23 AM, Sayth Renshaw wrote: On Friday, 19 April 2019 17:01:33 UTC+10, Sayth Renshaw  wrote: Set the first item in the list as the current largest. Compare each subsequent integer to the first. if this element is large

  1   2   3   4   5   >