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

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 b

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, (spoiler

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 pro

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

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 applicatio

Re: OT: Using a fake Gmail address is probably not a good idea

2019-09-16 Thread Max Zettlmeißl via Python-list
On Mon, Sep 16, 2019 at 1:56 PM Skip Montanaro wrote: > Mails for someone here who goes by the handle "ast" with a fake > address of [email protected] keep landing in my Gmail spam folder. I > suspect the same is true for all people subscribed to python-list who > use Gmail. Gmail (correctly, I think

Re: python is bugging

2019-09-21 Thread Brian Oney via Python-list
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 indented block mean? It means that the line of code belongs to a certain body as defined above its position

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 in

HELP NEEDED application error 0xc000005

2019-09-25 Thread arshad ali via Python-list
Note: Forwarded message attached -- Original Message -- From: "arshad ali"[email protected] To: [email protected] Subject: HELP NEEDED application error 0xc05--- Begin Message --- Respected sir, In my laptop with windows 7 ultimate 64 bit, when python 3.7.4 executab

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 the

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: https://learn.adafruit.com/character-lcds/python-circuit

Interesting performance question

2019-09-29 Thread Anthony Flury via Python-list
I have just noticed an oddity : Using python 3.6 building a tuple like this : my_tuple = tuple([x*x for x in range(1,1000)]) is about 1/3 quicker than     my_tuple = tuple(x*x for x in range(1,1000)) Measurements : $  python3 -m timeit 'my_tuple = tuple([x*x for x in range(1,1000)])' 1

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 bef

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: 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 the

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 <[email protected]> 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. ⁰ https

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 <[email protected]> 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-09-30 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 <[email protected]> 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-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 <[email protected] > wrote: In the totality of a Path object that claims to represent paths to files, It represent

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:[email protected]>> 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

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, c

Re: from ./.. import

2019-10-04 Thread Jon Ribbens via Python-list
On 2019-10-04, Hongyi Zhao wrote: > See this file: > https://github.com/hongyi-zhao/dotbot/blob/master/dotbot/messenger/ > messenger.py > > It has the following codes: > > from ..util.singleton import Singleton > from ..util.compat import with_metaclass > from .color import Color > from .level imp

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, [email protected] 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 try

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, [email protected] wrote: dieter於 2019年10月8日星期二 UTC+8下午1時33分20秒寫道: [email protected] 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, y

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 --

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, [email protected] wrote: [email protected]於 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

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). Du

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 i

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 such

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-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 f

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 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: 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 expansio

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 myfile:

Re: Black

2019-10-23 Thread DL Neil via Python-list
On 22/10/19 3:18 AM, [email protected] 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( info.s

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 t

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: a regex question

2019-10-25 Thread Brian Oney via Python-list
On October 25, 2019 12:22:44 PM GMT+02:00, Maggie Q Roth wrote: >Hello > >There are two primary types of lines in the log: > >60.191.38.xx/ >42.120.161.xx /archives/1005 > >I know how to write regex to match each line, but don't get the good >result >with one regex to match both

Multi-language programing playground

2019-10-25 Thread Vishal Rana via Python-list
Folks, I wanted to share a multi-language programming playground that I created recently. I hope you will find it useful. https://code.labstack.com/program Thanks -- https://mail.python.org/mailman/listinfo/python-list

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 abou

ANN: distlib 0.3.0 released on PyPI

2019-10-29 Thread Vinay Sajip via Python-list
I've recently released version 0.3.0 of distlib on PyPI [1]. For newcomers,distlib is a library of packaging functionality which is intended to beusable as the basis for third-party packaging tools. The main changes in this release are as follows: * Partially addressed #102: modules attribute of

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: 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, fe

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:[email protected]>> 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 Python

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 m

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Colin McPhail via Python-list
> On 7 Nov 2019, at 03:24, Veek M wrote: > > Could someone suggest some introductory reading material that will allow > me to use 'telnetlib' with 'ssl' or 'ssltelnet'. > (currently using Pan since Knode is dropped on Debian) > > I'm trying to write something that will download the NNTP hea

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Jon Ribbens via Python-list
On 2019-11-07, Veek M wrote: > Could someone suggest some introductory reading material that will allow > me to use 'telnetlib' with 'ssl' or 'ssltelnet'. > (currently using Pan since Knode is dropped on Debian) > > I'm trying to write something that will download the NNTP headers over > TLS.

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 links.

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 professional

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-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 ML/AI

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:[email protected]>> wrote: Is the pr

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 m

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 the

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 prod

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 -- https

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 q

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: 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, I

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 = soup.find("span",{"id":"priceblock_d

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

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 and

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 me

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 proje

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 cl

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, [email protected] 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: Trace

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: 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, [email protected] 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 th

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, storage

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 lint

Re: 3rd party mail package

2019-12-13 Thread Brian Oney via Python-list
How about a 1st party package in the stdlib? >From the hip: Take an example or two from the 'python 2 or 3 standard library >by example' book by a guy named Doug. Hth (really) -- https://mail.python.org/mailman/listinfo/python-list

Problem Running Python

2019-12-16 Thread Patrick Igwilo via Python-list
Hello,I downloaded and tried installing Python 3.8.0 on my windows 8.1 PC from the websitewww.python.org/downloadsAfter the 32-bit version was automatically downloaded and I successfully installed same (even though my PC has a 64-bit CPU), I tried opening the installed program and I got an erro

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 line

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 ha

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 -- https://mail.python.org/mail

Re: strptime for different languages

2019-12-17 Thread Jon Ribbens via Python-list
On 2019-12-17, Ulrich Goebel wrote: > I need to interpret a date string to get a datetime object. That should > be done with strptime from the module datetime. > > But I don't know enough about the locale settings from where the date > sting comes. Actually the date_string cames from different c

INHERITANCE in python3

2019-12-18 Thread vahid asadi via Python-list
HI guys this is my first post on python mailing lists ever and i glad to do this. my problem here is why this attribute is not recognize by python and it raise an traceback error that said 'there is no such p.family attribute'. although i use multiple   inheritance with 'super ' it not works. th

Unable to install "collect" via pip3

2019-12-20 Thread Mahmood Naderan via Python-list
Hi I can install collect with pip for python2.7 $ pip install --user collect Collecting collect Using cached https://files.pythonhosted.org/packages/cf/5e/c0f0f51d081665374a2c219ea4ba23fb1e179b70dded96dc16606786d828/collect-0.1.1.tar.gz Collecting couc

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, [email protected] 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 met

Re: Unable to install "collect" via pip3

2019-12-22 Thread Mahmood Naderan via Python-list
Yes thank you. The package is not compatible with 3.x. Regards, Mahmood On Saturday, December 21, 2019, 1:40:29 AM GMT+3:30, Barry wrote: > On 20 Dec 2019, at 15:27, Mahmood Naderan via Python-list > wrote: > > Hi > > I can install collect with pip for

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 (took

Re: Most elegant way to do something N times

2019-12-23 Thread DL Neil via Python-list
On 24/12/19 1:04 PM, Chris Angelico wrote: On Tue, Dec 24, 2019 at 10:45 AM Marco Sulla wrote: I encounter with cases like doing a function 6 time with no argument, or same arguments over and over or doing some structral thing N times and I dont know how elegant I can express that to the cod

RE: Most elegant way to do something N times

2019-12-23 Thread Avi Gross via Python-list
I would like some examples of how one does what is requested in some other programming languages. I doubt there is much need of a shorter way to do anything N times and throw away any return values. Python has many ways to do just about anything. It has some features which suggest a particular way

Re: Lists And Missing Commas

2019-12-23 Thread DL Neil via Python-list
On 24/12/19 1:48 PM, Tim Daneliuk wrote: If I do this: foo = [ "bar", "baz" "slop", "crud" ] Python silently accepts that and makes the middle term "bazslop". BUT, if I do this: foo = [ "bar", "baz" 1, "crud" ] or this: foo = [ "bar", 2 1, "crud" ] The interpreter throws a s

RE: Most elegant way to do something N times

2019-12-23 Thread Avi Gross via Python-list
uments or multiple arguments or even varying numbers of arguments with varying numbers of positional and keyword arguments. You need to be careful at times to make sure that the calls are not evaluated once but each time. I suspect the request boils down to wanting yet another keyword or two added t

Re: Lists And Missing Commas

2019-12-23 Thread DL Neil via Python-list
On 24/12/19 3:35 PM, Chris Angelico wrote: On Tue, Dec 24, 2019 at 12:56 PM DL Neil via Python-list wrote: However, your point involves the fact that whereas: 1 + 2 # 3 is *clearly* addition, and "a" + "b" # "ab" is *clearly* concatenation "

Re: Lists And Missing Commas

2019-12-23 Thread DL Neil via Python-list
On 24/12/19 5:20 PM, Tim Daneliuk wrote: On 12/23/19 7:52 PM, DL Neil wrote: WebRef: https://docs.python.org/3/reference/lexical_analysis.html Yep, that explains it, but it still feels non-regular to me. From a pointy headed academic POV, I'd like to see behavior consistent across types. A

RE: Lists And Missing Commas

2019-12-24 Thread Avi Gross via Python-list
-Original Message- From: Python-list On Behalf Of Tim Daneliuk Sent: Monday, December 23, 2019 11:22 PM To: [email protected] Subject: Re: Lists And Missing Commas On 12/23/19 8:35 PM, Chris Angelico wrote: > On Tue, Dec 24, 2019 at 12:56 PM DL Neil via Python-list > wrote: >>

Re: Most elegant way to do something N times

2019-12-24 Thread Marco Sulla via Python-list
al example? > > File parsing. You read a section header and want to ignore that > section, so you ignore the next 15 lines. mmap and find? On Tue, 24 Dec 2019 at 01:35, DL Neil via Python-list wrote: > Taking the top/bottom six from a sorted list of occurrences. Slicing? -- https://mail.python.org/mailman/listinfo/python-list

Lists And Extra Commas at end

2019-12-24 Thread Avi Gross via Python-list
nd Missing Commas On Tue, 24 Dec 2019 at 19:05, Avi Gross via Python-list wrote: > There are some lint programs that check your code and supply warnings > and I see some languages have the option to generate warnings when the > two strings are on the same line. I wonder if a Python

<    31   32   33   34   35   36   37   38   39   40   >