Re: "Edit With Python" option missing

2019-09-01 Thread DL Neil via Python-list
Hi Aakash, On 31/08/19 8:54 PM, Akash verma wrote: "Edit With Python" option missing from message context when right clicked with mouse . There are two stages to working with a Python program: editing the source-code, and executing the program. For the first, most use a text editor/IDE, eg

Re: Hi how do I import files inside a txt file?

2019-09-02 Thread DL Neil via Python-list
On 3/09/19 1:48 AM, Spencer Du wrote: On Monday, 2 September 2019 15:29:07 UTC+2, Joel Goldstick wrote: On Mon, Sep 2, 2019 at 9:21 AM Spencer Du wrote: On Monday, 2 September 2019 15:03:52 UTC+2, Joel Goldstick wrote: On Mon, Sep 2, 2019 at 8:46 AM Spencer Du wrote: On Monday, 2

Re: How to remove a string from a txt file?

2019-09-04 Thread DL Neil via Python-list
On 5/09/19 3:08 AM, Spencer Du wrote: Hi I want to remove a string from a txt file and then print out what I have removed. How do I do this. The txt file is in this format and should be kept in this format. txt.txt: laser,cameras, Is this a homework assignment? What code do you have so

Re: Formatting floating point

2019-09-04 Thread DL Neil via Python-list
On 5/09/19 5:12 AM, Dave via Python-list wrote: ... My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Agreed: there's ton(ne)s of information 'out there', much of it old, eg

WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? (discounting distutils and similar installation tools, or unit testing methodology) There are over 500 questions on StackOverflow which refer to Python's if

Re: WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
On 12/09/19 8:43 AM, Chris Angelico wrote: On Thu, Sep 12, 2019 at 6:34 AM DL Neil via Python-list wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Yes, absolutely. It's the easiest way to share code

Re: Email messages from grouped email using IMAPClient in Python.

2019-09-11 Thread DL Neil via Python-list
On 12/09/19 5:06 PM, Srinivas Pullabhotla wrote: Hello, I am trying to fetch email messages from a gmail inbox. So, there will be 1000s of messages sent to Inbox and since they are 1000s, the emails are grouped 100 per each email item. When I tried this method, the program only fetches some

Re: WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
On 12/09/19 10:37 AM, Alan Bawden wrote: DL Neil writes: ... However, reversing the question in my mind led me to ask (myself): how many scripts do I have (in "production use") which are ever used (also) as a module by some other script? I think the answer is/was: "none"! Accordingly,

Re: WedWonder: Scripts and Modules

2019-09-12 Thread DL Neil via Python-list
On 12/09/19 10:59 AM, Cameron Simpson wrote: On 12Sep2019 08:24, DL Neil wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Many. Many many. 1: Many of my modules run their unit tests if invoked as the main

Re: WedWonder: Scripts and Modules

