Re: How to limit *length* of PrettyPrinter

2020-07-23 Thread dn via Python-list
t with the standard ones. This looks like fun! BTW why are we doing it: is it some sort of 'homework assignment' or are you a dev 'scratching an itch'? May I suggest a review of the first few pages/chapters in the PSL docs (Python Standard Library): Built-in Functions,

Re: Iterators, iterables and special objects

2020-07-24 Thread dn via Python-list
-- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to limit *length* of PrettyPrinter

2020-07-25 Thread dn via Python-list
e/class system, which is why I'm trying to understand it by playing with it. I accept, one might say 'on faith', that in Python "everything is an object", and proceed from there. Sorry! Similarly, I've merely accepted the limitations of pprint() - and probably use

Re: Symlinks already present

2020-07-26 Thread dn via Python-list
link. The size of a symbolic link is the length of the pathname it contains, without a terminating null byte. Thus, compare the results of the two calls to detect a difference. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Dowloading package dependencies from locked down machine

2020-07-28 Thread dn via Python-list
On 29/07/2020 07:29, J. Pic wrote: Ideas for solutions: - use pip install --user at home, copy over ~/.local/lib/python3.8/site-packages - same, but with ~/.cache/pip ...or even building an entire parallel Python environment on an Internet-connected machine (even a VM), from which the

Re: Winreg

2020-07-30 Thread dn via Python-list
On 31/07/2020 07:25, Barry Scott wrote: Use the Reply or Reply-To-All feature of your email program and it will do the rest for you. I can't find instructions for the proper way to reply to 'python list'. Is it simply a matter of keeping the message title identical to the o

Re: questions re: calendar module

2020-07-31 Thread dn via Python-list
On 31/07/2020 02:52, o1bigtenor wrote: I regularly work in planning through multiple years at once. This means that I like to have a lot of stuff available in a calendar function. Python seems to be locked when I need to display more than 1 year at a time. I don't see a way to display some

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regularly work in planning through multiple years at once. > This means that I like to have a

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:24, o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regul

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:42, o1bigtenor wrote: On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/0

Re: Python running in the Command Prompt Window questions

2020-08-02 Thread dn via Python-list
On 03/08/2020 13:52, Steve wrote: When I double click on a .py file, it executes at the command prompt with black background and small white font. Is there python code to change the font size and background color? Ctrl-Shift-+ ? === FootNote: Would it

Re: Updating a variable problem.

2020-08-04 Thread dn via Python-list
On 04/08/2020 20:38, Steve wrote: Why should line 6 fail until line 7 is commented out? Python complains that MSN is "referenced before assignment". def ReadTheEQfile(): global MSN MSN = ("1 Monitor") #This line works every time. def EditTheEQlist(): p

Re: Explicit is better than Implicit

2020-08-06 Thread dn via Python-list
On 07/08/2020 05:33, Skip Montanaro wrote: Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know what my choice would have been. :-) https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates At the risk of screaming off-topic... The

Re: Save-to-file code not quite working completely

2020-08-08 Thread dn via Python-list
ollects a list of changes to the file which will be saved to the file, as above. Further, databases have been designed for this sort of partial update scenario. If/when updates become too frequent, or the file becomes extensive, recommend you look at using an RDBMS instead of using this 'flat-file' approach... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: importlib: import X as Y; from A import B

2020-08-08 Thread dn via Python-list
On 09/08/2020 15:23, Jason Friedman wrote: I have some code I'm going to share with my team, many of whom are not yet familiar with Python. They may not have 3rd-party libraries such as pandas or selenium installed. Yes I can instruct them how to install, but the path of least resistance

Re: Save-to-file code not quite working completely

2020-08-10 Thread dn via Python-list
On 10/08/2020 05:23, Dennis Lee Bieber wrote: On Sun, 9 Aug 2020 11:50:51 +1200, dn via Python-list declaimed the following: To be a logomach, let's talk about "update":- May I advise that a 'good practice' would be to create a new file, and thus be able to (also) main

Re: Any timeline for PIL for Python 3.4

2020-08-10 Thread dn via Python-list
On 11/08/2020 16:35, Martin wrote: I am running Python 3.4.4, and would like to use the Python Imaging Library (PIL).  This is currently not available for Python Version 3.  Does anybody know when it will become available? Plan B is to install Python 2.7.18.  I just need an idea of how long I

Re: Unable to save any files

