Python 3.13.0b4, the final beta of Python 3.13, is now available:
https://www.python.org/downloads/release/python-3130b4/
*This is a beta preview of Python 3.13*
Python 3.13 is still in development. This release, 3.13.0b4, is the *final*
beta release preview of 3.13.
Beta release previews
this for you,
like expand.grd. Python has many modules, like itertools that do things
including combinations but perhaps not designed for your case.
Here is a version of your scenario:
import itertools
a = range(3)
b = range(4)
c = range(5)
list(itertools.product(a,b,c))
The result
Thank you very much. List comprehensions make code much more concise indeed. Do
list comprehensions also improve the speed of calculations?
From: avi.e.gr...@gmail.com
Sent: Friday, July 12, 2024 6:57 PM
To: Popov, Dmitry Yu ; 'Popov, Dmitry Yu via Python-list
some have) or you explain
well enough.
I am guessing you have programming experience in other languages and are not as
“pythonic” as some. The code you show may not be quite how others might do it.
Some may write mch of your code as a single line of python using a list
comprehension
Thank you very much, Oscar.
Using the following code looks like a much better solution than my current
Python code indeed.
np.gcd.reduce(np.transpose(a))
or
np.gcd.reduce(a,1)
The next question is how I can generate ndarray of h,k,l indices. This can be
easily done from a Python list by using
s the various
functions of the module.
--
https://mail.python.org/mailman/listinfo/python-list
Thank you for your interest. My explanation is too concise indeed, sorry. So
far, I have used Python code with three enclosed 'for' loops for this purpose
which is pretty time consuming. I'm trying to develop a NumPy based code to
make this procedure faster. This routine is kind of 'heart
--
https://mail.python.org/mailman/listinfo/python-list
On 2024-07-08 19:09:45 +, Popov, Dmitry Yu via Python-list wrote:
> Does NumPy provide a simple mechanism to identify relatively prime
> integers, i.e. integers which don't have a common factor other than +1
> or -1?
Typing "numpy gcd" into my favourite search engine
, 2024 3:26 PM
To: avi.e.gr...@gmail.com; 'Popov, Dmitry Yu via Python-list'
Subject: Re: Relatively prime integers in NumPy
Thank you for your interest. My explanation is too concise indeed, sorry. So
far, I have used Python code with three enclosed 'for' loops for this purpose
which
(posting on-list this time)
On Thu, 11 Jul 2024 at 15:18, Popov, Dmitry Yu via Python-list
wrote:
>
> Dear Sirs.
>
> Does NumPy provide a simple mechanism to identify relatively prime integers,
> i.e. integers which don't have a common factor other than +1 or -1? For
>
on top of numpy.
Is there a reason you cannot solve this mostly outside numpy?
It looks like you could use numpy to select the numbers you want to compare,
then call one of many methods you can easily search for to see how to use
python to make some list or other data structure for divisors of each
I see the literal 'escape' character + 'k', when it should
let me edit previous commands.
I did have to compile my own python because I'm using 2.7 on
this machine.
I figured it out. I needed to apt install libreadline-dev.
--
https://mail.python.org/mailman/listinfo/python-list
For this to work, the Python implementation should use the same
readline library as your shell, I guess.
It works in python3, so I guess my problem is that I'm
compiling python (I think kubuntu dropped python2), but
I don't see any relevant options in the configure help.
--
https
sinewave:toby ~(1)> python
Python 2.7.18 (default, Jul 8 2024, 12:49:12)
[GCC 13.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import MySQLdb
Traceback (most recent call last):
File "", line 1, in
Kubuntu 24.04.
sinewave:toby ~(1)> cat .inputrc
set editing-mode vi
set keymap vi
sinewave:toby ~(1)> cat .editrc
bind -v
bind \\t rl_complete
sinewave:toby ~(1)> python
Python 2.7.18 (default, Jul 8 2024, 12:49:12)
[GCC 13.2.0] on linux2
Type "help", "copyright
along axis
0: [1,2,3]. Those triples of numbers along axis 1 with the factor of1 or -1
would be relatively prime integers.
Regards,
Dmitry Popov
Argonne, IL
USA
--
https://mail.python.org/mailman/listinfo/python-list
mething (here: printing an incrementing value
> named "info") and also serving requests from other processes
> for this "info" value:
>
[snip]
Thanks, that should get me started! :-)
--
Chris Green
·
--
https://mail.python.org/mailman/listinfo/python-list
Thank you.
Uri.
אורי
u...@speedy.net
On Tue, Jul 9, 2024 at 6:40 PM Barry Scott wrote:
>
>
> On 9 Jul 2024, at 06:13, אורי via Python-list <python-list@python.org>
> wrote:
>
> I tried to subscribe to Python-ideas
>
>
> These days ideas are discus
> On 9 Jul 2024, at 06:13, אורי via Python-list <python-list@python.org>
> wrote:
>
> I tried to subscribe to Python-ideas
These days ideas are discussed on https://discuss.python.org/
It is rare to see an idea on the mailing list.
Barry
--
https://mail.python.or
test-default-languages=True to be set as a default.
2. I tried to subscribe to Python-ideas python-id...@python.org, but I
can't login to
https://mail.python.org/mailman3/lists/python-ideas.python.org/. Although I
did login to https://mail.python.org/mailman/options/python-list . Do I
have
On 06/07/2024 12:57, Oscar Benjamin via Python-list wrote:
On Sat, 6 Jul 2024 at 11:55, Rob Cliffe via Python-list
wrote:
Consider this scenario (which I ran into in real life):
I want to open a text file and do a lot of processing on the lines
of that file.
If the file does
Daniel via Python-list writes:
> One thing missing is a good textmode irc client that will connect to
> quassel core.
>
> I've seen efforts to make a plugin for weechat but, to date, I don't see much
> progress on that end.
>
> In your wisdom, would python be a good envi
s that would be
kept up to date by one process and asked for by all the others.
--
Chris Green
·
--
https://mail.python.org/mailman/listinfo/python-list
is is even simpler than using a file.
>
Yes, but it's conceptually (and programming wise) much simpler to have
separate scripts. Some of them are simple 'on demand' scripts that I
run from the command line when I want to know something. Others are
scripts that drive displays on control panels.
--
Chris Green
·
--
https://mail.python.org/mailman/listinfo/python-list
.
On Sun, Jul 7, 2024 at 11:12 PM Chris Green via Python-list
wrote:
>
> I have a Raspberry Pi in my boat that uses I2C to read a number of
> voltages and currents (using ADS1115 A2D) so I can monitor the battery
> condition etc.
>
> At present various different scripts (i.e. pr
> On 7 Jul 2024, at 23:21, Barry via Python-list wrote:
>
>
>
>> On 7 Jul 2024, at 22:09, Tomas Ukkonen via Python-list
>> wrote:
>>
>>Py_Initialize();
>
> You also need to tell python to init threading.
I'm in front of my de
> On 7 Jul 2024, at 23:47, MRAB via Python-list wrote:
>
> For clarity I'd recommend os.replace instead. This is because on Windows
> os.rename it would complain if the target file already exists, but os.replace
> has the same behaviour on both Linux and Windows.
Agreed
--
https://mail.python.org/mailman/listinfo/python-list
re
line: some lines of text
--
https://mail.python.org/mailman/listinfo/python-list
On 2024-07-07 23:27, Barry via Python-list wrote:
On 7 Jul 2024, at 22:13, Chris Green via Python-list
wrote:
a simple file lock can then
be used to prevent simultaneous access (well, simultaneous access when
the writing process is writing).
There is a simple pattern to make this robust
> On 7 Jul 2024, at 22:13, Chris Green via Python-list
> wrote:
>
> a simple file lock can then
> be used to prevent simultaneous access (well, simultaneous access when
> the writing process is writing).
There is a simple pattern to make this robust.
Write new values to
(trying to access the file after "with f"
raises the same
ValueError: I/O operation on closed file.
I'm using Python 3.11.5.
Best wishes
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
/mailman/listinfo/python-list
python.org/mailman/listinfo/python-list
/listinfo/python-list
pen()` call returns a file object _which can be used as
a context manager_. It is separate from the `with` itself.
--
https://mail.python.org/mailman/listinfo/python-list
On 6/07/24 22:49, Rob Cliffe via Python-list wrote:
Consider this scenario (which I ran into in real life):
I want to open a text file and do a lot of processing on the lines
of that file.
If the file does not exist I want to take appropriate action, e.g.
print an error message
print(f"File {FileName} not found:")
sys.exit()
Now the "process" function has been factored out and can be well
documented as to what it is doing on each line, and this code can be
documented as running process on each line of the file.
On 7/6/24 6:49 AM, Rob Cliffe vi
On 7/6/2024 6:49 AM, Rob Cliffe via Python-list wrote:
Consider this scenario (which I ran into in real life):
I want to open a text file and do a lot of processing on the lines
of that file.
If the file does not exist I want to take appropriate action, e.g.
print an error message
On Sat, 6 Jul 2024 at 11:55, Rob Cliffe via Python-list
wrote:
>
> Consider this scenario (which I ran into in real life):
> I want to open a text file and do a lot of processing on the lines
> of that file.
> If the file does not exist I want to take appropriate actio
On 06/07/2024 11:49, Rob Cliffe via Python-list wrote:
> If the file does not exist I want to take appropriate action, e.g.
> print an error message and abort the program.
> I might write it like this:
>
> try:
> with open(FileName) as f:
> for ln in f:
On 2024-07-06 at 11:49:06 +0100,
Rob Cliffe via Python-list wrote:
> Is there a better / more Pythonic solution?
https://docs.python.org/3/library/fileinput.html
At least this attempts to abstract the problem of iterating over a file
(or multiple files) into a library routine. I've u
modify the last attempt to open the file twice, which would
work, but seems like a kludge (subject to race condition, inefficient).
Is there a better / more Pythonic solution?
Best wishes
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
inhahe writes:
> On Thu, Jul 4, 2024 at 5:14 AM Daniel via Python-list <
> python-list@python.org> wrote:
>
>> Hi guys -
>>
>> I have historical experience developing sofwtare for my own use. It has
>> been
>> quite a while since doing so and the a
Hi.
Just FYI, I use Erc (in Emacs). I'm not a very advanced user, perhaps,
but I never felt like I miss anything. That's not to stop you from
making your own, but if you just need a decent text client for IRC,
then there's already at least one.
On Thu, Jul 4, 2024 at 11:30 AM inhahe via Python
On Thu, Jul 4, 2024 at 5:22 AM inhahe wrote:
>
>
> On Thu, Jul 4, 2024 at 5:14 AM Daniel via Python-list <
> python-list@python.org> wrote:
>
>>
>> In your wisdom, would python be a good environment to accomplish this?
>
>
> I think Python would
On Thu, Jul 4, 2024 at 5:14 AM Daniel via Python-list <
python-list@python.org> wrote:
> Hi guys -
>
> I have historical experience developing sofwtare for my own use. It has
> been
> quite a while since doing so and the advent of new languages has brought me
> here
Hi guys -
I have historical experience developing sofwtare for my own use. It has been
quite a while since doing so and the advent of new languages has brought me
here. Python has built quite a reputation. It would be fun to pick up a
new language while I'm at it.
I've been a consumer of IRC
*ANNOUNCING*
eGenix PyRun - One file Python Runtime
Version 2.5.0
Python runtime taking up just 4-6MB on disk
This announcement is also available on our web-site for online reading:
https://www.egenix.com/company/news/eGenix-PyRun-2.5.0-GA.html
sed in this way, it becomes (typically) a method.
--
https://mail.python.org/mailman/listinfo/python-list
On 6/28/2024 12:08 PM, Ulrich Goebel via Python-list wrote:
Hi,
a class can have methods, and it can have attributes, which can hold a
function. Both is well known, of course.
My question: Is there any difference?
The code snipped shows that both do what they should do. But __dict__ includes
On 6/28/24 10:08, Ulrich Goebel via Python-list wrote:
By the way: in my usecase I want to pass different functions to different
instances of MyClass. It is in the context of a database app where I build
Getters for database data and pass one Getter per instance.
If I understood what you're
On 2024-06-28 18:08:54 +0200, Ulrich Goebel via Python-list wrote:
> a class can have methods, and it can have attributes, which can hold a
> function. Both is well known, of course.
>
> My question: Is there any difference?
>
> The code snipped shows that both do w
instances of MyClass. It is in the context of a database app where I build
Getters for database data and pass one Getter per instance.
Thanks for hints
Ulrich
--
Ulrich Goebel
--
https://mail.python.org/mailman/listinfo/python-list
The *next to last* Python 3.13 beta version, beta 3, is now released:
https://www.python.org/downloads/release/python-3130b3/
*This is a beta preview of Python 3.13*
Python 3.13 is still in development. This release, 3.13.0b3, is the third
of four beta release previews of 3.13.
Beta release
On 6/26/24 09:29, marc nicole wrote:
Browsing the available version of tensorflow for the dates before January
2021 (date when Python 2.7 stopped being supported) I can't find a
tensorflow version for Python 2.7 that works under Windows.
The reference site I use is https://pypi.org/project
Browsing the available version of tensorflow for the dates before January
2021 (date when Python 2.7 stopped being supported) I can't find a
tensorflow version for Python 2.7 that works under Windows.
The reference site I use is https://pypi.org/project/tensorflow/
Anybody can point out
On Wed, 26 Jun 2024 at 03:40, Anton Shepelev via Python-list
wrote:
>
> Chris Angelico to dn:
>
> > > Python mailing-lists are covered by the Code of Conduct
> > > and monitored by ListAdmins. Thus, there are controls
> > > which limit the impact which a
Chris Angelico to dn:
> > Python mailing-lists are covered by the Code of Conduct
> > and monitored by ListAdmins. Thus, there are controls
> > which limit the impact which advertisers and others with
> > non-pythonic aims might otherwise exert!
>
> So long as ther
- against proprietary attachments
--
https://mail.python.org/mailman/listinfo/python-list
This discussion has wandered far from my original mention that I found it
hard to reply to people using an invalid email address. I see no real
connection to python except insofar as at least one spam-filter mentioned is
written in python!
Just to add an observation, the people writing here have
On Tue, 25 Jun 2024 at 11:41, Grant Edwards via Python-list
wrote:
> I've been using the same e-mail address for about 20 years. I've use
> that e-mail address with probably close to 100 retailers, charities,
> open-source projects, media sites, and various other organizations.
Mostly
On 2024-06-24, Barry Scott via Python-list wrote:
>> On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list
>> wrote:
>>
>> The spammers won the spam wars, so even if you have someone's real
>> e-mail address, that's no guarantee that you can contact them. [...
On Tue, 25 Jun 2024 at 08:31, dn via Python-list wrote:
> Python mailing-lists are covered by the Code of Conduct and monitored by
> ListAdmins. Thus, there are controls which limit the impact which
> advertisers and others with non-pythonic aims might otherwise exert!
>
So lon
On 25/06/24 05:17, Thomas Passin via Python-list wrote:
On 6/24/2024 5:51 AM, Barry Scott via Python-list wrote:
On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list
wrote:
The spammers won the spam wars, so even if you have someone's real
e-mail address, that's no guarantee that you
Marc,
Several people have supplied feedback on whether your request is a good fit for
here. Ultimately it is up to the owner/moderator. In particular, your request
to the Tutor List may not fit the purpose and be a bit complex and to the main
Python List also outside some common usage whether
On 6/24/2024 5:51 AM, Barry Scott via Python-list wrote:
On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list
wrote:
The spammers won the spam wars, so even if you have someone's real
e-mail address, that's no guarantee that you can contact them. You
certainly wouldn't be able
> On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list
> wrote:
>
> The spammers won the spam wars, so even if you have someone's real
> e-mail address, that's no guarantee that you can contact them. You
> certainly wouldn't be able to contact me at my real e-mail add
On 2024-06-24 01:14:22 +0100, MRAB via Python-list wrote:
> Tkinter in recent versions of Python can handle astral characters, at least
> back to Python 3.8, the oldest I have on my Windows PC.
I just tried modifying
https://docs.python.org/3/library/tkinter.html#a-hello-world-program
to d
r from below all using both
> > hands).
> >
> > Specifically, my problem is applied to a NAO robot environment where I
> > retrieve a target object coordinates using the following code:
>
> This is almost entirely outside the Python domain and all within
> your 3rd party e
On Mon, 24 Jun 2024 at 10:18, MRAB via Python-list
wrote:
> Tkinter in recent versions of Python can handle astral characters, at
> least back to Python 3.8, the oldest I have on my Windows PC.
Good to know, thanks! I was hoping that would be the case, but I don't
have a Windows system to
On 2024-06-24 00:30, Chris Angelico via Python-list wrote:
On Mon, 24 Jun 2024 at 08:20, Rayner Lucas via Python-list
wrote:
In article ,
ros...@gmail.com says...
>
> If you switch to a Linux system, it should work correctly, and you'll
> be able to migrate the rest of the way onto
On Mon, 24 Jun 2024 at 08:20, Rayner Lucas via Python-list
wrote:
>
> In article ,
> ros...@gmail.com says...
> >
> > If you switch to a Linux system, it should work correctly, and you'll
> > be able to migrate the rest of the way onto Python 3. Once you achie
And even if I did, you can't even trust e-mail
providers not to give your address out to spammers.
The only function e-mail addresses serve now is to positively identify
the sender of a Usenet posting so he can be targeted for harassment,
lawsuits, or worse.
--
https://mail.python.org/mailman/listinfo/python-list
In article , r...@zedat.fu-
berlin.de says...
>
> I didn't really do a super thorough deep dive on this,
> but I'm just giving the initial impression without
> actually being familiar with Tkinter under Python 2,
> so I might be wrong!
>
> The Text widget typicall
In article ,
ros...@gmail.com says...
>
> If you switch to a Linux system, it should work correctly, and you'll
> be able to migrate the rest of the way onto Python 3. Once you achieve
> that, you'll be able to operate on Windows or Linux equivalently,
> since Python 3 solv
get_transformer_list, axis_mask_list, times).
src:
http://doc.aldebaran.com/1-14/dev/python/examples/almath/index.html?highlight=offset
This question is specific to NAO environment but in general how to go
about this task? what is a most common algorithm used in this case? Do
I have to also get th
; Could you specify what is wrong with what you are doing? you show us code
> that uses an environment you point to that is largely outside of basic
> Python.
>
> There is no one way to get from point A to point B and various constraints
> you have not mentioned can apply. How ma
On Sat, 22 Jun 2024 at 03:28, Rayner Lucas via Python-list
wrote:
> I'm curious about something I've encountered while updating a very old
> Tk app (originally written in Python 1, but I've ported it to Python 2
> as a first step towards getting it running on modern systems).
>
I'm curious about something I've encountered while updating a very old
Tk app (originally written in Python 1, but I've ported it to Python 2
as a first step towards getting it running on modern systems). The app
downloads emails from a POP server and displays them. At the moment, the
code
So there's been discussion in comp.lang.c and comp.unix.shell
about doing a "versionsort(3)" type sort on a list
of parameters. glibc offers strverscmp(3) for this type
of sort, and here I am posting a q python program to expose
that to its sort routine for commentary and future
Thank you all for your responses!
On Tue, Jun 18, 2024 at 9:54 PM Jon Ribbens via Python-list
wrote:
>
> datetime.now(ZoneInfo("America/New_York")).isoformat()
Both .isoformat() and "%:z" work.
--
Tangra Mega Rock: http://www.radiotangra.com
--
https://mail.p
:24:09-04:00
>
> The closest I got in python is
>
> from datetime import datetime
> from zoneinfo import ZoneInfo
>
> s = datetime.strftime(datetime.now(ZoneInfo("America/New_York")),
> "%Y-%m-%dT%H:%M:%S%z")
> print(s)
>
> This prints the same as
On 2024-06-19 00:32, Ivan "Rambius" Ivanov via Python-list wrote:
Hello,
How can I convert a date, usually datetime.now(), into a format where
the timezone is in hours:minutes format. I was able to get that format
in shell:
$ date +%Y-%m-%dT%H:%M:%S%:z
2024-06-18T19:24:09-04:00
The
Hello,
How can I convert a date, usually datetime.now(), into a format where
the timezone is in hours:minutes format. I was able to get that format
in shell:
$ date +%Y-%m-%dT%H:%M:%S%:z
2024-06-18T19:24:09-04:00
The closest I got in python is
from datetime import datetime
from zoneinfo import
On 2024-06-14 06:10:06 -, candycanearter07 via Python-list wrote:
> Phil Carmody wrote at 12:01 this Thursday (GMT):
> > I'd say you can't beat the verbosity, or lack thereof of just plain
> > zsh/bash:
> > $ echo {1,2,3,4}0{1,2,3}
> > 101 102 103 201 202
On 2024-06-18, Mats Wichmann via Python-list wrote:
> On 6/17/24 17:51, dn via Python-list wrote:
>
>> +1
>>
>> The "public" part is not to embarrass posters, but recognition that
>> there are likely other people 'out there' (or arriving in-futu
On 6/17/24 17:51, dn via Python-list wrote:
+1
The "public" part is not to embarrass posters, but recognition that
there are likely other people 'out there' (or arriving in-future if they
care to read the archives) experiencing a similar problem. (hence need
for descriptive Sub
(win32clipboard.CF_UNICODETEXT,
hMem)
# Now the system owns the global memory.
except:
kernel32.GlobalFree(hMem)
raise
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Jun 17, 2024 at 8:36 PM MRAB via Python-list
wrote:
> On 2024-06-17 20:27, Rob Cliffe via Python-list wrote:
>
> > SetClipboardData(CF_UNICODETEXT, "0")
> > CloseClipboard()
win32clipboard.SetClipboardData() first tries to covert the second
argument as an int
On 6/17/2024 9:30 PM, MRAB via Python-list wrote:
On 2024-06-17 20:27, Rob Cliffe via Python-list wrote:
Recently I acquired a new laptop running WIndows 11; my previous one
uses WIndows 10. I encountered a strange problem:
I am using the win32clipboard backage (part of pywin32), and when I
On 2024-06-17 20:27, Rob Cliffe via Python-list wrote:
Recently I acquired a new laptop running WIndows 11; my previous one
uses WIndows 10. I encountered a strange problem:
I am using the win32clipboard backage (part of pywin32), and when I use
SetClipboardData() to write text which consists
On 18/06/24 05:29, Roel Schroeven via Python-list wrote:
AVI GROSS via Python-list schreef op 17/06/2024 om 17:03:
I simply am thinking that people who do not allow me to easily reply
to them
directly, should be ignored by me and not get my cooperation that way.
FWIW, personally I (mostly
the group and I would not have received some chances to
learn if I could not ask questions in private that clearly did not fit the
purpose of the group.
So, I am outa this conversation IN PUBLIC. LOL!
-Original Message-----
From: Python-list On
Behalf Of Grant Edwards via Python-list
Sent: Monda
On 2024-06-17, Roel Schroeven via Python-list wrote:
> FWIW, personally I (mostly) don't see the point of replying to people
> personally. To me a public mailing list is much like any public forum,
> where my expectation is that conversations happen in public. To me it
> always
o far
Traceback (most recent call last):
File "C:\TEST*.PY", line 8, in
SetClipboardData(CF_UNICODETEXT, "0")
pywintypes.error: (0, 'SetClipboardData', 'No error message is available')
Can anyone shed light on this?
Best wishes
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
AVI GROSS via Python-list schreef op 17/06/2024 om 17:03:
I simply am thinking that people who do not allow me to easily reply to them
directly, should be ignored by me and not get my cooperation that way.
FWIW, personally I (mostly) don't see the point of replying to people
personally. To me
that it seems the discussions with people
in the email list are more useful to me.
-Original Message-
From: Python-list On
Behalf Of Marco Moock via Python-list
Sent: Saturday, June 15, 2024 2:03 AM
To: python-list@python.org
Subject: Re: Anonymous email users
On 15.06.2024 um 10:30 Uhr dn wrote
On 15.06.2024 um 10:30 Uhr dn wrote:
> These mailing-lists all run under the Python Code of Conduct.
>
> This also effects a conundrum. Firstly, that someone abusing others
> (for example) shall be held responsible. Secondly, that in order to
> hold someone responsible,
1 - 100 of 5940 matches
Mail list logo