Python 3.14.0a7, 3.13.3, 3.12.10, 3.11.12, 3.10.17 and 3.9.22 are now available

2025-04-08 Thread Hugo van Kemenade via Python-list
! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the Python Software Foundation: https://www.python.org/psf-landing/ Regards from a sunny and cold Helsinki springtime, Your full release team, Hugo van Kemenade Thomas Wouters Pablo Galindo

Python 3.14.0 alpha 6

2025-03-14 Thread Hugo van Kemenade via Python-list
yourself or through organisation contributions to the Python Software Foundation. Regards from Helsinki as fresh snow falls, Your release team, Hugo van Kemenade Ned Deily Steve Dower Łukasz Langa -- https://mail.python.org/mailman/listinfo/python-list

Python 3.14.0 alpha 5

2025-02-11 Thread Hugo van Kemenade via Python-list
area of a polygon inscribed in a circle, then as the number of sides of the polygon is increased, the area becomes closer to that of the circle, from which you can approximate π. This algorithm is similar to the method used by Archimedes in the 3rd century BCE and Ludolph van Ceulen in the 16th

Python 3.14.0 alpha 4 is out

2025-01-14 Thread Hugo van Kemenade via Python-list
der supporting our efforts by volunteering yourself or through organisation contributions to the Python Software Foundation. Regards from a slushy, slippery Helsinki, Your release team, Hugo van Kemenade Ned Deily Steve Dower Łukasz Langa -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 3.14.0 alpha 3 is out

2024-12-17 Thread Hugo van Kemenade via Python-list
make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the Python Software Foundation. Regards from a snowy and slippery Helsinki, Your release team, Hugo van Kemenade Ned Deily Steve Dower Łu

[RELEASE] Python 3.14.0 alpha 2 is out

2024-11-19 Thread Hugo van Kemenade via Python-list
://github.com/python/cpython/issues * Help fund Python and its community: https://www.python.org/psf/donations/ And now for something completely different Ludolph van Ceulen (1540-1610) was a fencing and mathematics teacher in Leiden, Netherlands, and spent around 25 years calculating π (or pi), using

[RELEASE] Python 3.14.0 alpha 1 is now available

2024-10-16 Thread Hugo van Kemenade via Python-list
Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation. Regards from a bright and colourful Helsinki, Your release team, Hugo van Kemenade Ned Deily Steve Dower Łu

Re: Correct syntax for pathological re.search()

2024-10-08 Thread Pieter van Oostrum via Python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes: > "Michael F. Stemper" wrote or quoted: > > path = r'C:\Windows\example' + '\\' > You could even omit the '+'. Then the concatenation is done at parsing time instead of run time. -- Pieter van

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Pieter van Oostrum via Python-list
unit. > That is a famous Unix task : (Sorry, no Python) grep -o '\w*' JoyceUlysses.txt | sort | uniq -c | sort -n -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

How to get insight in the relations between tracebacks of exceptions in an exception-chain

