[RELEASE] Python 3.13.0 beta 4 released.

2024-07-18 Thread Thomas Wouters via Python-list
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 are

RE: Relatively prime integers in NumPy

2024-07-12 Thread AVI GROSS via Python-list
Dmitry, Efficiency of several kinds is hotly debated and sometimes it depends a lot on what is done within loops. Many suggest a mild speed up of some comprehensions over loops but the loops are not gone but somewhat hidden and perhaps some aspects are faster for having been written in

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via Python-list
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'

RE: Relatively prime integers in NumPy

2024-07-12 Thread AVI GROSS via Python-list
Dmitry, I clearly did not understand what you wanted earlier as you had not made clear that in your example, you already had progressed to some level where you had the data and were now doing a second step. So, I hesitate to say much until either nobody else addressed the issue (as clearly

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via Python-list
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

Re: Password Hash Validation (Posting On Python-List Prohibited)

2024-07-12 Thread Lawrence D'Oliveiro via Python-list
On Fri, 21 Jun 2024 06:32:58 - (UTC), I wrote: > On Fri, 21 Jun 2024 03:40:55 - (UTC), I wrote: > >> I think I will create my own wrapper using ctypes. > > Done . The repo now includes an example script that exercises the various functions of the

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via 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' of

Re: Best use of "open" context manager

2024-07-12 Thread Albert-Jan Roskam via Python-list
Or like below, although pylint complains about this: "consider using with". Less indentation this way. f = None try: f = open(FILENAME) records = f.readlines() except Exception: sys.exit(1) finally: if f is not None: f.close() --

Re: Relatively prime integers in NumPy

2024-07-12 Thread Peter J. Holzer via 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 brings me to

RE: Relatively prime integers in NumPy

2024-07-11 Thread AVI GROSS via Python-list
OK. That explains a bit more. If I understand what you are looking for is a fast implementation and quite often in Pyhon it means using code written in another language such as C that is integrated carefully in a moule or two. Another tack is to replace many explicit loops with often much

Re: Relatively prime integers in NumPy

2024-07-11 Thread Oscar Benjamin via Python-list
(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 > example, in case of this

RE: Relatively prime integers in NumPy

2024-07-11 Thread AVI GROSS via Python-list
Дмитрий, You may think you explained what you wanted but I do not see what result you expect from your examples. Your request is a bit too esoteric to be a great candidate for being built into a module like numpy for general purpose se but I can imagine it could be available in modules build on

Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
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

Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via 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. --

Problem using mysql library

2024-07-11 Thread Tobiah via Python-list
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 File

python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
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", "credits" or "license" for

Relatively prime integers in NumPy

2024-07-11 Thread Popov, Dmitry Yu via Python-list
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 example, in case of this array: [[1,5,8], [2,4,8], [3,3,9]] I can imagine a function which would return array of common factors

Re: Best (simplest) way to share data

2024-07-11 Thread Chris Green via Python-list
Stefan Ram wrote: > Chris Green wrote or quoted: > >That's exactly the sort of solution I was wondering about. Is there a > >ready made module/library for handling this sort of thing? Basically > >it will just be a string of a few tens of characters that would be > >kept up to date by one

Re: A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-09 Thread אורי via 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 discussed on https://discuss.python.org/ > It

Re: A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-09 Thread Barry Scott via Python-list
> 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 --

A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-08 Thread אורי via Python-list
Hi, Please look at this Stack Overflow post: https://stackoverflow.com/questions/78722378/parser-add-mutually-exclusive-group-how-can-i-set-a-default-value 1. Is there a way to add a default to parser add_mutually_exclusive_group groups - a value that will be set by default? In this case I want

Re: Best use of "open" context manager

2024-07-08 Thread Rob Cliffe via Python-list
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 not

Re: python for irc client

2024-07-08 Thread orzodk via Python-list
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 environment to accomplish

Re: Best (simplest) way to share data (Posting On Python-List Prohibited)

2024-07-08 Thread Chris Green via Python-list
Lawrence D'Oliveiro wrote: > On Sat, 6 Jul 2024 08:28:41 +0100, Chris Green wrote: > > > One fairly obvious way is to have single process/script which reads the > > A2D values continuously and writes them to a file. All other scripts > > then read from the file as needed, a simple file lock can

Re: Best (simplest) way to share data between processes

2024-07-08 Thread Chris Green via Python-list
Piergiorgio Sartor wrote: > On 06/07/2024 09.28, Chris Green 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. processes)

Re: Best (simplest) way to share data between processes

2024-07-08 Thread Left Right via Python-list
If resource usage isn't an issue, then the _easy_ thing to do, that would also be easily correct is to have a server doing all the h/w-related reading and clients talking to that server. Use for the server the technology you feel most confident with. Eg. you may use Python's http package. I

Re: PyGILState_Ensure() deadlocks, why?

2024-07-08 Thread Barry Scott via Python-list
> 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 dev machine now and checking up on threading. There is no

Re: Best (simplest) way to share data between processes

2024-07-08 Thread Barry Scott via Python-list
> 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. In this case the

Re: Best use of "open" context manager

2024-07-07 Thread Cameron Simpson via Python-list
On 07Jul2024 22:22, Rob Cliffe wrote: it's legal, but doesn't work (trying to access the file after "with f" raises the same     ValueError: I/O operation on closed file. Just to this: of course. The with closes the file. But my version runs the with after the try/except. --

Re: Best use of "open" context manager

2024-07-07 Thread Cameron Simpson via Python-list
On 07Jul2024 22:22, Rob Cliffe wrote: Remember, the `open()` call returns a file object _which can be used as a context manager_. It is separate from the `with` itself. Did you test this?     f = open(FileName) as f: is not legal syntax. No. You're right, remove the "as f:". it's legal, but

Re: Best (simplest) way to share data between processes

2024-07-07 Thread MRAB via 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.

Re: Best (simplest) way to share data between processes

2024-07-07 Thread Barry via Python-list
> 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 a tmp file. Close

Re: Best use of "open" context manager

2024-07-07 Thread Rob Cliffe via Python-list
On 07/07/2024 02:08, Cameron Simpson wrote: On 06Jul2024 11:49, Rob Cliffe wrote: try:     f = open(FileName) as f:     FileLines = f.readlines() except FileNotFoundError:     print(f"File {FileName} not found")     sys.exit() # I forgot to put "f.close()" here -:) for ln in File Lines:      

Re: Best (simplest) way to share data between processes

2024-07-07 Thread Gordinator via Python-list
On 06/07/2024 12:32, Stefan Ram wrote: But why overengineer? If you feel comfortable with the file solution, go for it! The only drawback might be that it's a bit slower than other approaches. I absolutely agree. Overengineering is generally a bad idea because you're using a complex

Re: Best (simplest) way to share data between processes

2024-07-07 Thread Piergiorgio Sartor via Python-list
On 06/07/2024 09.28, Chris Green 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. processes) just read the values using the I2C bus whenever

Best (simplest) way to share data between processes

2024-07-07 Thread Chris Green via Python-list
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. processes) just read the values using the I2C bus whenever they need to but I'm pretty sure this