2019-09-12 Thread DL Neil via Python-list
On 12/09/19 8:22 PM, Barry Scott wrote: On 11 Sep 2019, at 21:24, DL Neil via Python-list wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? (discounting distutils and similar installation tools, or unit

Re: Finding lines in .txt file that contain keywords from two different set()

2019-09-08 Thread DL Neil via Python-list
On 9/09/19 4:02 AM, A S wrote: My problem is seemingly profound but I hope to make it sound as simplified as possible.Let me unpack the details..: ... These are the folders used for a better reference ( https://drive.google.com/open?id=1_LcceqcDhHnWW3Nrnwf5RkXPcnDfesq ). The files are

Friday Finking: 'main-lines' are best kept short

2019-09-12 Thread DL Neil via Python-list
(this follows some feedback from the recent thread: "WedWonder: Scripts and Modules" and commences a somewhat-related topic/invitation to debate/correct/educate) Is it a good idea to keep a system's main-line* code as short as possible, essentially consigning all of 'the action' to

Re: python is bugging

2019-09-21 Thread DL Neil via Python-list
On 22/09/19 5:08 AM, Dave Martin wrote: On Saturday, September 21, 2019 at 12:44:27 PM UTC-4, Brian Oney wrote: On Sat, 2019-09-21 at 08:57 -0700, Dave Martin wrote: On Saturday, September 21, 2019 at 11:55:29 AM UTC-4, Dave Martin wrote: what does expected an indented block *what does an

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread DL Neil via Python-list
On 26/09/19 9:14 PM, RobH wrote: I have some sample/demo python code for scrolling and outputting text onto a 16x2 lcd display. I would like to put my own message or text outputting to the lcd on 2 lines. I have tried using lcd.message('my message',1) and lcd.message('my message', 2), but

Re: pathlib

2019-10-01 Thread DL Neil via Python-list
On 1/10/19 2:58 PM, Dan Sommers wrote: On 9/30/19 3:56 PM, Barry Scott wrote: On 30 Sep 2019, at 16:49, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com > wrote: In the totality of a Path object that claims to represent paths to files, It

Re: pathlib

2019-09-30 Thread DL Neil via Python-list
On 1/10/19 1:40 AM, Barry Scott wrote: On 30 Sep 2019, at 12:51, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: On 9/30/19 4:28 AM, Barry Scott wrote: On 30 Sep 2019, at 05:40, DL Neil via Python-list wrote: Should pathlib reflect changes it has made to the file-system? I

Re: pathlib

2019-10-01 Thread DL Neil via Python-list
On 1/10/19 3:21 AM, Dan Sommers wrote: On 9/30/19 8:40 AM, Barry Scott wrote:  >> On 30 Sep 2019, at 12:51, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote:  >> On 9/30/19 4:28 AM, Barry Scott wrote:  >>>> On 30 Sep 2019, at 05:40, DL Neil via Python-list

Re: pathlib

2019-09-30 Thread DL Neil via Python-list
On 1/10/19 1:09 AM, Chris Angelico wrote: On Mon, Sep 30, 2019 at 9:54 PM Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: I would have said the same thing, but the docs⁰ disagree: a PurePath represents the name of (or the path to) a file, but a Path represents the actual file. ⁰

Re: pathlib

2019-09-30 Thread DL Neil via Python-list
On 30/09/19 9:28 PM, Barry Scott wrote: On 30 Sep 2019, at 05:40, DL Neil via Python-list wrote: Should pathlib reflect changes it has made to the file-system? I think it should not. The term "concrete" is applied to Path(), PosixPath(), and WindowsPath() - whereas

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread DL Neil via Python-list
On 27/09/19 7:21 AM, RobH wrote: On 26/09/2019 17:51, Dennis Lee Bieber wrote: On Thu, 26 Sep 2019 11:58:15 +0100, RobH declaimed the following: ... Check out this guide for info on using character LCDs with the CircuitPython library:

Re: pathlib

2019-10-02 Thread DL Neil via Python-list
On 2/10/19 12:52 AM, Rhodri James wrote: On 01/10/2019 06:03, DL Neil via Python-list wrote: On 30/09/19 9:28 PM, Barry Scott wrote: On 30 Sep 2019, at 05:40, DL Neil via Python-list wrote: Should pathlib reflect changes it has made to the file-system? I think it should not. The term

Re: pathlib

2019-10-02 Thread DL Neil via Python-list
On 3/10/19 6:25 AM, Barry Scott wrote: On 2 Oct 2019, at 09:14, DL Neil via Python-list mailto:python-list@python.org>> wrote: On 2/10/19 12:52 AM, Rhodri James wrote: On 01/10/2019 06:03, DL Neil via Python-list wrote: On 30/09/19 9:28 PM, Barry Scott wrote: On 30 Sep 2019, at 05:40, D

Re: pathlib

2019-10-02 Thread DL Neil via Python-list
On 3/10/19 3:07 AM, Rhodri James wrote: On 02/10/2019 09:14, DL Neil via Python-list wrote: That said, it is one of the ways that a path can be shown to transition from some 'pure' state to become 'concrete'. However, A.N.Other has suggested that I might be mis-applying the word "con

Re: pathlib

2019-10-02 Thread DL Neil via Python-list
On 3/10/19 12:42 AM, Dan Sommers wrote: On 10/2/19 4:14 AM, DL Neil via Python-list wrote: In the case that sparked this enquiry, and in most others, there is no need for a path that doesn't actually lead somewhere. The paths that are used, identify files, open them, rename them, create

pathlib

2019-09-29 Thread DL Neil via Python-list
Should pathlib reflect changes it has made to the file-system? Sample code, below, shows pathlib identifying a data-file and then renaming it. Yet, after the rename operation, pathlib doesn't recognise its own change; whereas the file system does/proves the change was actioned. $ touch

Re: pathlib

2019-09-30 Thread DL Neil via Python-list
On 1/10/19 6:13 AM, Dan Sommers wrote: On 9/30/19 12:51 PM, Chris Angelico wrote: On Tue, Oct 1, 2019 at 1:51 AM Dan Sommers ... All I'm doing is defending the OP, who was surprised that renaming a file *using a Path instance* didn't reflect that operation *in that Path instance*.  I believe

Re: How can i stop this Infinite While Loop - Python

2019-11-01 Thread DL Neil via Python-list
TLDR; declare if homework; doing someone's homework doesn't really help; Python is not ALGOL/Pascal/C/C++ by any other name; Python assignments should promote learning semantics as well as syntax; sometimes re-stating the problem leads to an alternate/better solution. On 31/10/19 12:55 AM,

Re: Friday finking: TDD and EAFP

2019-11-03 Thread DL Neil via Python-list
On 2/11/19 4:32 PM, boB Stepp wrote: On Fri, Nov 1, 2019 at 12:42 AM DL Neil via Python-list wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? [...] In encouraging my mind to think about testing the code, I find myself

Re: Friday finking: TDD and EAFP

2019-11-03 Thread DL Neil via Python-list
On 3/11/19 6:30 AM, Bev In TX wrote: On Nov 1, 2019, at 12:40 AM, DL Neil via Python-list mailto:python-list@python.org>> wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? I’m not an expert on either TDD or

Re: Looking for python pentest scripts

2019-11-10 Thread DL Neil via Python-list
On 11/11/19 12:36 AM, nixuser wrote: can someone tell about good resource for python related pentesting scripts? any extensive list? What is the purpose of such scripts/list? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for python pentest scripts

2019-11-11 Thread DL Neil via Python-list
On 11/11/19 4:39 PM, Terry Reedy wrote: On 11/10/2019 7:32 PM, Bob Gailer wrote: On Nov 10, 2019 6:40 AM, "nixuser" wrote: can someone tell about good resource for python related pentesting scripts? any extensive list? > Try Googling python pentesting. That will give you some relevant

Friday finking: TDD and EAFP

2019-10-31 Thread DL Neil via Python-list
Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? TDD = Test-Driven Development EAFP = it's easier to ask forgiveness than permission * WebRefs as footnote The practice of TDD* is that one writes test routines to prove a unit of code,

Re: Hi there! We are here to answer any questions you have about Udacit...

2019-11-12 Thread DL Neil via Python-list
On 12/11/19 9:48 PM, joseph pareti wrote: great, thank you so much for the advice. In fact, I sent this mail to the python mailing list by mistake, but now I am glad I did ... There's plenty of over-lap between lists - PyTutor is another. Meantime I've received email from IBM about their

Re: apologies for my latest email; it was not intended for this mailing list

2019-11-11 Thread DL Neil via Python-list
Because of something we said? (to upset you=joke!) -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi there! We are here to answer any questions you have about Udacit...

2019-11-11 Thread DL Neil via Python-list
On 12/11/19 7:14 AM, joseph pareti wrote: i have done the first 6 lessons of python --- https://classroom.udacity.com/courses/ud1110/lessons/bbacebc6-406a-4dc5-83f6-ef7ba3371da6/concepts/50247542-7933-4afe-9130-ff1dff429b03 what do you recommend next? My goal is ML/AI As with any

Re: Friday finking: TDD and EAFP

2019-11-12 Thread DL Neil via Python-list
On 6/11/19 8:01 AM, Barry Scott wrote: On 1 Nov 2019, at 05:40, DL Neil via Python-list wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? The practice of TDD* is that one writes test routines to prove a unit of code, eg method

Re: ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package

2019-12-08 Thread DL Neil via Python-list
On 9/12/19 8:13 AM, b...@bbhoyer.com wrote: Just registered Thanks Hi @bob, welcome to the gang... I am a beginner in Python, been working on class material from Mosh ... from email.mime.multipart import MIMEMultipart ... Here is the error message:

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
On 9/12/19 7:47 AM, RobH wrote: On 08/12/2019 16:49, Dennis Lee Bieber wrote: On Sun, 8 Dec 2019 09:44:54 +, RobH declaimed the following: def print_time():   current_time = time.strftime("%I:%M") ... I don't know if that is the correct way as I am just using the code from the

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
It's a lot like the misuse of the word "theory". You mean to say that in theory there is no difference between theory and practice, but in practice there is? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-08 Thread DL Neil via Python-list
On 9/12/19 7:29 AM, R.Wieser wrote: ... Note that in all cases when you import a module (either by import the_file or from the_file importe whatever) you actually import ALL of it So much for my assumption only the class itself would be loaded - and a wrench into my idea to have a number of

Re: Error getting data from website

2019-12-06 Thread DL Neil via Python-list
On 7/12/19 1:51 PM, Chris Angelico wrote: On Sat, Dec 7, 2019 at 11:46 AM Michael Torrie wrote: On 12/6/19 5:31 PM, DL Neil via Python-list wrote: If you read the HTML data that the REPL has happily splattered all over your terminal's screen (scroll back) (NB "soup" is easier to

Re: Error getting data from website

2019-12-06 Thread DL Neil via Python-list
On 7/12/19 12:53 PM, Sam Paython wrote: This is the code I am writing: import requests from bs4 import BeautifulSoup request = requests.get("https://www.amazon.ca/dp/B07RZFQ6HC;) content = request.content soup = BeautifulSoup(content, "html.parser") element =

Re: python 3 prefix to infix without too many parethesis

2019-12-09 Thread DL Neil via Python-list
On 10/12/19 8:40 AM, Terry Reedy wrote: On 12/9/2019 6:21 AM, jezka...@gmail.com wrote: Hi, I have got a problem. Is this homework? Same question - that way we know that our task is to help you learn to code in Python, cf a problem with Python itself... Similarly, you may like to know

Re: Python3 - How do I import a class from another file

2019-12-09 Thread DL Neil via Python-list
It might be becoming 'long', but this discussion contains much of profit to many people! Us 'silver surfers' do need to periodically question those beliefs we hold as 'tenets' of ComSc. Amongst them is RAM (or "core"!) conservation. It remains a virtue somewhat, but at the same time,

Re: distinguishable matplotlib colours / symbols / line styles

2019-12-16 Thread DL Neil via Python-list
On 17/12/19 3:37 pm, Dennis Lee Bieber wrote: If, by some chance, external nodes can get to it: http://wlfraed.microdiversity.freeddns.org/BW/BWConv.html } Works for me, no hacking necessary! (photo of ppl dressed-up in Mickey Mouse type costumes) -- Regards =dn --

Re: Python3 - How do I import a class from another file

2019-12-16 Thread DL Neil via Python-list
Wow, I turned my back to attend to $job and this conversation has 'exploded' (>80 msgs)! TLDR; With apologies, I started to reply to your reply, but then added 'bits' as I read the conversation thereafter. The result (below) is a messy hodge-podge, for which I can only apologise (as I don't

Re: Unicode filenames

2019-12-06 Thread DL Neil via Python-list
On 7/12/19 7:17 AM, Bob van der Poel wrote: I have some files which came off the net with, I'm assuming, unicode characters in the names. I have a very short program which takes the filename and puts into an emacs buffer, and then lets me add information to that new file (it's a poor man's DB).

Re: Make warning an exception?

2019-12-06 Thread DL Neil via Python-list
On 7/12/19 9:58 AM, Israel Brewster wrote: I was running some code and I saw this pop up in the console: 2019-12-06 11:53:54.087 Python[85524:39651849] WARNING: nextEventMatchingMask should only be called from the Main Thread! This will throw an exception in the future. The only problem is,

Re: Unicode filenames

2019-12-07 Thread DL Neil via Python-list
On 8/12/19 5:50 AM, Bob van der Poel wrote: On Sat, Dec 7, 2019 at 4:00 AM Barry Scott wrote: On 6 Dec 2019, at 18:17, Bob van der Poel wrote: I have some files which came off the net with, I'm assuming, unicode characters in the names. I have a very short program which takes the filename

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
On 8/12/19 9:18 PM, Karsten Hilbert wrote: Sorry, I should have said just the line, and it didn't return anything. OK, a bit strange, but then that might be due to Thonny. Is Thonny an interpreter then. It sort of is, or at least it runs one. We'd like to take that out of the equation. I

Re: distinguishable matplotlib colours / symbols / line styles

2019-12-16 Thread DL Neil via Python-list
On 17/12/19 5:19 am, Chris Angelico wrote: On Tue, Dec 17, 2019 at 3:16 AM duncan smith wrote: Hello, Not really specific to Python or matplotlib (but that's what I'm using). I'm looking for a good combination of colours and symbols for scatter plots, and combination of colours and

Re: More efficient/elegant branching

2019-12-09 Thread DL Neil via Python-list
I agree with you, so I'm going to ignore def branch2(a, b, z): and def branch3(a, b, z) because they appear too contrived - and I guess that's fair, in that you've contrived to satisfy pylint. Question: are there other people/factors who/which should be regarded as more important than the

Re: Black

2019-10-21 Thread DL Neil via Python-list
Top posting? Agreed. As my eyes age (they're even older than my teeth!) I find the additional horizontal white space improves (my) comprehension, particularly when dealing with a dense nesting of structures. Of course the more 'across' the text stretches, the more likely a vertical

Re: Instantiating sub-class from super

2019-10-15 Thread DL Neil via Python-list
On 16/10/19 12:38 AM, Rhodri James wrote: On 14/10/2019 21:55, DL Neil via Python-list wrote: ... It seemed better (at the design-level) to have Man( Person ) and Woman( Person ) sub-classes to contain the pertinent attributes, source more detailed and specific questions, and collect

Re: Instantiating sub-class from super

2019-10-15 Thread DL Neil via Python-list
On 16/10/19 1:55 PM, duncan smith wrote: On 15/10/2019 21:36, DL Neil wrote: On 16/10/19 12:38 AM, Rhodri James wrote: On 14/10/2019 21:55, DL Neil via Python-list wrote: ... So, yes, the "label" is unimportant - except to politicians and statisticians, who want precise answers

Re: Instantiating sub-class from super

2019-10-14 Thread DL Neil via Python-list
Hi Greg, On 15/10/19 11:37 AM, Gregory Ewing wrote: DL Neil wrote: Is there a technique or pattern for taking a (partially-) populated instance of a class, and re-creating it as an instance of one of its sub-classes? Often you can assign to the __class__ attribute of an instance to change

Instantiating sub-class from super

2019-10-14 Thread DL Neil via Python-list
Is there a technique or pattern for taking a (partially-) populated instance of a class, and re-creating it as an instance of one of its sub-classes? In a medically-oriented situation, we have a Person() class, and start collecting information within an instance (person = Person(), etc).

Congratulations to @Chris

2019-10-24 Thread DL Neil via Python-list
Chris Angelico: [PSF's] 2019 Q2 Community Service Award Winner http://pyfound.blogspot.com/2019/10/chris-angelico-2019-q2-community.html ...and for the many assistances and pearls of wisdom he has contributed 'here'! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Instantiating sub-class from super

2019-10-24 Thread DL Neil via Python-list
On 25/10/19 4:29 AM, Frank Millman wrote: On 2019-10-19 12:37 AM, DL Neil via Python-list wrote: On 16/10/19 6:33 PM, Frank Millman wrote: On 2019-10-14 10:55 PM, DL Neil via Python-list wrote: Is there a technique or pattern for taking a (partially-) populated instance of a class, and re

Re: Installing Python 3.8 on PC with Python 3.7. How to do with version conflicts?

2019-10-28 Thread DL Neil via Python-list
Dottore, On 28/10/19 7:37 AM, Dott. Ugo Donini wrote: I cannot use Python 3.8 on my PC with installed Python 3.7. Is it possible to update the existing Python 3.7 without reinstalling Python 3.8. Conflicts problems. Thankyou Ugo Donini Inviato da Posta per Windows 10 If the question is

Re: Black

2019-10-23 Thread DL Neil via Python-list
On 22/10/19 3:18 AM, lizhollinshe...@gmail.com wrote: What do people think about black? I'm asking because one of my personal preferences is to use spaces for clarity: 1. right = mystr[ start : ] black version right=mystr[start:] 2. mtime = time.asctime( time.localtime(

Fursday Flippancy: American Py

2019-10-23 Thread DL Neil via Python-list
[via PlanetPython] The "American Py" song. Lyrics which amused me, at https://www.reddit.com/r/Python/comments/dfm2zv/american_py/ 'Multi-taskers' may like to read and listen-along to: https://www.youtube.com/watch?v=uAsV5-Hv-7U For the benefit of us silver-surfers reliving our youth (or for

Re: Instantiating sub-class from super

2019-10-18 Thread DL Neil via Python-list
On 17/10/19 7:52 AM, MRAB wrote: On 2019-10-16 19:43, duncan smith wrote: On 16/10/2019 04:41, DL Neil wrote: On 16/10/19 1:55 PM, duncan smith wrote: On 15/10/2019 21:36, DL Neil wrote: On 16/10/19 12:38 AM, Rhodri James wrote: On 14/10/2019 21:55, DL Neil via Python-list wrote: ... So

Re: Instantiating sub-class from super

2019-10-18 Thread DL Neil via Python-list
On 16/10/19 6:33 PM, Frank Millman wrote: On 2019-10-14 10:55 PM, DL Neil via Python-list wrote: Is there a technique or pattern for taking a (partially-) populated instance of a class, and re-creating it as an instance of one of its sub-classes? Here is a link to an article entitled

Re: Instantiating sub-class from super

2019-10-18 Thread DL Neil via Python-list
On 17/10/19 4:08 AM, Piet van Oostrum wrote: DL Neil writes: That said, if a "trans" person has ovaries or testes (for example) then a non-traditional sexual identification is irrelevant - for medical purposes. Diseases in those areas (and now I'm a long way from a research questionnaire and

Re: Instantiating sub-class from super

2019-10-18 Thread DL Neil via Python-list
On 18/10/19 9:27 AM, Eryk Sun wrote: On 10/17/19, MRAB wrote: On 2019-10-17 20:06, Eryk Sun wrote: I'm bugged by how the article mis-characterizes the fundamental problem. The operating system has nothing to do with the order of a directory listing, which varies even with an OS, depending on

Re: TypeError: unhashable type: 'list'

2019-10-23 Thread DL Neil via Python-list
On 23/10/19 8:51 PM, joseph pareti wrote: I am experimnenting with this (reproducer) code: pattern_eur= ['Total amount'] mylines = []# Declare an empty list. with open ('tmp0.txt', 'rt') as myfile: # Open tmp.txt for reading text. for myline in

Re: Python 3.8 with Anaconda

2019-11-24 Thread DL Neil via Python-list
On 25/11/19 6:26 AM, Ugo Donini wrote: It is lossible to update Anaconda to Pytho. 3.8? First 'hit' on DuckDuckGo.com: https://www.anaconda.com/keeping-anaconda-date/ If it is not yet available, they are the ones to ask if/when a 3.8 collection will be assembled... -- Regards =dn --

Re: Extract sentences in nested parentheses using Python

2019-12-02 Thread DL Neil via Python-list
On 3/12/19 6:00 AM, Peter Otten wrote: A S wrote: I think I've seen this question before ;) In addition to 'other reasons' for @Peter's comment, it is a common ComSc worked-problem or assignment. (in which case, we'd appreciate being told that you/OP is asking for help with "homework") I

Re: Python Resources related with web security

2019-11-23 Thread DL Neil via Python-list
Curiosity: why have recent similar enquiries also come from non-resolving domain names? Recently we've seen security-related enquiries (on more than one Python Discussion List) which don't explicitly claim to come from 'white hat hackers' but which do have the potential to have less-than

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-19 Thread DL Neil via Python-list
On 20/11/19 9:20 AM, Luciano Ramalho wrote: I apologize to all but the intended recipient for this. I’d have given him feedback in private if I knew his email. I will take leave from the list now. Keep up the good work, friendly responders. Please reconsider. Should your relationship with

Re: Friday finking: TDD and EAFP

2019-11-12 Thread DL Neil via Python-list
Apologies for lateness - stuff happened... On 4/11/19 9:44 AM, Peter J. Holzer wrote: On 2019-11-04 07:41:32 +1300, DL Neil via Python-list wrote: On 3/11/19 6:30 AM, Bev In TX wrote: On Nov 1, 2019, at 12:40 AM, DL Neil via Python-list mailto:python-list@python.org>> wrote: Is the pr

Re: Python Resources related with web security

2019-11-25 Thread DL Neil via Python-list
On 26/11/19 11:48 AM, Tim Chase wrote: On 2019-11-25 21:25, Pycode wrote: On Sun, 24 Nov 2019 10:41:29 +1300, DL Neil wrote: Are such email addresses 'open' and honest? you are not being helpful or answer the question.. What DL Neil seems to be getting at is that there's been an uptick in

Re: Formatting floating point

2019-10-07 Thread DL Neil via Python-list
On 8/10/19 4:04 AM, boffi wrote: DL Neil writes: Agreed: there's ton(ne)s of information 'out there', much of it old, eg Python2, "formatter" (deprecated since v3.4) ? are you referring to the `string.Formatter`[*] class? $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49)

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-07 Thread DL Neil via Python-list
On 8/10/19 3:45 PM, jf...@ms4.hinet.net wrote: For example: from my-dir import test I know it can be solved by renaming, but any alternative? The manual is your friend: - import - importlib (the latter allows modules to be identified by strings) However, Pythons has naming rules. If you

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-08 Thread DL Neil via Python-list
On 9/10/19 2:12 PM, jf...@ms4.hinet.net wrote: dieter於 2019年10月8日星期二 UTC+8下午1時33分20秒寫道: jf...@ms4.hinet.net writes: ... But most of the download from Github has a directory named '-master' which causes a trouble sometimes. Those are likely not meant to be imported directly. Typically,

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-08 Thread DL Neil via Python-list
On 9/10/19 4:34 PM, jf...@ms4.hinet.net wrote: jf...@ms4.hinet.net於 2019年10月8日星期二 UTC+8上午10時45分36秒寫道: For example: from my-dir import test I know it can be solved by renaming, but any alternative? --Jach Maybe another (better?) solution is: import sys sys.path.append(r'my-dir') import test

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-08 Thread DL Neil via Python-list
On 9/10/19 2:46 PM, Chris Angelico wrote: On Wed, Oct 9, 2019 at 12:36 PM DL Neil via Python-list wrote: ... (Or just using pip to install directly from GitHub, although not everyone knows that that's possible.) Come on, you just knew I was going to ask how... -- Regards =dn -- https

Re: How to combine a group of lists together

2019-12-20 Thread DL Neil via Python-list
On 21/12/19 6:04 pm, wanghao7...@gmail.com wrote: I utilized .get_text() + .split() functions and obtain this: spe= ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details'] ['4.7', 'inches'] ['750', 'x', '1334'] ['64', 'GB'] ['2', 'GB'] ['Apple', 'A11', 'Bionic,', 'Hexa-Core,',

Re: How to extend an object?

2019-12-20 Thread DL Neil via Python-list
On 21/12/19 2:50 pm, Greg Ewing wrote: On 21/12/19 1:59 am, Stefan Ram wrote:    I would like to add a method to a string.    This is not possible in Python? It's not possible. Built-in classes can't have methods added to them. You can define your own subclass of str and give it whatever

Re: More efficient/elegant branching

2019-12-22 Thread DL Neil via Python-list
On 11/12/19 1:07 AM, Daniel Haude wrote: Hello Neil, thanks for the detailed answer. Question: are there other people/factors who/which should be regarded as more important than the linter's opinion? Yes. Mine. Um, see below... (unless humor) I was just puzzled at the linter's output

Re: Software not working

2020-02-10 Thread DL Neil via Python-list
On 11/02/20 12:00 AM, Tushita Parashar wrote: Even after installing the software on my system the software isn’t running. Today, an (apparently) identical question, already asked and answered. Please see the Python-Tutor list: "Python Beginner" msg. -- Regards =dn --

Friday Finking: Poly more thick

2020-02-28 Thread DL Neil via Python-list
How does one code a function/method signature so that it will accept either a set of key-value pairs, or the same data enclosed as a dict, as part of a general-case and polymorphic solution? Wikipedia: polymorphism is the provision of a single interface to entities of different types. (

Re: Logging all the requests into a specific file

2020-02-27 Thread DL Neil via Python-list
On 28/02/20 9:29 AM, valon.januza...@gmail.com wrote: I am new to python and all of this, I am using this FastAPI, to build API, I want when users hit any endpoint for ex /products, that to be written into a file , how do I do it? The Python Standard Library offers a Logging library. It has

Friday Finking: Enum by gum

2020-01-23 Thread DL Neil via Python-list
When, why, and how do you employ Python/PSL enums? TLDR? Fair enough! Much of this text recounts a voyage of discovery. More specific questions appear at the bottom... Last century, when I learned to program (in-between working part-time at the dinosaur farm) neither FORTRAN II/IV nor

Re: Nested Loop Code Help

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 1:53 PM, Richard Damon wrote: On 1/26/20 6:52 PM, DL Neil via Python-list wrote: On 27/01/20 4:15 AM, ferzan saglam wrote: Hello people, I have written the code below which works fine, but it has one small problem. Instead of printing one (x) on the first line, it prints two. I

Re: Nested Loop Code Help

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 4:15 AM, ferzan saglam wrote: Hello people, I have written the code below which works fine, but it has one small problem. Instead of printing one (x) on the first line, it prints two. I have tried everything in my knowledge, but cannot fix the problem. Thanks for any help in

Re: I need help for multidimensional loop

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 12:08 PM, pyotr filipivich wrote: Growth Hacking Formation on Sun, 26 Jan 2020 12:36:05 -0800 (PST) typed in comp.lang.python the following: Hi guys, I need your help please to sold a complicate problem. It is difficult for me to find the solution but in fact, I am sure it is

PEP-Dilbert

2020-01-26 Thread DL Neil via Python-list
Looks as if Dilbert is about to draft a PEP to change Python's world-view: https://dilbert.com/strip/2020-01-24 Curiously, "canard" whilst a French word for "duck", in English describes a rumor or false-story! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 196, Issue 26

2020-01-27 Thread DL Neil via Python-list
On 28/01/20 5:17 AM, Michael Torrie wrote: On 1/27/20 12:03 AM, אורי wrote: Please don't reply to digest. Replying to a digest is just fine. Just make sure to change the subject line in the future so people know what it's referring to. Excepting that whilst this practice (subject to

Re: Help on dictionaries...

2020-01-29 Thread DL Neil via Python-list
On 30/01/20 2:14 PM, Souvik Dutta wrote: Hey I was thinking how I can save a dictionary in python(obviously) so that the script is rerun it automatically loads the dictionary. Perhaps a YAML or JSON file (which follow a very similar format and structure to Python dicts), or a 'NoSQL'

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-29 Thread DL Neil via Python-list
On 30/01/20 10:38 AM, jkn wrote: On Wednesday, January 29, 2020 at 8:27:03 PM UTC, Chris Angelico wrote: On Thu, Jan 30, 2020 at 7:06 AM jkn wrote: I want to be a able to use a simple 'download manager' which I was going to write (in Python), but then wondered if there was something suitable

Was: Dynamic Data type assignment

2020-01-29 Thread DL Neil via Python-list
Further thoughts on the OP's point:- On 29/01/20 4:51 PM, sushma ms wrote: ... But why can't we make output of input also dynamic data assignment. ... when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw

Re: How to instlal pyodbc, without pip

2020-02-04 Thread DL Neil via Python-list
On 5/02/20 6:34 AM, dcwhat...@gmail.com wrote: Pip won't work on my desktop, because of the firewalls we have set up. I have the version from github. Assuming my Python 3.8.1 Home Directory is C:\Python, How can I install pyodbc pyodbc-master.zip? Which folders should I unzip it into?

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-30 Thread DL Neil via Python-list
On 30/01/20 9:35 PM, R.Wieser wrote: MRAB's scheme does have the disadvantages to me that Chris has pointed out. Nothing that can't be countered by keeping copies of the last X number of to-be-dowloaded-URLs files. That's a good idea, but how would the automated system 'know' to give-up on

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-02-01 Thread DL Neil via Python-list
On 2/02/20 1:00 AM, R.Wieser wrote: As sent to the OP. I appreciate these discussions, in the expectation of learning something-new. (and with rust-removal paints at the ready!) Indeed. Even if its just a different POV which makes you rethink the reasons of your own one. +1 -- Regards =dn

Re: Please answer fast.....

2020-02-02 Thread DL Neil via Python-list
On 3/02/20 7:05 AM, Abdur-Rahmaan Janhangeer wrote: ... suggest you put names, birthday in csv the load csv for each row: layout.addWidget(QLabel) On Sun, 2 Feb 2020, 21:21 Souvik Dutta, wrote: Because i want to show the name and date of 40 persons and their birthdays. Why csv?

Re: A small quiz

2020-01-23 Thread DL Neil via Python-list
On 23/01/20 9:54 PM, Z wrote: what is PLR? Context? Trolling? What does this have to do with Python? https://duckduckgo.com/?q=meaning+plr=ffab=web -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread DL Neil via Python-list
On 29/01/20 4:51 PM, sushma ms wrote: Thanks a lot. But why can't we make output of input also dynamic data assignment. 1 please don't 'top post': the normal sequence of a conversation is question THEN answer! 2 ambiguity! It is not possible for the input() mechanism to tell whether you

The source of the PSL*

2020-02-02 Thread DL Neil via Python-list
Is there a set location for PSL project repos? (it used to be GitHub, and before that, Google) I'd like to review some serious PyTest/Unittest examples, eg as are applied to familiar (Python source) library members... * should be easier to find than was the source of the Nile (by Europeans)

  1   2   3   >