2024-04-04 Thread Klaas van Schelven via Python-list
Hi, This question is best introduced example-first: Consider the following trivial program: ``` class OriginalException(Exception): pass class AnotherException(Exception): pass def raise_another_exception(): raise AnotherException() def show_something(): try: raise

Re: A technique from a chatbot

2024-04-03 Thread Pieter van Oostrum via Python-list
ly: print("something_to_be_done_at_the_end_of_this_function()") -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Small lament...

2023-04-03 Thread Guido van Rossum
://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-...@python.org/message/Q62W2Q6R6XMX57WK2CUGEENHMT3C3REF/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Prono

Re: To clarify how Python handles two equal objects

2023-01-13 Thread Bob van der Poel
ect, with possible multiple > names to it. We can change the object, using one of the names. That is one > and only one operation on one and only one object. Since the different > names refer to the same object, that change will of course be visible > through all of them. > >> Note that 'name' in that sentence doesn't just refer to variables (mx1, > arr1, ...) but also things like indexed lists (mx1[0], mx1[[0][0], ...), > loop variables, function arguments. > >> > >> The correct mental model is important here, and I do think you're on > track or very close to it, but the way you phrase things does give me that > nagging feeling that you still might be just a bit off. > >> > >> -- > >> "Peace cannot be kept by force. It can only be achieved through > understanding." > >> -- Albert Einstein > >> > >> -- > >> https://mail.python.org/mailman/listinfo/python-list > >> > > > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: Are Floating Point Numbers still a Can of Worms?

2022-10-23 Thread Pieter van Oostrum
cigar. (%i10) bfloat(2.718281828459045b0) - bfloat(%e); (%o10) - 2.35360287471352802147785151603b-16 Fricas: (1) -> 2.718281828459045^0.8618974796837966 (1) 2.367648_98319 (2) -> exp(0.8618974796837966) (2) 2.367649_00086 -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP

Will "hello" always be printed?

2022-10-07 Thread Robin van der veer
If I have two processes communicating through a JoinableQueue, and I do the following: process 1: queue.put(1) #unfished tasks = 1 queue.join() #block until unfished tasks = 0 print('hello')[/python] process 2: queue.get() queue.task_done() #unfished tasks = 0 queue.put(

Re: python developer

2022-10-03 Thread Jan van den Broek
2022-10-01, orzodk schrieb: > Jan van den Broek writes: > >> 2022-10-01, Mike Dewhirst schrieb: >> >>>So the answer to your question is signed email is easy and if it becomes >>>popular it has potential to defeat hackers. >> >> Yes, but I'

Re: python developer

2022-10-01 Thread Jan van den Broek
2022-10-01, Mike Dewhirst schrieb: >So the answer to your question is signed email is easy and if it becomes >popular it has potential to defeat hackers. Yes, but I'm reading this as a usenet-message (comp.lang.python), not as a mail. -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.o

Re: python developer

2022-09-30 Thread Jan van den Broek
2022-09-29, Mike Dewhirst schrieb: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) Why? [Schnipp] -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Re: jupyter console vs. ipython in Emacs

2021-12-20 Thread Pieter van Oostrum
Pieter van Oostrum writes: > My Python development environment is Emacs. I used to use 'jupyter > console --simple-prompt' (driven by Emacs comint) to do interactive > work, but it has the disadvantage that it doesn't work properly with > multiline input, inclu

jupyter console vs. ipython in Emacs

2021-12-19 Thread Pieter van Oostrum
--simple-prompt' in Emacs does work with multiline statements. No idea why jupyter console doesn't. Is there any advantage in using jupyter console over ipython? -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: HTML extraction

2021-12-08 Thread Pieter van Oostrum
rc/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError File "", line 1 XMLSyntaxError: Premature end of data in tag hr line 1, line 1, column 13 -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Negative subscripts

2021-11-26 Thread Pieter van Oostrum
est, or is the only > alternative to use if...then...else to cater for y = 0? If you put it in a function with x and y as parameters, then both x and y are just a simple identifier inside the function. And then you can then even eliminate the if with for item in x[:len(x)-y]: -- Pieter van O

Re: Recursion on list

2021-11-04 Thread Pieter van Oostrum
ast writes: >> li = [] >> li.append(li) >> li > [[...]] > >>li[0][0][0][0] > [[...]] > > That's funny > You made a list whose only element is itself. In [1]: li = [] In [3]: li.append(li) In [4]: li[0] is li Out[4]: True -- Pieter van Oost

nrfutil icorrect installation

2021-10-11 Thread Gerhard van Rensburg
Dear python, I installed Python 3.10.0 I then install pip install nrfutil When I try to run nrfutil, I get ModuleNotFoundError: No module named 'constants' C:\Users\ x\nrfutil keys --help Traceback (most recent call last): File "C:\Users\Gerhard van Rensbur

Re: [OT] Annoying message duplication, was Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
On 2021-05-05, Peter Otten <__pete...@web.de> wrote: > On 05/05/2021 16:10, Ethan Furman wrote: > >> I see your messages twice (occasionally with other posters as well).?? I >> have no idea how to fix it.?? :( > > OK, I'll try another option from Thunderbird's context menu: Followup to > Newsgrou

Re: [OT] Annoying message duplication, was Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
On 2021-05-05, Jim Byrnes wrote: > On 5/5/21 9:39 AM, Peter Otten wrote: >> On 05/05/2021 16:10, Ethan Furman wrote: >> >>> I see your messages twice (occasionally with other posters as well). >>> I have no idea how to fix it.?? :( >> >> OK, I'll try another option from Thunderbird's context m

Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
On 2021-05-05, Peter Otten <__pete...@web.de> wrote: > On 05/05/2021 13:03, Jan van den Broek wrote: >> On 2021-05-05, Peter Otten <__pete...@web.de> wrote: >> >> Perhaps there's something wrong on my side, but I'm >> seeing this message twice: [

Re: Unsubscribe/can't login

2021-05-05 Thread Jan van den Broek
On 2021-05-05, Peter Otten <__pete...@web.de> wrote: Perhaps there's something wrong on my side, but I'm seeing this message twice: Msg-ID: mailman.145.1620211376.3087.python-l...@python.org Return-Path: __pete...@web.de and Msg-ID: mailman.146.1620211381.3087.python-l...@python.org Return-Path

Re: [Python-ideas] Re: Looking for people interested in a Python register virtual machine project

2021-03-23 Thread Guido van Rossum
here. So o.m(f()) needs to evaluate o.m (which may have a side effect if o overrides __getattr__) before it calls f(). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-chang

Re: editor recommendations?

2021-02-26 Thread Bob van der Poel
web browsing was "a > thing", but I'm sure he found a way to do that inside emacs also. > Of course there is a mode for that: https://www.emacswiki.org/emacs/CategoryWebBrowser -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel **

Re: Python 2.7 and 3.9

2021-02-18 Thread Pieter van Oostrum
ottom of your posts. > White space aids readability and readability counts. :) The separator line should be '-- ' (without quotes), i.e. with a trailing space. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Guido van Rossum
nificant in this release of Python? I see the > lack of indentation in the first Python programs. > Indentation most certainly was significant from day 0. I suspect what happened is that these files got busted somehow by the extraction process used by Skip or Hiromi. -- --Guido van Rossum

Re: [Python-Dev] Python 0.9.1

2021-02-16 Thread Guido van Rossum
__ > Python-Dev mailing list -- python-...@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-...@python.org/message/VZYELIYAQWUHHGIIEPPJFREDX6F24KMN/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Jupyter notebooks to A4 (again)

2021-01-31 Thread Pieter van Oostrum
However, due to a bug this won't work unless you patch the nbconvert export code. This is a simple one-line patch. See https://github.com/jupyter/nbconvert/pull/1496/commits/a61a2241a87912005720d3412ccd7ef7b5fce6dd -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Jupyter notebooks to A4 (again)

2021-01-28 Thread Pieter van Oostrum
Martin Schöön writes: > Hello all, > > Some years ago I asked about exporting notebooks to pdf in > A4 rather than US Letter. I got help, rather detailed > instructions from you in general and Piet von Oostrum in Who now calls himself Pieter van Oostrum, just like hi

Re: Funny error message

2021-01-01 Thread Bob van der Poel
that it's not 100%. > > There are multiple reasons for this, but the first time that code is > run, a .pyc will (presumably) be created - and we're back to > considerations of Python environments, Python cf C, perhaps even > > Oh no! Not these damned dragons again :) But, seriously. No, I have no idea of moving installed stuff around between /usr /.local and /usr/local. There lies no dragons but madness :) I meant that I will pay more attention as to what the installer(s) are doing. Thanks for the input. -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list < python-list@python.org> wrote: > On 1/2/21 6:35 AM, Bob van der Poel wrote: > > Found it! > > Well done! > > > >> I had the proper urllib3 installed. But, in my .local/lib/ a > previous > >

Re: Funny error message

2021-01-01 Thread Bob van der Poel
ink!). > > > That is where "python3.8 -m pip install --user" puts the packages you > install. > > Barry > > > > Okay ... I'll take your word for it. But, I really don't think I've every run that command :) -- Listen to my FREE CD at http:/

Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list < python-list@python.org> wrote: > On 1/1/21 11:46 AM, Bob van der Poel wrote: > > When I run python from the command line and generate an error I get the > > following: > > > > Python 3.8.5 (default, Jul

Re: Funny error message

2021-01-01 Thread Bob van der Poel
peated over and over again after every error. Could this be a bug in requests? On Fri, Jan 1, 2021 at 3:03 AM Peter Otten <__pete...@web.de> wrote: > On 31/12/2020 23:46, Bob van der Poel wrote: > > > When I run python from the command line and generate an error I get the >

Funny error message

2020-12-31 Thread Bob van der Poel
line 1, in NameError: name 'z' is not defined I understand "z in not defined" ... but what's with the warnings? -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: Environment vars

2020-11-27 Thread Bob van der Poel
On Fri, Nov 27, 2020 at 1:41 PM dn via Python-list wrote: > On 26/11/2020 05:46, Bob van der Poel 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

Re: Environment vars

2020-11-25 Thread Bob van der Poel
On Wed, Nov 25, 2020 at 2:22 PM dn via Python-list wrote: > > Ahha! Didn't know about os.pathsep. Seems simple enough to use that and > be > > done with it. > > > > I'm just using str.split() just now. Is there a os.splitpath()? I don't > see > > anything in the docs. > > > https://docs.python.or

Re: Environment vars

2020-11-25 Thread Bob van der Poel
On Wed, Nov 25, 2020 at 12:43 PM Eryk Sun wrote: > On 11/25/20, Bob van der Poel wrote: > > I've got a program which accepts an optional env variable listing a > single > > or multiple directory for the app to use. > > In Unix one would use colon as the preferred de

Re: Environment vars

2020-11-25 Thread Bob van der Poel
On Wed, Nov 25, 2020 at 11:00 AM dn via Python-list wrote: > On 26/11/2020 05:46, Bob van der Poel 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

Re: Environment vars

2020-11-25 Thread Bob van der Poel
On Wed, Nov 25, 2020 at 10:59 AM Chris Angelico wrote: > On Thu, Nov 26, 2020 at 4:36 AM Bob van der Poel 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

Environment vars

2020-11-25 Thread Bob van der Poel
Listen to my FREE CD at http://www.mellowood.ca/music/cedars **** Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: [python-committers] Thank you Larry Hastings!

2020-10-05 Thread Guido van Rossum
/mail.python.org/archives/list/python-committ...@python.org/message/QGIHFU64TBYT56K6M5A5LYTYTSVFKHWQ/ > Code of Conduct: https://www.python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> -- https://mail.python.org/mailman/listinfo/python-list

Re: .replace() to replace elements in a Pandas DataFrame

2020-08-05 Thread Bob van der Poel
rame, df. > > > > > > > > A strange thing is that it worked perfectly in the same Jupyter > > > notebook > > > > this morning. > > > > But all of a sudden, it started not doing the replacement any > more. > > > >

Re: Issue with Python module downloads from Library for a beginner Python coder.

2020-08-02 Thread Bob van der Poel
les from Python's > standard library? Or do you mean installing third party libraries > using pip? > > > ...But now I am not able to open IDLE after multiple tries. > > Have you looked in your start menu in the list of installed programs > for Python? If it is there d

Re: Function to avoid a global variable

2020-05-01 Thread Bob van der Poel
turn f > return deco > > @static(called=0) > def other_function(): > me.called += 1 > ... > > Obviously the name "me" can't be used, as it'd break a bunch of code, > but conceptually this would be incredibly helpful. It'd also be a >

Re: Function to avoid a global variable

2020-04-27 Thread Bob van der Poel
t; On 4/27/20 10:39 AM, Bob van der Poel wrote: > > Thanks Chris! > > > > At least my code isn't (quite!) as bad as the xkcd example :) > > > > Guess my "concern" is using the initialized array in the function: > > > >def myfunct(a, b, c=a

Re: Function to avoid a global variable

2020-04-27 Thread Bob van der Poel
e in a function? Is there a PEP? Best, On Sun, Apr 26, 2020 at 8:47 PM Chris Angelico wrote: > On Mon, Apr 27, 2020 at 1:39 PM Bob van der Poel wrote: > > > > Does this make as much sense as anything else? I need to track calls to a > > function to make sure it doesn't

Function to avoid a global variable

2020-04-26 Thread Bob van der Poel
Does this make as much sense as anything else? I need to track calls to a function to make sure it doesn't get called to too great a depth. I had a global which I inc/dec and then check in the function. Works fine, but I do need to keep a global around just for this. So ... instead I wrote a short

Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Pieter van Oostrum
;head" ("Injection-Info: news.bbs.nz" -1002 nil s)) i.e. each message that contains "news.bbs.nz" in the "Injection-Info" header will be made invisible. This solved the problem for me. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is a generator expression called a expression?

2020-04-21 Thread Pieter van Oostrum
list [","] | comprehension] ")" comprehension ::= expression comp_for The last part is the inner part (i.e. without the parentheses) of generator_expression. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Floating point problem

2020-04-21 Thread Pieter van Oostrum
2 + 11 + 1 == 64. > Yep, floating point is fun. > > That assumed top 1 bit is always there, except when it isn't. Because > denormal numbers are a thing. They don't have that implied 1 bit. Yes, for subnormal numbers the implicit bit *is* stored. They are characterized by

Re: Floating point problem

2020-04-19 Thread Pieter van Oostrum
the 0.4 followed by 6 more digits. > Anything further is, in effect, up for grabs. > Most Python implementations use 64-bit doubles (53 bits of precision). See https://docs.python.org/3.8/tutorial/floatingpoint.html -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Helping Windows first time users

2020-04-19 Thread Pieter van Oostrum
L page describing the first steps to start using Python. It could mention the command line (py) to be used with a text editor (some recommendations) and IDLE. And how not to double click .py files :) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python launcher

2020-04-15 Thread Pieter van Oostrum
rably something that is displayed immediately after installation of in some other way is prominently displayed. I am not on Windows myself, so I am afraid I will not be of much help in this respect. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to inheret a metaclass.

2020-04-11 Thread Pieter van Oostrum
Pieter van Oostrum writes: > Your Pardon is not a class, it is a function. Class A is created by > type(cls, *args), so 'type' is the metaclass of A, and therefore also of > B. > Creation of B does not call Pardon. With a class it *does* work: In [74]: class Pardon(t

Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Pieter van Oostrum
t you can give a function as metaclass. But that seems to be part of the specification. The function result is what the 'class' becomes. You can even have it return something else. Then the 'class' wouldn't really be a class. In [65]: def meta(cls, *args): return 1 In [66]: class A(metaclass=meta): pass In [67]: A Out[67]: 1 -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: python script to give a list of prime no.

2020-04-05 Thread Pieter van Oostrum
break if is_prime: print(a) a = a + 2 Further optimizations are possible, for example use range(2,a/2) or even range (2, sqrt(a)). -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Identifying tkinter version

2020-04-01 Thread Tony van der Hoff
import tkinter >>> tkinter.TkVersion 8.6 -- Tony van der Hoff| mailto:t...@vanderhoff.org Buckinghamshire, England | -- https://mail.python.org/mailman/listinfo/python-list

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Pieter van Oostrum
Pieter van Oostrum writes: > > The first import creates a file __pycache__ in the directory p1. That should be 'a directory __pycache__' > To remove it use rmtree(path.join(P1,'__pycache__')) > Then the second import will succeed. > -- > Pieter van Oostr

Re: dynamic import of dynamically created modules failes

2020-03-31 Thread Pieter van Oostrum
file __pycache__ in the directory p1. To remove it use rmtree(path.join(P1,'__pycache__')) Then the second import will succeed. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: 0x80070643 python download error

2020-03-30 Thread Pieter van Oostrum
rror appears. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-19 Thread Pieter van Oostrum
... 'last_name': 'Allen', ... 'email': 'fal...@ibm.com' ... }) In [37]: d Out[37]: {'first_name': 'Frances', 'last_name': 'Allen', 'email': 'fal...@ibm.com'} In [3

Re: Why is the program not printing three lines?

2020-03-19 Thread Pieter van Oostrum
this so? 'From first' is the result of the class definition. 'from second' is the result of first.second(). And first() doesn't produce any output. Your problem is probably that you think that the call first() executes all the statements in the class definition. It doesn

Re: Why is the program not printing three lines?

2020-03-19 Thread Pieter van Oostrum
x27;t print anything, because the print statement is not part of the class __init__ code. In [28]: first.second() >From second That's expected. In [29]: first.second() >From second Again. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Can you help me solve this?

2020-03-16 Thread Pieter van Oostrum
Pieter van Oostrum writes: > Joseph Nail writes: > >> Hello, >> I have one problem. Somehow in my function when I wrote y=x, they are the >> same variable and then it also changes age or height (which were x) in the >> main program. See more in attached file.

Re: Can you help me solve this?

2020-03-16 Thread Pieter van Oostrum
you write y = x, then they are not the same variable, but they point to (the proper Python language is they are bound to) the same object. Now if you say x.age = 20, then y.age will also be 20 (it's the same object). -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142

Re: using classes

2020-03-13 Thread Pieter van Oostrum
not something you provide yourself. Your arguments are bez, ge, ins. class PKW(Fahrzeug):     def __init__(self, bez, ge, ins): -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: using classes

2020-03-12 Thread Pieter van Oostrum
econd way can be used in Python 3. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: iterate through an irregular nested list in Python

2020-03-07 Thread Pieter van Oostrum
' else: yield from reclist(item) else: yield item for i in reclist(aList): print(i, end=',') This gives you an extra comma at the end, unfortunately. But it is the pattern for other types of processing. Or use it like this: print (','.join(str(i) for i in reclist(aList))) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: iterate through an irregular nested list in Python

2020-03-06 Thread Pieter van Oostrum
' else: yield from reclist(item) else: yield item for i in reclist(aList): print(i, end=',') This gives you an extra comma at the end, unfortunately. But it is the pattern for other types of processing. Or use it like this: print (','.join(str(i) for i in reclist(aList))) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: ÿ in Unicode

2020-03-06 Thread Pieter van Oostrum
t;Is there something about the output that puzzles you? >> No >> >>>Did you have a question? >> No, only a comment >> >> This buggy language is very amusing. > > What's the bug, or source of amusement? The bug is in the mental world of the OP. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: ÿ in Unicode

2020-03-06 Thread Pieter van Oostrum
'Ä¿'.encode('utf-16-le') >>> > b'\xff\x00' >>> >>>> 'Ä¿'.encode('utf-32-le') >>> > b'\xff\x00\x00\x00' >> >>> That all looks as expected. >> Yes >> >>>Is there some

Re: iterate through an irregular nested list in Python

2020-03-06 Thread Pieter van Oostrum
' else: yield from reclist(item) else: yield item for i in reclist(aList): print(i, end=',') This gives you an extra comma at the end, unfortunately. But it is the pattern for other types of processing. Or use it like this: print (','.join(str(i) for i in reclist(aList))) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: iterate through an irregular nested list in Python

2020-03-06 Thread Pieter van Oostrum
' else: yield from reclist(item) else: yield item for i in reclist(aList): print(i, end=',') This gives you an extra comma at the end, unfortunately. But it is the pattern for other types of processing. Or use it like this: print (','.join(str(i) for i in reclist(aList))) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: ÿ in Unicode

2020-03-06 Thread Pieter van Oostrum
t; 'ÿ'.encode('utf-16-le') >>> > b'\xff\x00' >>> >>>> 'ÿ'.encode('utf-32-le') >>> > b'\xff\x00\x00\x00' >> >>> That all looks as expected. >> Yes >> >>>Is there somet

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

2020-01-26 Thread Francois van Lieshout
for x in range( 0,10 ): stars = "" count = 0 while count < x: stars += "x" count += 1 print( stars ) x xx xxx x xx xxx x You've got already an "x" placed in your variable stars that's why. -O

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-16 Thread Pieter van Oostrum
er file name with open(secretfile, 'rb') as fd: secret = fd.read() key = 'goldQ3T8-1QRD-5QBI-9F22' bkey = key.encode('ascii') h = hmac.new(secret, bkey, hashlib.sha256) print('hd (hex): ', h.hexdigest()) -- Pieter van Oostrum www: http://piet

Re: Help

2020-01-16 Thread Pieter van Oostrum
kiran chawan writes: > Whenever Iam trying to run this 'New latest version python software 3.8.4 > python ' but it doesn't show any install option and it say ' modify set up > ' So tell what to do sir plz help me out. There is no Python 3.8.4

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Pieter van Oostrum
n the database. Of course this only works if that stored hash has been calculated in the same way from the same key. On Python 2 (which you shouldn't use) you can leave out the "key = bytes(key, 'ascii')" part. You can of course make it more sophisticated, for example by

Re: Relative import cannot find .so submodule?

2020-01-13 Thread Pieter van Oostrum
the import system. Are you running python 3.6? I tried this on python 3.7 and it worked, but the file is called _rtmidi.cpython-37m-darwin.so there (37 for python3.7, and the d is missing, I don't know what that indicates). -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: I need to create .odt or .rtf documents in Python3. what is the best tool to do this....

2020-01-12 Thread Pieter van Oostrum
anyone have any suggestions? > > chris https://github.com/eea/odfpy -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: looking for git with a solution - merge many pdfs to 1 pdf (no matter what language)

2020-01-08 Thread Pieter van Oostrum
alon.naj...@gmail.com writes: > hi > looking for git with a solution - merge many pdfs to 1 pdf (no matter what > language) There is a clone of pdftk on github: https://github.com/ericmason/pdftk Another possibility is mupdf: http://git.ghostscript.com/?p=mupdf.git -- Pieter van Oo

Re: Python, Be Bold!

2020-01-02 Thread Bob van der Poel
/python-list > -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: name 'sys' is not defined

2019-12-30 Thread Pieter van Oostrum
he name sys is used in the imported module, that module has to import sys. Importing it in the calling code doesn't help. So I would say this is a bug in the module. You should report the bug to its author. In the meantime you can correct your own copy at ~/opt/miniconda3/envs/py3/

Re: [ANN] Retrospective of Python compilation efforts

2019-12-24 Thread Guido van Rossum
gt; -- > Python-announce-list mailing list -- python-announce-l...@python.org > To unsubscribe send an email to python-announce-list-le...@python.org > https://mail.python.org/mailman3/lists/python-announce-list.python.org/ > > Support the Python Software Foundation: > h

Re: urllib unqoute providing string mismatch between string found using os.walk (Python3)

2019-12-21 Thread Pieter van Oostrum
character, Unicode 0xF3, LATIN SMALL LETTER O WITH ACUTE. In (a) it is composed of the letter o and the accent "́" (Unicode 0x301). So you would have to do Unicode normalisation before comparing. For example: In [16]: from unicodedata import normalize In [17]: a == b Out[17]: False

Re: hexdump module installation error

2019-12-19 Thread Pieter van Oostrum
> > user@USERnoMacBook-Air LibraBrowser % Could it be that your pip3 belongs to a different Python than the one above (for example a Python 3.8 or 3.6)? What is the output of 'pip3 --version' (without quotes)? -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8D

Re: INHERITANCE in python3

2019-12-19 Thread Pieter van Oostrum
p.family)``` Please next time, supply a properly indented Python source, with only normal ASCII spaces, not no-break spaces, i.e. exactly like in your Python source code. > > The Username class also needs to call super(). In general, super() is > intended to be used with all classes that