2020-08-11 Thread dn via Python-list
On 11/08/2020 21:27, Lim Clayton wrote: Hi, I am a relatively new Python User. I recently downloaded Python on my desktop and I am unable to save anything when I use IDLE. I can run codes on the shell without any issue but running anything on the window which requires saving causes nothing to

Re: Support

2020-08-13 Thread dn via Python-list
On 14/08/2020 08:31, Alexa Oña wrote: Helo, I am already subscribed. I De: Alexa Oña Enviado: jueves, 13 de agosto de 2020 18:51 Para: python-list@python.org Asunto: Support Hello, I am Alexa I have tried to install PYTHON 3.8.5, but could not install it on

Whitespace not/required

2020-08-13 Thread dn via Python-list
Although many new-comers are intrigued by the compulsory indentation rule, I have been surprised to discover that even though whitespace does not usually feature as a formatting-specification, nevertheless Python sometimes requires an absence of whitespace. Will this behavior/requirement

Re: How to install your personal module/package on site.

2020-08-14 Thread dn via Python-list
On 14/08/2020 22:32, Antoon Pardon wrote: Well the question is in the subject. I have a number of modules/packages which were until recently personal use only. However python is getting more popular at work and some of my work was considered useful enough to install in a public available spot

Re: Whitespace not/required

2020-08-15 Thread dn via Python-list
On 15/08/2020 08:01, Dennis Lee Bieber wrote: On Fri, 14 Aug 2020 16:29:18 +1200, dn via Python-list declaimed the following: it is ignored by Python. (yes, this discussion disdains comments!) For example, whitespace is no problem when it comes to defining a list: month_names = ['Ja

Re: How to install your personal module/package on site.

2020-08-15 Thread dn via Python-list
Does the word "public" mean world-wide, or perhaps only amongst your work-colleagues? Only among work-colleagues. We only want that anyone writing and running python scripts on particular hosts, can easily import these modules/packages. Of possible interest:- Private Pyth

Re: Syntax question

2020-08-16 Thread dn via Python-list
On 16/08/2020 20:12, Klaus Jantzen wrote: Hi, the other day I came across the book "Classic Computer Science Problems in Python" by David Kopec. The function definitions in the examples  like = def fib2(n: int) -> int:     if n < 2:  # base case     return n     r

Re: LittleRookie

2020-08-18 Thread dn via Python-list
i would say i'm new at programing i have a year of experience in python(but i'm tottaly a noob) i guess i'm starting to learn SQL now.What should i do to learn better and faster? Enroll in the local college and start your journey there? Successfully finish it and get an internsh

Re: LittleRookie

2020-08-19 Thread dn via Python-list
Chuck's" Programming for Everybody (Getting Started with Python) on edX, nor Paul Resnick's Python Basics on Coursera, even mention the need to provide documentation. Where did you look, that required such a formal application? A public-access course means that no pre-requisite

Re: Issue

2020-08-20 Thread dn via Python-list
On 21/08/2020 07:01, Sreelakshmi Madhu wrote: not able to open IDLE and also while running a program in cmd saved in notepad, it's showing not found such a python file. Please review the Python documentation (https://docs.python.org/3/), in particular the "Python Setup and Us

Re: Temporary text for multiple entries

2020-08-21 Thread dn via Python-list
itle that will help other beginners with similar problems to benefit from answers-given -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Matrix of size 100*100- Meghna

2020-08-21 Thread dn via Python-list
On 22/08/2020 02:17, Meghna Karkera wrote: Dear Respected Sir I am Meghna, a PhD student. I have installed python in my ubuntu OS from your website recently and tried using spyder and jupyter. May I request you to help me with importing few matrices, each of size 100*100 in python from XLSX

Re: Program chaining on Windows

2020-08-23 Thread dn via Python-list
On 23/08/2020 19:31, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, I would like one Python program to chain to another.  I.e. the first program to be replaced by the second (*not* waiting for the second to finish, as with e.g. os.system).  This doesn&#

Re: Program chaining on Windows

2020-08-23 Thread dn via Python-list
On 24/08/2020 09:04, Chris Angelico wrote: On Mon, Aug 24, 2020 at 6:39 AM dn via Python-list wrote: On 23/08/2020 19:31, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, I would like one Python program to chain to another. I.e. the first program to be

Training Review: Computational Thinking for Problem Solving

2020-08-24 Thread dn via Python-list
Many of us learn Python by memorising code-constructs and their use. Even over-coming this learning-curve is but a small portion of becoming a competent coder or programmer. The challenges of learning how to construct an algorithm, and/or how to analyse a real-world problem to produce a

