WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
the above policy/laziness, and thus this "Wednesday Wondering": - modules aside, how often do we write multiple-entry code these days, as opposed to having multiple scripts/main-lines which call re-usable functional modules, as-and-when? I still don't have a single file containing a combination script/module amongst my applications. Do you? Why/who/how/when? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
So, second debug would be to remove the 'UNSEEN' criteria and observe any difference. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
this. However, I'll make a note to test... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: WedWonder: Scripts and Modules

2019-09-12 Thread DL Neil via Python-list
you characterise it as a common project structure? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
l", use symlinks - just as we do with python/python2/python3/python3.7... Note that it has become unnecessary to add the -m switch! Accordingly, very short entry-point scripts have been working for me. (recognising that Python is used in many more application-areas than do I!) Do you see a reason/circumstance when this practice might break-down? Ref: Mastering Object-oriented Python, S Lott Copyright © 2014 Packt Publishing -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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 Gmai

Re: python is bugging

2019-09-21 Thread Brian Oney via Python-list
defined above its position. Please follow the tutorial. https://docs.python.org/3/tutorial/index.html -- https://mail.python.org/mailman/listinfo/python-list

Re: python is bugging

2019-09-21 Thread DL Neil via Python-list
original question: Is the (loop) code actually indented? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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 py

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

2019-09-26 Thread DL Neil via Python-list
nts for the message() and/or string() methods - particularly the number of arguments and their data-type(s). -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-09-26 Thread DL Neil via Python-list
ent' which enables development on a 'bigger PC', for later delivery=download to the SBC? It might make coding and unit-testing a bit easier (although perhaps not when specific (display) hardware enters the picture). -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Interesting performance question

2019-09-29 Thread Anthony Flury via Python-list
resizing issue, since the list comprehension wont predict the final size of the list ahead of time. Is there a good explanation of the performance difference - I don't think that the memory resizing overhead is the whole answer. -- Tony Flury -- https://mail.python.org/mailman/listinfo/python-list

pathlib

2019-09-29 Thread DL Neil via Python-list
ore* ls: cannot access 'before*': No such file or directory I would expect pathlib to keep track of changes it has made. Any ideas/good reasons why/why not? NB "name" is a r/o attribute. -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-09-30 Thread DL Neil via Python-list
the discussion, I'd like to re-read the docs with that in-mind, first... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
9904293) ### f2 is a path which represents a real-world file though ### where have we seen those numbers before? > It still represents the path to the file, not the file itself, and if > you move something over it, it will see the new file. I like this description. Thanks! That said, maybe pathlib should have stuck with paths/PurePaths, and we should have something else (logically separate, but closely-related) which manipulates the files themselves? (preferably OO, and tidying-up/offering an alternative to the morass of os, os.path, sys, shutil, and ?others) -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
lp() docs don't though) That said, if pathlib is not really 'for' file system operations, or only handles some of such (and not other(s) that I would like), then I'll happily go back/go elsewhere; and the great thing is that we are free to make up our own minds and to do things differently from each-other, if we want. ie YMMV! I've learned a lot from this discussion. Thanks! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
import Color > from .level import Level > > I just cannot figure out why they using the ``from ./.. import'' to > import modules. Why wouldn't they be? That's how you import things from the current/parent package. -- https://mail.python.org/mailman/listinfo/python-list

Re: Formatting floating point

2019-10-07 Thread DL Neil via Python-list
-strings, it is also (likely to be) important that we READ and comprehend the older/alternatives! NB politesse suggests that I should apologise, but I no-longer wish to work with Python2; hence only mentioning Py3 'here'. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-10-07 Thread DL Neil via Python-list
try to get around them, sooner or later you'll 'forget' and trip yourself up. Recommend your first idea! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-10-08 Thread DL Neil via Python-list
inal author intends the package/module for you to download, why does (s)he choose to follow an non-Pythonic naming convention? Does this say something about the author? - something about his/her abilities in Python? - the Python-friendliness (or otherwise) of GitHub? (cf PyPi) -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
org/mailman/listinfo/python-list

Instantiating sub-class from super

2019-10-14 Thread DL Neil via Python-list
https://mail.python.org/mailman/listinfo/python-list

Re: Instantiating sub-class from super