Re: Best use of "open" context manager

2024-07-06 Thread Cameron Simpson via Python-list
On 06Jul2024 11:49, Rob Cliffe wrote: try:     f = open(FileName) as f:     FileLines = f.readlines() except FileNotFoundError:     print(f"File {FileName} not found")     sys.exit() # I forgot to put "f.close()" here -:) for ln in File Lines:         print("I do a lot of processing here")      

Re: Best use of "open" context manager

2024-07-06 Thread dn via 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 and

Re: Best use of "open" context manager

2024-07-06 Thread Richard Damon via Python-list
My thoughts is that if the "many lines of code" puts the except to far from the try, then perhaps it would have made sense to factor out some part there into a function. Perhaps like: try:    with open(FileName) as f:   for ln in f{ process(ln) except FileNotFoundError:   

Re: Best use of "open" context manager

2024-07-06 Thread Thomas Passin via Python-list
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

Re: Best use of "open" context manager

2024-07-06 Thread Oscar Benjamin via Python-list
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 action, e.g. > print an

Re: Best use of "open" context manager

2024-07-06 Thread Alan Gauld via Python-list
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: >            

Re: Best use of "open" context manager

2024-07-06 Thread Dan Sommers via Python-list
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 used it a

Best use of "open" context manager

2024-07-06 Thread Rob Cliffe via Python-list
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 and abort the program. I might write it like this: try:    

Re: python for irc client

2024-07-04 Thread Daniel via 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 advent of new languages has brought me >> here.

Re: python for irc client

2024-07-04 Thread Left Right via Python-list
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

Re: python for irc client

2024-07-04 Thread inhahe via Python-list
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 be a great language to write an IRC client in,

Re: python for irc client

2024-07-04 Thread inhahe via Python-list
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. Python has built quite a

python for irc client

2024-07-04 Thread Daniel via Python-list
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

ANN: eGenix PyRun - One file Python Runtime 2.5.0

2024-07-01 Thread eGenix Team via Python-list
*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

Re: Difference method vs attribut = function

2024-06-30 Thread Dieter Maurer via Python-list
Ulrich Goebel wrote at 2024-6-28 18:08 +0200: >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? I think you should make the distinction "class versus instance attribute" rather than

Re: Difference method vs attribut = function

2024-06-29 Thread Thomas Passin via 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

Re: Difference method vs attribut = function

2024-06-29 Thread Mats Wichmann via Python-list
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

Re: Difference method vs attribut = function

2024-06-29 Thread Peter J. Holzer via Python-list
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 what they should do. But

Difference method vs attribut = function

2024-06-29 Thread Ulrich Goebel via Python-list
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 just the method, while dir detects the method and the

[RELEASE] Python 3.13.0 beta 3 released.

2024-06-27 Thread Thomas Wouters via 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

Re: [Tutor] How to install tensorflow on Python 2.7 in Windows?

2024-06-26 Thread Mats Wichmann via Python-list
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

How to install tensorflow on Python 2.7 in Windows?

2024-06-26 Thread marc nicole via Python-list
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 a

Re: Anonymous email users

2024-06-25 Thread Chris Angelico via Python-list
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 advertisers and others with > > >

Re: Anonymous email users

2024-06-25 Thread Anton Shepelev via Python-list
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 there's a newsgroup gateway, those

Re: Anonymous email users

2024-06-25 Thread Anton Shepelev via Python-list
Sebastian Wells: > 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. No so with me. My e-mail address here is munged, but in a very obvious way, and no, my mailbox is not overwhelmed with spam. I make a habit

RE: Anonymous email users

2024-06-24 Thread AVI GROSS via 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

Re: Anonymous email users

2024-06-24 Thread Chris Angelico via Python-list
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 the same,

Re: Anonymous email users

2024-06-24 Thread Grant Edwards via Python-list
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. [...] > > My email address is well

Re: Anonymous email users

2024-06-24 Thread Chris Angelico via Python-list
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 long as there's a

Re: Anonymous email users

2024-06-24 Thread dn via Python-list
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

RE: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects)