Re: Unicode filenames

2019-12-07 Thread Bob van der Poel
On Sat, Dec 7, 2019 at 12:47 PM DL Neil via Python-list < python-list@python.org> wrote: > On 8/12/19 5:50 AM, Bob van der Poel wrote: > > On Sat, Dec 7, 2019 at 4:00 AM Barry Scott > wrote: > >>> On 6 Dec 2019, at 18:17, Bob van der Poel wrote: > >>>

Re: Unicode filenames

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

Unicode filenames

2019-12-06 Thread Bob van der Poel
oping for a guideline! Thanks. -- Listen to my FREE CD at http://www.mellowood.ca/music/cedars Bob van der Poel ** Wynndel, British Columbia, CANADA ** EMAIL: b...@mellowood.ca WWW: http://www.mellowood.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: os.system vs subrocess.call

2019-11-28 Thread Pieter van Oostrum
#x27;], shell=True) > > I get > > Test.py: 1: Test.py: ./: Permission denied > Why would you do that, splitting './Test.py' in two parts? That doesn't work. > Is there a simple way to use subprocess in this usecase? > subprocess.call(['./Test.py']) -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list

Re: Global variable is undefined at the module level

2019-11-23 Thread Pieter van Oostrum
; testfunc() >>> globvar Traceback (most recent call last): File "", line 1, in NameError: name 'globvar' is not defined >>> def testfunc(): ... global globvar ... globvar = 1 ... >>> globvar Traceback (most recent call last): File

Re: revise "([^/]+)$" into '([^/]+)$' in a lot of files under a directory.

2019-11-18 Thread Pieter van Oostrum
Hongyi Zhao writes: > On Sun, 17 Nov 2019 20:28:55 +0100, Pieter van Oostrum wrote: > >> To be honest, I myself would use Emacs, with rgrep and wgrep to do this. > > Are these tools superior to grep? They are based on grep. But rgrep does a grep through a whole directory tre

  1   2   3   4   5   6   7   8   9   10   >