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
ltime( info.st_mtime ) ) black version mtime = time.asctime(time.localtime(info.st_mtime)) Is there a reason why PEP8 doesn't like these spaces? FYI: Python Bytes pod-cast "Episode #153: Auto format my Python please!" https://pythonbytes.fm/episodes/show/153/auto-for

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 relivi

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

ANN: distlib 0.3.0 released on PyPI

2019-10-29 Thread Vinay Sajip via Python-list
g non-ASCII characters. The updated launchers now also support  relative paths (see http://bit.ly/2JxmOoi for more information). * Fixed #127: Allowed hyphens in flags in export specifications. * Changed Python version handling to accommodate versions like e.g. 3.10  (no longer assume a version X.Y where

Friday finking: TDD and EAFP

2019-10-31 Thread DL Neil via Python-list
rush, nut-shell) However, I quite possibly like yourself, come from a time-before - before TDD, and before Python. So, have had to not only learn these things, but sometimes, un-learn points and habits (if not vices). Accordingly, I came (quite unknowing of the term, or that there might be an al

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

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

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

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
ogant, in some parts of the world - Kiwi/Aussie humor as often involves insult (which is not meant to be taken seriously) as it does self-deprecation - Self-deprecation is not 'the American way'... - Monty Python humor is its own (lack of) explanation! That said, I am asking (elsewhere, bu

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 potenti

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
en an uptick in questions 1) where we don't know who you (and several other recent posters) are: - The pyc.ode domain-name of your email address isn't a real/registered domain - there doesn't seem to be much evidence of you being part of the Python community wi

Re: Extract sentences in nested parentheses using Python

2019-12-02 Thread DL Neil via Python-list
tools or techniques which may help/save you from 'reinventing the wheel' - when you think about it, a re-statement of open-source objectives. How does the Python interpreter break-down Python (text) code into its constituent parts ("tokens") *including* parentheses? Such are m

Re: Unicode filenames

2019-12-06 Thread DL Neil via Python-list
. Not sure how to proceed here. Hoping for a guideline! (I'm guessing that) the "both arguments" relates to expanduser() because this is the first time that the fileNM has been identified to Python as anything more than a string of characters. [a fileNM will be a string of c

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: Error getting data from website

2019-12-06 Thread DL Neil via Python-list
7;there's nothing there' (roughly!) to print(). The question then becomes: "why?" or "why not?"... With a short piece of code like this, and (I am assuming) trying-out a library for the first time, may I recommend that you use the Python REPL, because it allows you to 

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
ename and puts into an emacs buffer, and then lets me add information to that new file (it's a poor man's DB). Next, I can look up text in the file and open the saved filename. Everything works great until I hit those darn unicode filenames. ... Do you get the error with python 3? I

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
quation. I meant to run *just* an interpreter, namely, the interactive shell built into Python itself. IOW, run just "python" (or python3) on a command line and a shell should open in which you can run the line in question. (remember to define "time" appropriately) From respon

Re: Aw: Re: stuck on time

2019-12-08 Thread DL Neil via Python-list
e code from the project I am trying to do This is showing a severe lack of understanding in how Python itself operates, leading me to recommend rereading a Python tutorial book before attempting to hack into some one else's code. +1 (in other words, agreement with others who have suggested

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

2019-12-08 Thread DL Neil via Python-list
oduleNM import moduleNM as aliasNM; is also available! WebRefs: A comfortably readable expansion of the above: https://www.digitalocean.com/community/tutorials/how-to-import-modules-in-python-3 Python's view of (import-able) modules: https://docs.python.org/3/tutorial/modules.html Other

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

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

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

2019-12-09 Thread DL Neil via Python-list
test() ... I went through this cycle of thinking, first using if __name__... to 'hide' testing, then adding test functions within the module, and now keep test code quite separate from 'the real thing'. In fact, PyTest (for example) will auto-magically look for test-code in

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

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

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

2019-12-16 Thread DL Neil via Python-list
e* name for the variable, regardless of if it is a compounded one or not. As said, the type prefix is just a reminder. Remember that PEP-8 is (only?) applied to code submitted for inclusion in the Python Standard Library. It's wider application is less prescriptive (although many in-hou

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

Unable to install "collect" via pip3

2019-12-20 Thread Mahmood Naderan via Python-list
1e179b70dded96dc16606786d828/collect-0.1.1.tar.gz Collecting couchdbkit>=0.5.7 (from collect) Using cached https://files.pythonhosted.org/packages/a1/13/9e9ff695a385c44f62b4766341b97f2bd8b596962df2a0beabf358468b70/couchdbkit-0.6.5.tar.gz Complete output from command python setup.py e

Re: How to combine a group of lists together

2019-12-20 Thread DL Neil via Python-list
27;iOS', '(Last', 'OS', 'info:', 'IOS', '11)'] ['September', '2017'] They have a shared name 'spe', but no concrete names for each list. If I use spe[0], I can only get all the first element of each list. How can

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 i

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

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, "cru

RE: Most elegant way to do something N times

2019-12-23 Thread Avi Gross via Python-list
" Using R, again, you can make a repeat function that calls your designated function with a fizxed argument N times: repetito = function(n, func, arg) { for (i in 1:n) { func(arg) } } repetito(6, print, "hi") [1] "hi" [1] "hi" [1] "hi" [1] &

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
ring something like this: const int volume = 5 * 6 * 7 Would it not be possible that the compiler, knowing this is a constant, would not pre-calculate the result and act as if you had written: const int volume = 210 The run time, would not know or care. So, if the analogy mak

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
Marco, Python is used by some in an interactive mode but also in more of a batch mode such as on a server. The former can possibly see a SyntaxWarning. Do you want that as a default or something you set when you start the Python Interpreter or perhaps a command within it? I note a brief search

Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 22:51, Avi Gross via Python-list wrote: > So, is that a feature you want warnings about? After all, a dangling comma > may simply mean you left something out and meant to add later? .completely OT. I responded to a topic named "List and missing commas"

Re: Lists And Missing Commas

2019-12-24 Thread Marco Sulla via Python-list
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 lint does that. It may

Re: More efficient/elegant branching

2019-12-24 Thread Marco Sulla via Python-list
e you have more complicated checks. Mine was only a suggestion to introduce the simple C switch-case in Python, for making easier trivial if-elif chains and for code optimization (C switch-case is optimized by C compilers) # Of topic - END -- https://mail.python.org/mailman/listinfo/python-list

RE: Lists And Extra Commas at end

2019-12-24 Thread Avi Gross via Python-list
convenience is in some sense removing a mathematical symmetry, but so what? -Original Message- From: Cameron Simpson Sent: Tuesday, December 24, 2019 5:12 PM To: Avi Gross Cc: [email protected] Subject: Re: Lists And Extra Commas at end On 24Dec2019 16:48, Avi Gross wrote: >

Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
n.org/mailman/listinfo/python-list

Re: Most elegant way to do something N times

2019-12-24 Thread Marco Sulla via Python-list
imes? > > > This > > > seems to me not elegant in primis. > > > > > > Can you give us a practical example? > > > > File parsing. You read a section header and want to ignore that > > section, so you ignore the next 15 lines. > > mmap and find? >

Re: [Q] __init__ in class

2019-12-26 Thread DL Neil via Python-list
On 27/12/19 12:11 AM, 황병희 wrote: in making class, why we should set "__init__"? so non-init class is useless? actually i did fail to understand __init__'s meaning. what is role of __init__ in class. sincerely, from python beginner. Please be aware that there is a Python Tutor

Re: [Q] __init__ in class

2019-12-26 Thread DL Neil via Python-list
heir contents: pointA = Point(10, 15) pointB = Point(-3, 38) pointA.show() printB.show() Is this a/the pythonic way to access attributes? It appears Java-like, or some other language transliterated into Python. Further, the naming convention suffers similar heritage. What was not shown

Error in python installation

2019-12-27 Thread Kishor Soni via Python-list
Hello I have Intel DH61 series mother board, with Windows7 64bit + SP1 + some debugging components ( as shown in microsoft website, as service pack for W7) however when I try to install current version of python, it displays error. See the screenshot attached herewith. (board configuration

Grepping words for match in a file

2019-12-28 Thread Mahmood Naderan via Python-list
t purpose? -- Regards, Mahmood -- https://mail.python.org/mailman/listinfo/python-list

Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
its data-fields' names. Today, such artifice is unnecessary, given that code-editors (normally) offer one-click access from reference to source - even spanning multiple Python modules. [another, "oh yeah"!] So, do you have an orderly method [hah!] for presenting/locating class-met

Re: Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
"Define before use" is a broad principle that I try to follow, even when the code itself doesn't mandate this. IMO it makes the code easier to navigate even when it's not strictly necessary. As others have said, Python mandates that the functions be defined before they&#

Re: Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
+1 Should __new__() and __init__() break with convention because its/their method/function signature is (really) part of the class's signature, and thus there's a need for proximity? (aka is "expected") -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Grepping words for match in a file

2019-12-28 Thread DL Neil via Python-list
On 29/12/19 5:14 AM, Dan Sommers wrote: On 12/28/19 12:29 AM, Mahmood Naderan via Python-list wrote: Hi I have some lines in a text file like ADD R1, R2 ADD3 R4, R5, R6 ADD.MOV R1, R2, [0x10] If I grep words with this code for line in fp: if my_word in line: Then if my_word is "ADD&qu

Re: Friday Finking: Source code organisation

2020-01-01 Thread DL Neil via Python-list
the bottom to find if...__main___, but is then directed to search for the def main... which is all the way back up to the top! 2 if instead of a main(), that code was under if ... __main__ would that be an equally reasonable and "obvious" place to find it? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Source code organisation

2020-01-02 Thread DL Neil via Python-list
e a word/name which catches the eye and has 'importance' attached. However, the Python idiom is "if __name__ == '__main__'" and (paradoxically?) that usually goes at the 'bottom'. I think we've previously discussed if __name__ == '__main__

Re: heap enhancements

2020-01-03 Thread DL Neil via Python-list
ter. Have you run any time-trials to establish whether the code is 'fast' or 'slow'? Recommended reading: 1 supporting the above, including PEP-8 2 supporting the above 3 writing program(me)s so that others can read them 4 search for "Python heap" 5 download an

Re: Python, Be Bold!

2020-01-06 Thread DL Neil via Python-list
ssible interest: Episode #245: Python packaging landscape in 2020 https://talkpython.fm/episodes/show/245/python-packaging-landscape-in-2020 -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Removing reference to local installed package

2020-01-07 Thread DL Neil via Python-list
On 8/01/20 8:53 AM, Abdur-Rahmaan Janhangeer wrote: Greetings everybody, Salaam, I installed a local package using python -m pip install Now if you install the same package from pypi, it says requirements already satisfied pointing to the location of the local package folder instead of

Re: [Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Andrew Barnert via Python-list
have any idea who to trust to get it right.) -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Andrew Barnert via Python-list
A package manager like Homebrew or Choco can take care of that by just making my app’s package depend on the PortAudio package (and maybe even conda can?), but I don’t see how zipapps with wheels in, or anything else self-contained, can. And if most such packages eventually migrate to binding fro

Coding technique: distinguish using type or abc?

2020-01-08 Thread DL Neil via Python-list
ck through the code-base... Meantime, faced with such a challenge, would you recommend utilising one of these ideas over the other, or perhaps some other solution? Are there perhaps circumstances where you would use one solution, and others the other? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Understanding of GIL

2020-01-16 Thread Amitesh Sahay via Python-list
Hi, You should also undertand that Python uses GIL for Threading purpose. Yes, if you have functiosn that needs simulataneous execution you should use Threading approach. As well as if Huge data is involved then also use multi-processing concept as well On Thursday, 19 December, 2019

Extension type inherit from Python int

2020-01-16 Thread Mathias Enzensberger via Python-list
yLongObject. Has anyone already done something like that? Is there some trick to work around that issue, or is it simply not possible to inherit from PyLongObject? Thank you, Mathias -- https://mail.python.org/mailman/listinfo/python-list

Re: problem

2020-01-17 Thread DL Neil via Python-list
On 18/01/20 7:39 AM, mrunali wrote: I am face a problem to download MySQL for python as well as I can not able to install kivy on my laptop . please give me solution for it . Sent from Mail for Windows 10 How did you try to download MySQL? Which MySQL Connector? What was the error message

Re: Modules Objects in Python

2020-01-18 Thread DL Neil via Python-list
On 19/01/20 2:51 PM, M.R.P. wrote: Are modules objects in python? Modules offer an independent namespace implemented by a dictionary object - so you may dir() (or help()) and moduleNM.__dict__, and thus pick-up data values and code-units. So, they have many characteristics and behaviors

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Jon Ribbens via Python-list
want to do this you need to write your own interpreter that runs your own domain-specific language. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to hide warning about drop table message to MariaDB

2020-01-19 Thread DL Neil via Python-list
On 20/01/20 4:35 AM, Python wrote: ^Bart wrote: I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor()

Re: problem with python 3.8.1

2020-01-20 Thread DL Neil via Python-list
udent - if so, where? This is a volunteer community. Help us to help you... Which Operating System? From where are you downloading Python? What did you do (that appeared to work)? What was the error message? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: TensorFlow with 3.8.1

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 6:13 PM, Fahad Qayyum wrote: Hello, Hope this email finds you well. I am having an issue with the installation of TensorFlow on python 3.8.1. I want to work on TensorFlow, please let me know how can I install it. Give me the compete guide if possible. Hi, and welcome to the Python

Re: installation issue.

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 8:13 PM, NIT Application wrote: Hi Team, I am not able to select the path on command prompt. It gives me an error that python is not recognized as an internal or external command. Please help me with this to set up and perform my activities. Regards, Sandesh Kamble Hi, and

Re: Python login screen for MariaDB db

2020-01-20 Thread DL Neil via Python-list
On 21/01/20 8:37 AM, ^Bart wrote: I found this article: https://www.simplifiedpython.net/python-gui-login/ I used PDO on PHP 7.3 with last MariaDB engine but I'd like to start to use Python for a local warehouse software, I found the above guide but I need to understand what I should re

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
. There is > no other conclusion. > >> My only explanation is that mytup is, actually, a pointer to a tuple; the >> pointer can't change, but the contents of that pointer (or the data to >> which the pointer points) can change. > > Incorrect. Python simply doesn't hav

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 8:01 AM Jon Ribbens via Python-list > wrote: >> On 2020-01-21, Chris Angelico wrote: >> > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker >> > wrote: >> >> I am left concluding that mytup

Re: Terry Jones

2020-01-22 Thread DL Neil via Python-list
On 23/01/20 11:32 AM, Terry Reedy wrote: On 1/22/2020 2:49 PM, Stefan Ram wrote: |Terence Graham Parry Jones (1 February 1942 – 21 January |2020) was a Welsh actor, writer, comedian, screenwriter, film |director and historian. He was a member of the Monty Python |comedy team. ... |After living

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&t=ffab&ia=web -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

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: I need help for multidimensional loop

2020-01-26 Thread DL Neil via Python-list
ve of erostothenses using arrays in integers [0..maxint] in size. +1 Unfortunately, (given that this is a Python list) I would suggest that (full-fat) SQL already offers solutions to such 'relationship issues'. (hah!) I'm not sufficiently familiar with SQL-Lite to know if/how well

Re: Nested Loop Code Help

2020-01-26 Thread DL Neil via Python-list
one 'inside' the other) - or the email messed-up the indentation. However, why "nest" or have more than one loop, in any case? >>> for i in range( 0, 10 ): ... print( "*"*i ) ... * ** *** * ** *** **** ***** -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

<    40   41   42   43   44   45   46   47   48   49   >