2019-10-14 Thread DL Neil via Python-list
, MaleOBJ ~ M PersonOBJ ~ <__main__.Male object at 0x7f014085bdd0> Person __class__ ~ PersonID ~ Respondent I am secure in my man-hood Pulling on tights and donning cape... F, FemaleOBJ ~ F PersonOBJ ~ <__main__.Female object at 0x7f014085bdd0> Person __class__ ~ PersonID ~ Respondent Thy name is vanity Pulling on tights and donning cape... Traceback (most recent call last): File "person.py", line 58, in p.male_only() # Exception AttributeError: 'Female' object has no attribute 'male_only' -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
be None) rather than subclasses. Which seems to be the way we're headed... Thanks! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
ib, for example). If someone takes *my* code and tries to run it on MS-Win Python, they'll soon find-out! That said, I'm not expecting to publish any results with the expectation of world-domination... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Black

2019-10-21 Thread DL Neil via Python-list
l preferences is to use spaces for clarity: 1. right = mystr[ start : ] black version right=mystr[start:] 2. mtime = time.asctime( time.localtime( info.st_mtime ) ) black version mtime = time.asctime(time.localtime(info.st_mtime)) Is there a reason why PEP8 doesn&

Re: TypeError: unhashable type: 'list'

2019-10-23 Thread DL Neil via Python-list
r first comment above), the string.find() method could be employed (replacing "state 1"), and then (implicit assumption about spacing here) "state 2" becomes a matter of moving a few characters 'along', before grabbing the total; rinse and repeat... Web-ref: https://en.wikipedia.org/wiki/Finite-state_machine -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Black

2019-10-23 Thread DL Neil via Python-list
mat-my-python-please (topic nr6) NB I have not listened to it. [via PlanetPython] Apparently informed by blog article: "written on 06/02/2018 Auto formatters for Python 👨‍💻🤖" https://www.kevinpeters.net/auto-formatters-for-python -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Fursday Flippancy: American Py

2019-10-23 Thread DL Neil via Python-list
ng our youth (or for those condemned to repeat history): https://en.wikipedia.org/wiki/American_Pie_%28song%29 -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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
lt >with one regex to match both lines. What is a good result? The is an re.MULTILINE flag. Did you try that? What does that do? -- https://mail.python.org/mailman/listinfo/python-list

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
s worth review. However, I suggest that this type of solution is the preserve of the more advanced programmer/computer user. WebRefs: https://docs.python.org/3/tutorial/venv.html https://www.virtualbox.org/ -- Ciao =dn -- https://mail.python.org/mailman/listinfo/python-list

ANN: distlib 0.3.0 released on PyPI

2019-10-29 Thread Vinay Sajip via Python-list
/distlib.readthedocs.io/en/0.3.0/[3] https://bitbucket.org/pypa/distlib/issues/new -- https://mail.python.org/mailman/listinfo/python-list

Friday finking: TDD and EAFP

2019-10-31 Thread DL Neil via Python-list
ail/python-dev/2014-March/133118.html https://docs.python.org/3/glossary.html#term-lbyl Latin/legal term "compos mentis" https://www.thefreedictionary.com/compos+mentis English slang term "nuts": https://www.thefreedictionary.com/nuts -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-11-01 Thread DL Neil via Python-list
Python has a wonderful philosophy, that its "for" loop is NOT a means of counting repetitions from 'here' to 'there' eg zero?one to 10. It is a superior (IMHO) piece of language-design: a for-each construct. It is nicely illustrated as: for each element in a list, do 'something'. Accordingly, this perhaps-venerable ComSc problem is not helpful when learning Python, even if Python will (happily) solve said problem! WebRefs: https://simonsinek.com/product/start-with-why/ https://en.wikipedia.org/wiki/Functional_decomposition https://en.wikipedia.org/wiki/Eureka https://docs.python.org/3/reference/compound_stmts.html https://docs.python.org/3/library/operator.html -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
> OVER telnet and it didn't work. Apparently you need to pass the TLS > context to telnetlib or vice versa. > ... Any reason you're not using nntplib from the Python Standard Library? It supports the STARTTLS command. If you don't want to use nntplib you could look at its code to see how it works. -- Colin -- https://mail.python.org/mailman/listinfo/python-list

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

2019-11-07 Thread Jon Ribbens via Python-list
n't get misled by the common practice of using the command-line telnet client as a convenient way for connecting to line-based TCP services for testing purposes.) -- https://mail.python.org/mailman/listinfo/python-list

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
ted that there is a Linux distro/distribution, "Kali" (another name with opportunity for ambiguity!). Apparently, "Kali is designed for pen-testing - and there are likely many associated Python scripts, because Python is a language so well suited to fast-developing situations!". YMMV... WebRefs: https://en.wikipedia.org/wiki/Remembrance_Day https://en.wikipedia.org/wiki/Kali https://www.kali.org/ -- 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
er (non-Python) training. -- Tschüss =dn -- https://mail.python.org/mailman/listinfo/python-list

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
could also subscribe. Undoubtedly their bias is towards "Watson". Some activities enable free access to a Watson cloud... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
n, etc, etc... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Resources related with web security