2024-06-24 Thread AVI GROSS via Python-list
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

Re: Anonymous email users

2024-06-24 Thread Thomas Passin via Python-list
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 to

Re: Anonymous email users

2024-06-24 Thread Barry Scott via Python-list
> 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 address, > unless you

Tkinter and astral characters (was: Decoding bytes to text strings in Python 2)

2024-06-24 Thread Peter J. Holzer via Python-list
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 display

Re: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects)

2024-06-24 Thread marc nicole via Python-list
What are the parameters to account for in this type of algorithm? are there some checks to perform the arm moves ? for example angle moves or cartesian moves based on some distance thresholds? Any idea about the pseudo-algorithm is welcome. Thanks. Le dim. 23 juin 2024 à 10:33, Alan Gauld via

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Chris Angelico via Python-list
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 check

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread MRAB via Python-list
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 Python 3.

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Chris Angelico via Python-list
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 achieve > > that, you'll be able to

Re: Anonymous email users

2024-06-23 Thread Sebastian Wells via Python-list
On Fri, 14 Jun 2024 18:00:37 -0400, avi.e.gross wrote: > I notice that in some recent discussions, we have users who cannot be > replied to directly as their email addresses are not valid ones, and I > believe on purpose. Examples in the thread I was going to reply to are: > >

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Rayner Lucas via 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 typically expects text in Tcl

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Rayner Lucas via Python-list
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 solved this problem. At