Re: Output showing "None" in Terminal

2020-08-25 Thread dn via Python-list
On 25/08/2020 01:12, Py Noob wrote: Hi! i'm new to python and would like some help with something i was working on from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is my code and the terminal is showing the word "None" everytime I execute my code.

Re: About float/double type number in range.

2020-08-26 Thread dn via Python-list
r solutions - it might be quite fun to compare the performances (PSL's time library). My first thought was that the count() from the itertools library enables one to step using a floating-point number. So, herewith two generator-based solutions:- <<< Code NB Python v3.8 &g

Re: Problem

2020-09-30 Thread Mirko via Python-list
Am 30.09.2020 um 17:55 schrieb Dennis Lee Bieber: > On Tue, 29 Sep 2020 22:31:18 + (UTC), Ron Villarreal via Python-list > declaimed the following: > >> Tried to open Python 3.8. I have Windows 10. Icon won’t open. > > What "Icon"? > > Pyth

Re: Problem

2020-10-01 Thread Mirko via Python-list
Am 30.09.2020 um 23:44 schrieb Chris Angelico: > On Thu, Oct 1, 2020 at 7:33 AM Mirko via Python-list >> We are seeing these troubles from newcomers on Windows all of the >> time -- and that for years. Isn't it time to ask if the way Python >> installs itself on Wind

Re: Problem

2020-10-01 Thread Mirko via Python-list
Am 01.10.2020 um 22:17 schrieb Chris Angelico: > Maybe those usability improvements have already been done. Haven't doubted that. Maybe they are just not enough yet. > Renaming Idle to "Python IDE" would be a very bad idea, since there > are many other Python IDEs. You

Re: Problem

2020-10-02 Thread Mirko via Python-list
Am 02.10.2020 um 11:58 schrieb Terry Reedy: > On 10/1/2020 4:09 PM, Mirko via Python-list wrote: > >> Renaming "IDLE" to "Python IDE" (or similar) might also. > "IDLE" intentionally echoes 'Idle', as in Eric Idle of Monty > Python. It sta

Re: Problem

2020-10-04 Thread Mirko via Python-list
Am 03.10.2020 um 17:25 schrieb Dennis Lee Bieber: > On Fri, 2 Oct 2020 21:47:38 +0200, Hexamorph declaimed > the following: > > >> >> - Add a folder named "Python.org " (or similar) to the >> desktop with shortcuts to Python, IDLE and the CHM. >&

Fwd: Python 3..9.0

2020-10-09 Thread Joe via Python-list
rg/mailman/listinfo/python-list

Re: file to bits text and text containing bits to file

2020-10-09 Thread dn via Python-list
everything else is done. Which (Python) tool(s) are you currently using? What (Python) research have you done? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: What might cause my sample program to forget that already imported datetime?

2020-10-12 Thread dn via Python-list
, and then identifying d2 as datetime.datetime.now() instead. These questions befuddle the mind when first presented, yet the answer seems so logical once it becomes hindsight... Evidence:- (blank lines added for readability) dn $ ... python3 Python 3.8.5 (default, Aug 12 2020, 00:00:00) [

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: with open("HOURLYLOG.txt", 'r') as infile: works but, when I rename the file, the line: with open("

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 19/10/2020 05:58, Mladen Gogala via Python-list wrote: On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: BTW, I used this cp /var/log/syslog ./in-file.log #!/usr/bin/env python3

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
rs in some alternate fashion) How to produce a robust Python/Panda script to coping with all these? u'historicRatings': [{u'overall': {u'keyQuestionRatings': [{u'name': u'Safe', u'rating': u'Requires improvement'}, {u'name&#

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
at we can't "snip" or 'do some gardening', to remove unnecessary or erroneous material, as the conversation progresses. You will notice (as below) that this also enables a posting with multiple questions, to be discussed point-by-point. Now to work... > On Sun, 18

Re: Help with the best practice to learn python

2020-10-19 Thread dn via Python-list
On 20/10/2020 04:12, Azhar Ansari wrote: Hello Python Community, Kindly help me with the best practice to learn python. Lots of material over net but its very confusing. You are so right - it is very confusing! Different people have different preferences for 'the best way to learn&#x

GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-29 Thread flaskee via Python-list
Hello! I've been reading the GUI toolkit posts. If anyone can give me a push in the right python direction on my needs, I'd be grateful. This is for business applications, not games. (but if a game toolkit fits...) I'm coming from Actionscript, where there is a lot of GUI fl

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-29 Thread flaskee via Python-list
> The Python toolkits that I've looked at feel mostly grid-oriented > or zone-oriented (you can put the button on the left, or middle, > or right, etc). I don't think it is easily possible in a cross-platform environment. But even if your software is one platform only how

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-30 Thread flaskee via Python-list
sages off list, and sending a self-composed > summary of the replies back to the list. > > -------

Best way to determine user's screensize?

2020-10-30 Thread flaskee via Python-list
Perhaps a more tactical approach would best to figure out how to do cross-platform python apps. What is the best approach to determining the user's available screensize, when they open your python application? Note that the "desktop" application could be running on Android, iOS,

Re: Best way to determine user's screensize?

2020-10-30 Thread flaskee via Python-list
efore. I just ignored the grouchy user with the hate over me wanting screensize. (every list has one of those types, eh? :-) Screensize, in part, determines the aspect ratio calcs to dynamically resize and place the components on the screen. Anyway, I'm pushing on to do this under python.

Re: Best way to determine user's screensize?

2020-10-30 Thread flaskee via Python-list
he geometry of that monitor monitor = s.get_monitor_geometry(m) # This is an example output print("Height: %s, Width: %s" % (monitor.height, monitor.width)) -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to determine user's screensize?

2020-10-30 Thread flaskee via Python-list
ibly crushed that you won't use my app(s) /s Bye, bye. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread dn via Python-list
On 31/10/2020 16:20, Chris Angelico wrote: On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list wrote: On 2020-10-31, Stefan Ram wrote: Siddhharth Choudhary writes: I want to know why x+=1 does not return the value of the variable. Which value? The old or the new one

Re: Why x+=1 doesn't return x value instead of an object

2020-10-31 Thread dn via Python-list
On 31/10/2020 19:41, Chris Angelico wrote: On Sat, Oct 31, 2020 at 4:44 PM dn via Python-list wrote: Free advice: whatever you do, don't call @Chris a walrus! Yeah... I do have quite a moustache, but it doesn't merit a high title like that! :) It's the tusks I'd

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
a large enough collection of words you'd notice the difference. You're pretty much right, it doesn't go too fast. I've done this years ago with Python2, had a bit free time now and wanted to ReLearn Python from starting old projects I've done in past but can't reme

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
, working as Chef, now have some more time, working part time so a got back to old hobby and learning again, however I see now with age everything is going slower lol Apologies, I hoped that you had the Py2 code to-hand. Multiple loops written in Python are likely to be slower than same in compiled

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
over the letters / words for each x in letters (rather than once). For a large enough collection of words you'd notice the difference. Multiple loops written in Python are likely to be slower than same in compiled code - which was probably part of the motivation for @Terry's response.

Re: Find word by given characters

2020-11-03 Thread dn via Python-list
probably, this time I came to idea to rewrite using count. But it seems I'm crap and takes me hell a lot of time to get on it. Don't beat yourself up about it. As you have already noted, it is difficult for an 'apprentice' to know things (s)he has yet to learn - and that was

Re: songbird's ngfp

2020-11-05 Thread flaskee via Python-list
: (python 3.7 | debian 10.6 | venv) But, it could be me. I'll try it again. I look forward to seeing your game. Thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
- https://mail.python.org/mailman/listinfo/python-list

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
ccept an arbitrary number of arguments and collect them into a tuple: def add(*numbers): # then the rest of the function as before +1 BTW, why initialize total to 1? Because OP copied 'multiply' code, completed earlier? [OP] Once you have this code working, as abo

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
o help you draw comparisons and/or re-factor (improve the code - or improve the approach) - whether your question is about 'math' or about 'Python'. * best to copy-paste directly from the code-editor. Incidentally, if you would prefer, there is a "Tutor" list where

Re: How can I make this more complex?

2020-11-09 Thread dn via Python-list
uot;You got a D ") if grade >= 50: print("You failed") First: open a Python terminal (REPL) and try: import this (wrt the post's title, lines three and four apply. This output is known as "The Zen of Python"!) Did you ever run the code? Hint: it won

Need help in installing numpy

2020-11-11 Thread adelamsaleh--- via Python-list
Dear Python Community, I am new to python.  I sucessfully installed python 3.9 from python.org on my windows 10 pc. I checked it by typing 'py' in the windows cmd prompt and the system indeed responds with the version number, then the >>> prompt, and I can run simple p

Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread dn via Python-list
-length-encoding/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Class Definitions

2020-11-12 Thread dn via Python-list
ot;]) A worthwhile read is: https://docs.python.org/3/tutorial/classes.html (including @Alan's most-pertinent warning of the subtleties introduced by mutable data-structures) On the other hand, Python has long?always had an aversion to the object-induced 'boiler-plate' requi

Re: Dispatch table of methods with various return value types

2020-11-17 Thread dn via Python-list
the add and whatever happens after that; and the delete, likewise. Otherwise the code must first decide which action-handler, and later, which result-handler - but aren't they effectively the same decision? Thus, is the reporting integral to the get (even if they are in separate routines)? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Dispatch table of methods with various return value types

2020-11-17 Thread dn via Python-list
generate a generic response? Is the problem caused by coding the first step before thinking of the overall task? Try diagramming or pseudo-coding the complete solution (with multiple approaches), ie the operations AND the printing and exception-handling. You could have a point, although I do

Re: Dispatch table of methods with various return value types

2020-11-19 Thread dn via Python-list
ng. You could have a point, although I do have a reasonable idea of what the task is and coming from a Perl background, Python always feels a bit like pseudocode anyway (which is one of the things I like about Python). +1 the ease of Python, but can this be seductive? Per the comment about Perl/Python

Re: Environment vars

2020-11-25 Thread dn via Python-list
; is being used as part of a path name? Is this a Python question? ie the above code should be run inside the Python interpreter (it won't). MS-Windows has an option to use a comma or a semi-colon as a list-separator on the 'command line' - as a local/locale definitio

Re: Environment vars

2020-11-25 Thread dn via Python-list
ination/mix of characters - until after you've entered your [ignorant] choice - twice. Grrr! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: unable to use numpy

2020-11-25 Thread dn via Python-list
giving a suitable solution of this. Please copy-paste the actual commands being used and error messages reported. OpSys? Source of Python? Source of numpy? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Environment vars

2020-11-25 Thread dn via Python-list
On 26/11/2020 08:43, Chris Angelico wrote: On Thu, Nov 26, 2020 at 6:19 AM dn via Python-list wrote: I've got a program which accepts an optional env variable listing a single or multiple directory for the app to use. I've done a bit of a search and see both a comma and semicolon

Re: Environment vars

2020-11-25 Thread dn via Python-list
mail.python.org/mailman/listinfo/python-list

Re: Environment vars

2020-11-27 Thread dn via Python-list
o_me/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: A problem with opening a file

2020-11-29 Thread dn via Python-list
On 29/11/2020 20:56, Gabor Urban wrote: Hi, I am facing an issue I was not able to solve yet. I have a class saving messages to a file. The relevant code is: import OS if you're wanting the Python Standard Library, this should not be in upper-case import sys are thes

Re: A problem with opening a file -- again

2020-11-29 Thread dn via Python-list
On 30/11/2020 10:36, Gabor Urban wrote: Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: Thanks = helpful +1 @Chris' response! Meantime, what happens if you start python

Re: Bot

2020-12-01 Thread dn via Python-list
27;t waste time "camping" the website. Thank you https://duckduckgo.com/?q=python+web+form+fill - the third or fourth response seemed to handle a log-on screen. Although if you're prepared to pay for their time, others may be able to save your time... -- Regards =dn -- https://ma

Re: Fw: See example

2020-12-04 Thread dn via Python-list
to be operating normally. What can you suggest C:\WINDOWS\system32>python Python 3.9.0a2 (tags/v3.9.0a2:6202d85, Dec 18 2019, 22:54:12) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more inf

Re: Error

2020-12-06 Thread dn via Python-list
On 06/12/2020 07:41, Barry Fitzgerald via Python-list wrote: Good day," I purchased a book for my son and followed the directions to a T. (Coding Games in Python) Whenever I got to the point of of moving the "hello" file over to pgzrun is where my trouble began. Its not finding

Re: Letter replacer - suggestions?

2020-12-07 Thread dn via Python-list
tion_table ) NB because maketrans() is a static method (of the str[ing] class) we must use the "str.". NBB because str.maketrans() checks the length of the two translation-strings, wrapping that with try...except might be considered more 'pythonic' than the "first if-cond

Re: Letter replacer - suggestions?

2020-12-07 Thread dn via Python-list
On 08/12/2020 12:15, Marco Sulla wrote: On Tue, 8 Dec 2020 at 00:10, dn via Python-list wrote: The translation phase is most easily achieved with the built-in str.translate() I forgot it :-) That's down to the rich-ness of the Python eco-system! IIRC (from previous posts) the

Re: Property type hints?

2020-12-09 Thread dn via Python-list
t what (it would appear) is desired: >>> class Foo: ... bar:str ... @property ... def bar( self ): ... return 1 ... >>> get_type_hints( Foo ) {'bar': } Yet the 'bar' property will return an int! ...and this is proven/made worse when we add explicit typ

Re: Property type hints?

2020-12-09 Thread dn via Python-list
lass-attributes will become (actually be 'hidden' by) instance-attributes if used on the LHS of an expression within the class (replicating the 'two' entity problem, discussed earlier). -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Planet Python

2020-12-11 Thread dn via Python-list
Has something happened to the Planet Python feed? - Last update: December 07, 2020 04:48 PM UTC -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-11 Thread dn via Python-list
e. Code: https://bpa.st/KVGA How this functions should look properly? In the event of "yes" the function returns a value (return ask). When the function calls itself, what happens to the return-ed value? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-11 Thread dn via Python-list
ment tab-stops as eight-spaces apart. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-11 Thread dn via Python-list
On 12/12/2020 15:25, Chris Angelico wrote: On Sat, Dec 12, 2020 at 1:23 PM dn via Python-list wrote: Speaking personally, I prefer the code to be included in the email. However, it would be better to use spaces rather than tabs (Python's preferred style, per PEP-8) because many email pac

Re: Returning from a multiple stacked call at once

2020-12-12 Thread dn via Python-list
this is inconvenient? There are alternatives, for example passing in a Queue and put()ing the data onto the queue. It's quite dependent on what you're trying to do though. I don't really need it. I was just wondering and guessed it was not feasible. [somewhat simplified] The way

Re: Planet Python

2020-12-14 Thread dn via Python-list
On 12/12/2020 07:22, dn via Python-list wrote: Has something happened to the Planet Python feed? - Last update: December 07, 2020 04:48 PM UTC Fixed! (Thanks!) Although, still reported as an 'open' issue https://github.com/python/planet/issues/446 -- Regards =dn -- https://mail.

Re: dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread dn via Python-list
> On Tue, Dec 15, 2020 at 9:57 AM Mark Polesky via Python-list < > python-list@python.org> wrote: > >> Hi. >> >> # Running this script >> >> D = {'a':1} >> def get_default(): >> print('Nobody expects this') &

Re: dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread dn via Python-list
unction? Other than personal-preference (which should be respected), and a uniform default-value, what is the rationale for defaultdict over dict.get()? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-16 Thread dn via Python-list
On 17/12/2020 15:40, Bischoop wrote: On 2020-12-12, Terry Reedy wrote: Don't post links to unknown sites. Reduce it to the minimum needed to exhibit the questionable behavior and include inline with the question. BTW bpa.st/+python is well known for code sharing among Python commun

Re: Function returns old value

2020-12-16 Thread dn via Python-list
m as advice from folk who have been 'here' and/or using Python for some time. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

"Worst bugs" and Python?

2020-12-18 Thread dn via Python-list
n the top programming languages by Brandon Vigliarolo in Security on December 17, 2020, 9:32 AM PST A heatmap shows PHP has the most flaws followed by C++, then Java, .Net, JavaScript, and Python in Veracode's annual security report. >>> https://www.techrepublic.com/article/the-worst-bug

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread dn via Python-list
tions. (... and, yes, I know I should maybe move to IMAP but that's too much work at the moment!) This morning, reading the results of the Virtual Python Core Developer Sprint 2020 (https://pyfound.blogspot.com/2020/12/virtual-python-core-developer-sprint.html) and from there, PEP 594 -

Re: Installing Python (2.7) 'by hand' on Ubuntu - possible?

2020-12-22 Thread Mirko via Python-list
On 22.12.2020 at 20:24 Chris Green wrote: > Yes, I do have the Python source. The only thing I don't have the > source for is a .so file and that's why I can't simply migrate the > program(s) from Python 2 to Python 3. > If it's just one .so and that library is

Re: using regex for password validation

2020-12-23 Thread dn via Python-list
tempting to solve multiple problems in one go. (I'm writing this from the perspective of 'Apprentice' professionals or a ComSc student - with any/all due apologies and respect to the OP) There is much virtue in saying that every Python routine should solve one problem (and only one

<    12   13   14   15   16   17   18   19   20   21   >