2019-11-23 Thread DL Neil via Python-list
- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8 with Anaconda

2019-11-24 Thread DL Neil via Python-list
egards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Resources related with web security

2019-11-25 Thread DL Neil via Python-list
irect criticism (which, ironically-enough) is contrary to 'open' etc behavior. Previous to this, had discussed such concerns with a ListAdmin, who is taking it further. I hope we'll (soon) see something further from the Python-/List-gods... As a student of irony, I was amused at

Re: Extract sentences in nested parentheses using Python

2019-12-02 Thread DL Neil via Python-list
loop and utilising string.find() - prioritising whichever parenthesis is left-most/comes-first - assuming LtR text. (apologies if you have already tried this in one of your previous approaches) Unfortunately, such likely results in 'layers' of code, and a generator might well become the tool-of-choice (I say this before @Peter comes back and (quite deservedly) flays me alive!). WebRefs: Python Language Services: https://docs.python.org/3/library/language.html collections — Container datatypes: https://docs.python.org/3/library/collections.html See also your ComSc text/reference materials. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode filenames

2019-12-06 Thread DL Neil via Python-list
warn you that pursuing this matter involves disappearing down into a very deep 'rabbit hole', but YMMV! WebRefs: https://docs.python.org/3/howto/unicode.html https://www.dictionary.com/e/slang/rabbit-hole/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Make warning an exception?

2019-12-06 Thread DL Neil via Python-list
n/listinfo/python-list

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
ta files' being recognised/name-updated using Python3. Insert here: obligatory warning about the deprecation of Python2 at the end of this month/year... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
se just posted to Python-Tutor list: WebRefs: https://pythonprogramminglanguage.com/repl/ https://codewith.mu/en/tutorials/1.0/repl -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
likely will be success - same as for any hobby/work-project! Also, IIRC you are also short-cutting by using a Pi-Zero (designed for application and roll-out) rather than a board designed for experimentation - but I'm guessing, so again, please don't take offense. -- 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
questions answered: https://docs.python.org/3/faq/programming.html?highlight=import, eg what-are-the-best-practices-for-using-import-in-a-module The importlib library which under-pins "import": https://docs.python.org/3/reference/import.html The full-fat range of import-possibilities: https://docs.python.org/3/library/modules.html-- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-12-08 Thread DL Neil via Python-list
S-Win as part of python, so you don't need to worry about that/can quickly check. If your course has not taken you through "virtual environments" then feel free to ignore such, for now. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
uot;edge-cases". Also, if your progress in Python is ready for it, we can talk PyTest (or equivalent), plus such a plan enables you to practice Test-Driven Development... These problems stretch one's mental acuities. It would seem that I am not the only one looking forward to hearing back from you... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-12-09 Thread DL Neil via Python-list
play fast-and-loose, eg >>> x = 1 >>> x = "abc" >>> x = 2.3 >>> x = [ 1, 2, 3 ] >>> x = ( 1, 2, 3 ) >>> x = 1, 2, 3 constitutes a perfectly legal program (where "legal" != "useful"). There again, there are

Re: More efficient/elegant branching

2019-12-09 Thread DL Neil via Python-list
it is NOT immediately obvious exactly how many of the series of functions will actually result in any 'action' (if not, all of them). So, perhaps that raises the (earlier/elsewhere) question of whether the various action-functions are dependent or independent/exclusive of each other? It also requires carefully choosing descriptive function names! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
language. Many thanks for the good work. Patrick. -- https://mail.python.org/mailman/listinfo/python-list

Re: distinguishable matplotlib colours / symbols / line styles