How to go about a simple object grabbing in python (given coordinates of arms and objects)

2024-06-23 Thread marc nicole via Python-list
Hello to all of this magnificent community! I have this problem I had already spent a few days on and still can't figure out a proper solution. So, given the x,y,z coordinates of a target object and the offset x,y,z of arms of a robot, what is a good algorithm to perform to grab the object

Re: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects)

2024-06-22 Thread marc nicole via Python-list
My code is just an attempt at the task, it is not exact as what relates to the coordinates (e.g., doesn't account for the size of the object. I would like to have a idea on the general approach to such problems (even a pseudo code would do) "Get the hands rapidly enough in the vicinity and then

Re: Decoding bytes to text strings in Python 2

2024-06-21 Thread Chris Angelico via Python-list
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 am using

Decoding bytes to text strings in Python 2

2024-06-21 Thread Rayner Lucas via Python-list
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

glibc strverscmp called from python

2024-06-20 Thread vallor via Python-list
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 reference.

Re: Timezone in HH:MM Format

2024-06-18 Thread Ivan "Rambius" Ivanov via Python-list
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 --

Re: Timezone in HH:MM Format

2024-06-18 Thread Jon Ribbens via Python-list
On 2024-06-18, Ivan "Rambius" Ivanov 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 closest I got in

Re: Timezone in HH:MM Format

2024-06-18 Thread MRAB via Python-list
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 closest I

Timezone in HH:MM Format

2024-06-18 Thread Ivan "Rambius" Ivanov via Python-list
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

Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )

2024-06-18 Thread Peter J. Holzer via Python-list
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 203 301 302 303 401 402 403 > >

Re: Anonymous email users

2024-06-18 Thread Grant Edwards via Python-list
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-future if they >> care to read the archives)

Re: Anonymous email users

2024-06-18 Thread Mats Wichmann via Python-list
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 Subject lines -

Re: win32clipboard writing to clipboard on Windows 11

2024-06-18 Thread Eryk Sun via Python-list
On Tue, Jun 18, 2024 at 2:19 AM Eryk Sun wrote: > > > def set_clipboard_text(text): > hMem = global_alloc_text(text) > try: > win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, > hMem) > # Now the

Re: win32clipboard writing to clipboard on Windows 11

2024-06-18 Thread Eryk Sun via 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 integer handle to global memory,

Re: win32clipboard writing to clipboard on Windows 11

2024-06-17 Thread Thomas Passin via Python-list
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

Re: win32clipboard writing to clipboard on Windows 11

2024-06-17 Thread MRAB via Python-list
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

Re: Anonymous email users

2024-06-17 Thread dn via Python-list
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)

RE: Anonymous email users

2024-06-17 Thread AVI GROSS via Python-list
It seems clear we have people on mailing lists that see it as a purely public forum, and that is fine for them. I have found plenty of times I choose not to continue in public and waste time for people as in this reply on a topic I raised and now will move away from. I have in the past, for

Re: Anonymous email users

2024-06-17 Thread Grant Edwards via Python-list
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 feels weird

win32clipboard writing to clipboard on Windows 11

2024-06-17 Thread Rob Cliffe via Python-list
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 ***entirely of digits*** to the clipboard, I either get

Re: Anonymous email users

2024-06-17 Thread Roel Schroeven via 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 a

RE: Anonymous email users

2024-06-17 Thread AVI GROSS via Python-list
Thanks, Marco, for explaining. I, personally, have no interest in finding out who people are in this case. 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. I do understand reasons people use fake

Re: Anonymous email users

2024-06-17 Thread Marco Moock via Python-list
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, he/she/... must be

  1   2   3   4   5   6   7   8   9   10   >