2019-12-16 Thread DL Neil via Python-list
ns. Hmmm, note to self (you've inspired me to specifically review/critique the printing-from-screen action): what happens when we take a color-checked screen display and print same but end-up viewing it as monochrome/grey-scale output? Probably not a main-stream demand, but worth tossing at the WCAG experts... -- -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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

2019-12-16 Thread DL Neil via Python-list
nce/class release the GPIO pin, or is there another/a better way? I haven't started to 'play' with my recently-purchased SoC, but forty years after constructing my own Motorola D2 Kit (which gave me a 'computer' with binary inputs and bar-LED o/p), and much wanting to get back to systems-on-a-chip or "microcomputers", even if (only) as a hobby, I'm finally 'getting there'... So, I'd like to request further clarification: - do we need to 'release' (reset, or whatever) the GPIO pin, or - are we talking about 'disposing of' a variable which represents/holds the GPIO pin's value (as it was when 'read') - presumably in preparation to reading it again/next time? There is also a major implication here (which has been addressed as the different behavior of del()/GC within different Python implementations). Which Python are you using, under which OpSys - and if you are talking about developing in Python on a desktop, will that carry forward to the SoC or are there (material) differences in Python and/or OpSys? I've been noting various contributions to this list, on topics related to Python on/for SoCs. One of which is that there is a (at least one) specialised version (?sub-set) of Python for SoCs. NB I haven't read/done anything much further than that! You may like/need to investigate... Given that we are no longer talking about "How do I import a class...", perhaps starting a new post with significant key-words in the Subject: might encourage SoC-experienced folk to offer more knowledgeable assistance... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: distinguishable matplotlib colours / symbols / line styles

2019-12-16 Thread DL Neil via Python-list
/mailman/listinfo/python-list

Re: strptime for different languages

2019-12-17 Thread Jon Ribbens via Python-list
cames from different contact forms > inside websites made by different content management systems. So it could be >13. Januar 1965 >13. January 1965 >13.01.1965 >1965-01-13 https://pypi.org/project/dateparser/ -- https://mail.python.org/mailman/listinfo/python-list

INHERITANCE in python3

2019-12-18 Thread vahid asadi via Python-list
p = Person("v","aaa")print(p.name)print(p.family)``` -- https://mail.python.org/mailman/listinfo/python-list

Unable to install "collect" via pip3

2019-12-20 Thread Mahmood Naderan via Python-list
which python3 /usr/bin/python3 $ ls -l /usr/bin/python3 lrwxrwxrwx 1 root root 9 Jun 21 2018 /usr/bin/python3 -> python3.6 Regards, Mahmood -- https://mail.python.org/mailman/listinfo/python-list

Re: How to combine a group of lists together

2019-12-20 Thread DL Neil via Python-list
I mix all of these elements into a single list like: ['$278.86as', 'of', 'Dec', '20,', '2019,', '06:47', 'PST', '-', 'Details','4.7', 'inches'..] What is type( spe )? Please copy-paste code/session into your email msg - the above is NOT Python. Your best solution may be to use a loop (instead of the constant 0, as list-argument). The answer to your specific question is 'in the manual': list.extend() (but a loop will likely still be required...) WebRef: https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to extend an object?

2019-12-20 Thread DL Neil via Python-list
s => easier assured testing). -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
, "second" when len(z) falls below 2, etc. The class's property/ies thus simplify the SMS-transmission process/class... Appropriate name-choices will make the code self-documenting - per the 'reading' objective: if employee.worked_overtime: sms.send( "We're in the money...!" ) -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Most elegant way to do something N times

2019-12-23 Thread DL Neil via Python-list
being 'seeking section header'. 1 can we guarantee that the 'magic constant' of 15 will always apply? 2 presumably the total routine will involve more than identifying a single header and skipping (only) that section. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

RE: Most elegant way to do something N times

2019-12-23 Thread Avi Gross via Python-list
s with the arguments varying each time, can be handled many other ways too including map functions and comprehensions. I am left wondering if this is not about the real world but simply an academic exercise. -Original Message----- From: Python-list On Behalf Of Marco Sulla Sent: Monday, Decembe

Re: Lists And Missing Commas

2019-12-23 Thread DL Neil via Python-list
plemented at compile time. The ‘+’ operator must be used to concatenate string expressions at run time. Also note that literal concatenation can use different quoting styles for each component (even mixing raw strings and triple quoted strings), and formatted string literals may be concatenated with plain string literals. >>> Thus, the adjacency of two literals explicitly only implies concatenation for strings. There is no equivalent/similar mention for numbers. WebRef: https://docs.python.org/3/reference/lexical_analysis.html -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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
e web.ref) and find the section where "white space" is described. Combine that with the idea/nuisance-value of splitting long strings over multiple lines. Rather than puzzling-over an 'only/special/weird concatenation' allowance, perhaps we should see a 'convenience factor'? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

RE: Lists And Missing Commas

2019-12-24 Thread Avi Gross via Python-list
e 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 lint does that. It may at least warn of this usage in time to check the code and put back the comma.

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

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