Re: How to catch a fatal error in Python 2.7?

2024-12-09 Thread Michael Torrie via Python-list
On 12/9/24 12:19 PM, marc nicole via Python-list wrote: > Hello, > > The fatal error exits the program with a code -1 while referencing the > memory address involved and nothing else. > > How to catch it in Python 2.7? Does the problem occur with Python 3.x? At this date,

How to catch a fatal error in Python 2.7?

2024-12-09 Thread marc nicole via Python-list
Hello, The fatal error exits the program with a code -1 while referencing the memory address involved and nothing else. How to catch it in Python 2.7? PS: please not I am not talking about exceptions but an error resulting from the disconnection of my bluetooth microphone abruptly and leading

Re: [Tutor] How to stop a specific thread in Python 2.7?

2024-10-11 Thread Dan Ciprus (dciprus) via Python-list
Thank you for the hint ! On Fri, Oct 04, 2024 at 09:17:19AM GMT, Cameron Simpson wrote: On 03Oct2024 22:12, Dan Ciprus (dciprus) wrote: I'd be interested too :-). Untested sketch: def make_thread(target, *a, E=None, **kw): ''' Make a new Event E and Thread T, pass `[E,*a]`

Re: [Tutor] How to stop a specific thread in Python 2.7?

2024-10-03 Thread Cameron Simpson via Python-list
On 03Oct2024 22:12, Dan Ciprus (dciprus) wrote: I'd be interested too :-). Untested sketch: def make_thread(target, *a, E=None, **kw): ''' Make a new Event E and Thread T, pass `[E,*a]` as the target positional arguments. A shared preexisting Event may be

Re: [Tutor] How to stop a specific thread in Python 2.7?

2024-10-03 Thread Dan Ciprus (dciprus) via Python-list
I'd be interested too :-). On Thu, Sep 26, 2024 at 03:34:05AM GMT, marc nicole via Python-list wrote: Could you show a python code example of this? On Thu, 26 Sept 2024, 03:08 Cameron Simpson, wrote: On 25Sep2024 22:56, marc nicole wrote: >How to create a per-thread event in Py

Re: How to stop a specific thread in Python 2.7?

2024-09-26 Thread Left Right via Python-list
That's one of the "disadvantages" of threads: you cannot safely stop a thread. Of course you could try, but that's never a good idea. The reason for this is that threads share memory. They might be holding locks that, if killed, will never be unlocked. They might (partially) modify the shared state

Re: [Tutor] How to stop a specific thread in Python 2.7?

2024-09-25 Thread marc nicole via Python-list
Could you show a python code example of this? On Thu, 26 Sept 2024, 03:08 Cameron Simpson, wrote: > On 25Sep2024 22:56, marc nicole wrote: > >How to create a per-thread event in Python 2.7? > > Every time you make a Thread, make an Event. Pass it to the thread > worker funct

Re: How to stop a specific thread in Python 2.7?

2024-09-25 Thread Cameron Simpson via Python-list
On 25Sep2024 22:56, marc nicole wrote: How to create a per-thread event in Python 2.7? Every time you make a Thread, make an Event. Pass it to the thread worker function and keep it to hand for your use outside the thread. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to stop a specific thread in Python 2.7?

2024-09-25 Thread marc nicole via Python-list
How to create a per-thread event in Python 2.7? On Wed, 25 Sept 2024, 22:47 Cameron Simpson via Python-list, < python-list@python.org> wrote: > On 25Sep2024 19:24, marc nicole wrote: > >I want to know how to kill a specific running thread (say by its id) > > > >for

Re: How to stop a specific thread in Python 2.7?

2024-09-25 Thread Cameron Simpson via Python-list
On 25Sep2024 19:24, marc nicole wrote: I want to know how to kill a specific running thread (say by its id) for now I run and kill a thread like the following: # start thread thread1 = threading.Thread(target= self.some_func(), args=( ...,), ) thread1.start() # kill the thread event_thread1 = t

How to stop a specific thread in Python 2.7?

2024-09-25 Thread marc nicole via Python-list
Hello guys, I want to know how to kill a specific running thread (say by its id) for now I run and kill a thread like the following: # start thread thread1 = threading.Thread(target= self.some_func(), args=( ...,), ) thread1.start() # kill the thread event_thread1 = threading.Event() event_thread

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
e or ever more elaborate debates till a moderator suggest a halt! LOL! Python, like many languages, is a fairly general purpose language that can do many things well, and some less well, and some mainly by standing on it's head while including software built in other languages. Your project

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 Tut

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 o

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

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Chris Angelico via Python-list
haracters in tkinter on the one you're using. > I'm still not sure why it doesn't give an error on Windows and Because of the aforementioned weirdness of old (that is: pre-3.3) Python versions on Windows. They were built to use a messy, buggy hybrid of UCS-2 and UTF-16. S

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread Rayner Lucas via Python-list
l/Tk 8.5), I got the error: _tkinter.TclError: character U+1f40d is above the range (U+-U+) allowed by Tcl So, as your reply suggests, the problem is ultimately a limitation of Tcl/Tk itself. Perhaps I should have spent more time studying the docs for that instead of puzzling over the de

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 lea

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 betwee

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 do

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

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 mo

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: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )

2024-06-14 Thread candycanearter07 via Python-list
Phil Carmody wrote at 12:01 this Thursday (GMT): > Paul Rubin writes: >> HenHanna writes: >>> is there another (simple) way to write this? >> >> Yes, but please consider doing these easy exercises yourself instead of >> fobbing them onto other people. > > Hen's probably just an experimental GPT.

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

2024-06-13 Thread Phil Carmody via Python-list
Paul Rubin writes: > HenHanna writes: >> is there another (simple) way to write this? > > Yes, but please consider doing these easy exercises yourself instead of > fobbing them onto other people. Hen's probably just an experimental GPT. You, with your limited resources, can never train it. I'd

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread HenHanna via Python-list
n... How can this code work??? , when it's > def chunk1(seq): and it's [s] within the def-body ? it seemed as if the Compiler was doing a DWIM (Do what i mean) trick. On 09/06/2024 22:20, HenHanna via Python-list wr

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread AVI GROSS via Python-list
#x27;, 'c', 'c'], ['singleton']] >>> chunkC([1, 2, 2, 'c', 'c', 'c', 'singleton']) [[1, 1], [2, 2], ['c', 3], ['singleton', 1]] # COMMENTS The current version has flaws I have not bothered correcting. Jus

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread Rob Cliffe via Python-list
## Program output: ['aaa', 'bb', '', 'aa'] [('a', 3), ('b', 2), ('c', 4), ('a', 2)] Rob Cliffe On 09/06/2024 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Ch

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread AVI GROSS via Python-list
> i was just curiuos about simple, clever way to write it in Python It depends on what you mean by "clever". For some, it was like a suggestion on using something already available such as itertools.groupby, perhaps even better if it is actually compiled in from a language like

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread HenHanna via Python-list
:20 PM To: python-list@python.org Subject: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3)) Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread HenHanna via Python-list
On 6/9/2024 3:50 PM, MRAB wrote: On 2024-06-09 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk  '(a a   b    a a a   b b))   ==> ((a a) (b)  (a a a) (b b)) (Chunk  '(a a a a   b   c c   a a   d   e e e e))  

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread AVI GROSS via Python-list
would ask questions more clearly and perhaps explain what language they are showing us code from and so on. Life is too short to waste. -Original Message- From: Python-list On Behalf Of HenHanna via Python-list Sent: Sunday, June 9, 2024 5:20 PM To: python-list@python.org Subject: in Python

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread AVI GROSS via Python-list
would be trivial, perhaps leveraging the above. -Original Message- From: Python-list On Behalf Of HenHanna via Python-list Sent: Sunday, June 9, 2024 5:20 PM To: python-list@python.org Subject: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3)) Chunk, ChunkC -- nice si

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread MRAB via Python-list
On 2024-06-09 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a

in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread HenHanna via Python-list
Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a a) (d) (e e e e)) (Chunk '(2 2 foo bar bar

Re: Lprint = ( Lisp-style printing ( of lists and strings (etc.) ) in Python )

2024-06-01 Thread Peter J. Holzer via Python-list
On 2024-05-30 21:47:14 -0700, HenHanna via Python-list wrote: > [('the', 36225), ('and', 17551), ('of', 16759), ('i', 16696), ('a', 15816), > ('to', 15722), ('that', 11252), ('in', 10743), ('it', 10687)] > > ((the 36225) (and 17551) (of 16759) (i 16696) (a 15816) (to 15722) (that > 11252) (in 1074

Lprint = ( Lisp-style printing ( of lists and strings (etc.) ) in Python )

2024-05-31 Thread HenHanna via Python-list
;;; Pls tell me about little tricks you use in Python or Lisp. [('the', 36225), ('and', 17551), ('of', 16759), ('i', 16696), ('a', 15816), ('to', 15722), ('that', 11252), ('in', 10743), ('it',

RE: Writing to clipboard in Python 3.11

2023-11-07 Thread Jim Schwartz via Python-list
It doesn't work in python 3.12.0 -Original Message- From: Python-list On Behalf Of Thomas Passin via Python-list Sent: Tuesday, November 7, 2023 12:08 PM To: python-list@python.org Subject: Re: Writing to clipboard in Python 3.11 On 11/5/2023 7:51 PM, Rob Cliffe via Python-list

Re: Writing to clipboard in Python 3.11

2023-11-07 Thread Thomas Passin via Python-list
On 11/5/2023 7:51 PM, Rob Cliffe via Python-list wrote: Recently I switched from Python 3.8.3 to Python 3.11.4.  A strange problem appeared which was not there before: I am using the win32clipboard backage (part of pywin32), and when I use SetClipboardData() to write text which consists ENTIRELY

Re: Writing to clipboard in Python 3.11

2023-11-07 Thread MRAB via Python-list
t;R:\W.PY", line 8, in     SetClipboardData(CF_UNICODETEXT, "0") pywintypes.error: (0, 'SetClipboardData', 'No error message is available') I can get round the problem by using SetClipboardText().  But can anyone shed light on this? It also happens in Python 3.10, but not Python 3.9. -- https://mail.python.org/mailman/listinfo/python-list

Writing to clipboard in Python 3.11

2023-11-07 Thread Rob Cliffe via Python-list
Recently I switched from Python 3.8.3 to Python 3.11.4.  A strange problem appeared which was not there before: 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 an error (not

Re: How to sort this without 'cmp=' in python 3?

2023-10-24 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 13:02, Mike H via Python-list wrote: > Is it possible to use lambda expression instead of defining a `Key` class? > Something like `sorted(my_list, key = lambda x, y: x+y > y+x)`? Look up functools.cmp_to_key. ChrisA -- https://mail.python.org/mailman/listinfo/python-lis

Re: How to sort this without 'cmp=' in python 3?

2023-10-24 Thread Mike H via Python-list
gt; > '953433230' > > > > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) > > > > But how to do this in python 3? > > > > Thank you > While cmp_to_key is neat doing it by hand should also be instructive. > Essentially you move the comp

TKinter in Python - advanced notions - ok

2023-06-24 Thread Dan Kolis via Python-list
Well, its kind of obvious to make a skeleton, copy it in for some basic functionality and modularly ( is that a word ? ) manage each piece. That ( like your example ) is fine stuff. As a side note, I am sure large, large highly generalised programs are pretty hard to make. One thing I do is

Re: TKinter in Python - advanced notions

2023-06-23 Thread Chris Angelico via Python-list
On Sat, 24 Jun 2023 at 15:57, Thomas Passin via Python-list wrote: > As a general comment (and I have not done anything tricky or complex > with Tk), MVC or the other approaches in a similar vein, though good, > can lead you into more complexity than you need, because of the extra > abstractions i

Re: TKinter in Python - advanced notions

2023-06-23 Thread Thomas Passin via Python-list
-Original Message- From: Python-list On Behalf Of Diego Souza via Python-list Sent: Friday, June 23, 2023 4:14 AM To: aapost Cc: python-list Subject: Re: TKinter in Python - advanced notions Have you considered improving the architecture itself, not your GUI library skills? I recommend

Re: TKinter in Python - advanced notions - reactive

2023-06-23 Thread Dan Kolis via Python-list
I am not specifically having any problems implementing what I want to make work. Callbacks etc make it fairly easy to make TKinter react to things without any specific fancy plan for it. Add callbacks for real time changes early in any new notion, after it looks right go to the IO part make i

Re: TKinter in Python - advanced notions

2023-06-23 Thread Dan Kolis via Python-list
If you have a problem,. ask a super specific question, here. If I can help, I will, but TKINTER knowledge is pretty spread around. Many others migth jump in, too. Its works, its slightly quirky, has no licencing hangups. X11 makes fine fine programs ! Keep hacking,Dan -- https://mail.python.or

RE: TKinter in Python - advanced notions

2023-06-23 Thread Andreas Heckel via Python-list
> On Behalf Of Diego Souza via Python-list > Sent: Friday, June 23, 2023 4:14 AM > To: aapost > Cc: python-list > Subject: Re: TKinter in Python - advanced notions > > Have you considered improving the architecture itself, not your GUI library > skills? > > I recommend

Re: TKinter in Python - advanced notions

2023-06-22 Thread Diego Souza via Python-list
more > interesting projects and tutorials on extending tkinter, such as WCK > (tkinter3000), but the only remnants of those remain publicly available > are outdated unmaintained archives. > > You might also consider looking at the Grail browser source for research > purposes, a

Re: TKinter in Python - advanced notions

2023-06-21 Thread aapost via Python-list
nding tkinter, such as WCK (tkinter3000), but the only remnants of those remain publicly available are outdated unmaintained archives. You might also consider looking at the Grail browser source for research purposes, as it does some interesting things with some of the widgets, (parsing html and suc

TKinter in Python - advanced notions

2023-06-21 Thread Dan Kolis via Python-list
Hi, I've write a huge biotech program ( an IDE for synthetic biology ), and am slowly outgrowing TKINTER. Has anybody out there merged a little bit of TCL direct calls from Python 3.X to get more freedom then TKINTER for just some Windows ? How about bold stories of successes ( yours, not mine

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-09 Thread Cameron Simpson
On 08May2023 12:19, jak wrote: In reality you should also take into account the fact that if the header contains a 'b' instead of a 'q' as a penultimate character, then the rest of the package is converted on the basis64 "=?utf-8?Q?" --> "=?utf-8?B?" Aye. Specification: https://datatra

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Dieter Maurer
Chris Green wrote at 2023-5-6 15:58 +0100: >Chris Green wrote: >> I'm having a real hard time trying to do anything to a string (?) >> returned by mailbox.MaildirMessage.get(). >> >What a twit I am :-) > >Strings are immutable, I have to do:- > >newstring = oldstring.replace("_", " ") The sol

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Keith Thompson
Chris Green writes: > Chris Green wrote: >> I'm having a real hard time trying to do anything to a string (?) >> returned by mailbox.MaildirMessage.get(). >> > What a twit I am :-) > > Strings are immutable, I have to do:- > > newstring = oldstring.replace("_", " ") > > Job done! Not necess

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread jak
Peter Pearson ha scritto: On Sat, 6 May 2023 14:50:40 +0100, Chris Green wrote: [snip] So, what do those =?utf-8? and ?= sequences mean? Are they part of the string or are they wrapped around the string on output as a way to show that it's utf-8 encoded? Yes, "=?utf-8?" signals "MIME header

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Peter Pearson
On Sat, 6 May 2023 14:50:40 +0100, Chris Green wrote: [snip] > So, what do those =?utf-8? and ?= sequences mean? Are they part of > the string or are they wrapped around the string on output as a way to > show that it's utf-8 encoded? Yes, "=?utf-8?" signals "MIME header encoding". I've only bl

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread jak
Chris Green ha scritto: Keith Thompson wrote: Chris Green writes: Chris Green wrote: I'm having a real hard time trying to do anything to a string (?) returned by mailbox.MaildirMessage.get(). What a twit I am :-) Strings are immutable, I have to do:- newstring = oldstring.replace(

What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
I'm having a real hard time trying to do anything to a string (?) returned by mailbox.MaildirMessage.get(). I'm extracting the Subject: header from a message and, if I write what it returns to a log file using the python logging module what I see in the log file (when the Subject: has non-ASCII ch

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Keith Thompson wrote: > Chris Green writes: > > Chris Green wrote: > >> I'm having a real hard time trying to do anything to a string (?) > >> returned by mailbox.MaildirMessage.get(). > >> > > What a twit I am :-) > > > > Strings are immutable, I have to do:- > > > > newstring = oldstring.

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Chris Green wrote: > I'm having a real hard time trying to do anything to a string (?) > returned by mailbox.MaildirMessage.get(). > What a twit I am :-) Strings are immutable, I have to do:- newstring = oldstring.replace("_", " ") Job done! -- Chris Green · -- https://mail.python.org/m

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Phu Sam
Unsubscribe On Sat, Apr 29, 2023 at 7:05 PM Chris Angelico wrote: > On Sun, 30 Apr 2023 at 11:58, Chris Green wrote: > > > > Chris Angelico wrote: > > > On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran > wrote: > > > > > > > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > > > > I'm

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Angelico
On Sun, 30 Apr 2023 at 12:02, jak wrote: > > Chris Angelico ha scritto: > > Using mkdirs when you only want to make one is inviting problems of > > being subtly wrong, where it creates too many levels of directory. > > Personally, I would just do: > > > Maybe I only say this because it has happene

Re: How to 'ignore' an error in Python?

2023-04-29 Thread jak
Stefan Ram ha scritto: jak writes: Maybe I only say this because it has happened to me too many times but before ignoring the error in the 'except' branch, I would make sure that if the name exists it is a folder and not a file. If the name exists and it is a file's name, this will be dete

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Angelico
On Sun, 30 Apr 2023 at 11:58, Chris Green wrote: > > Chris Angelico wrote: > > On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote: > > > > > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > > > I'm sure I'm missing something obvious here but I can't see an elegant > > > > way to do

Re: How to 'ignore' an error in Python?

2023-04-29 Thread jak
Chris Angelico ha scritto: Using mkdirs when you only want to make one is inviting problems of being subtly wrong, where it creates too many levels of directory. Personally, I would just do: Maybe I only say this because it has happened to me too many times but before ignoring the error in the

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
Kushal Kumaran wrote: > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > I'm sure I'm missing something obvious here but I can't see an elegant > > way to do this. I want to create a directory, but if it exists it's > > not an error and the code should just continue. > > > > So, I have

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Chris Green
Chris Angelico wrote: > On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote: > > > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > > I'm sure I'm missing something obvious here but I can't see an elegant > > > way to do this. I want to create a directory, but if it exists it's > > >

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Greg Ewing via Python-list
On 30/04/23 2:43 am, jak wrote: Maybe I expressed myself badly but I didn't mean to propose alternatives to the EAFP way but just to evaluate the possibility that it is not a folder. If it's not a folder, you'll find out when the next thing you try to do to it fails. You could check for it ear

RE: How to 'ignore' an error in Python?

2023-04-29 Thread avi.e.gross
require a loss of simplicity. -Original Message- From: Python-list On Behalf Of Kushal Kumaran Sent: Saturday, April 29, 2023 12:19 AM To: python-list@python.org Subject: Re: How to 'ignore' an error in Python? On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: >

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Chris Angelico
On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote: > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > > I'm sure I'm missing something obvious here but I can't see an elegant > > way to do this. I want to create a directory, but if it exists it's > > not an error and the code should j

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Kushal Kumaran
On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote: > I'm sure I'm missing something obvious here but I can't see an elegant > way to do this. I want to create a directory, but if it exists it's > not an error and the code should just continue. > > So, I have:- > > for dirname in listofdir

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Cameron Simpson
On 28Apr2023 10:39, Mats Wichmann wrote: For this specific case, you can use os.makedirs: os.makedirs(dirname, exist_ok=True) I'm not a great fan of makedirs because it will make all the missing components, not just the final one. So as an example, if you've got a NAS mounted backup area at

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Cameron Simpson
On 28Apr2023 16:55, Chris Green wrote: for dirname in listofdirs: try: os.mkdir(dirname) except FileExistsError: # so what can I do here that says 'carry on regardless' except: # handle any other error, which is really an error # I

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 11:05, MRAB wrote: On 2023-04-28 16:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this.  I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in lis

Re: How to 'ignore' an error in Python?

2023-04-28 Thread MRAB
On 2023-04-28 16:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in listofdirs: try:

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 09:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in listofdirs: try:

How to 'ignore' an error in Python?

2023-04-28 Thread Chris Green
I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in listofdirs: try: os.mkdir(dirname) except FileExi

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
om such a project a Python APK with build parameters and Python code to taste. python-for-android — python-for-android 0.1 documentation python-for-android.readthedocs.io/en/latest/ Is there a Python game for Android?I created an Android game that is completely developed in Python using Kivy. It i

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
On Monday, 13 March 2023 at 16:16:28 UTC+1, Thomas Passin wrote: > On 3/13/2023 12:39 AM, a a wrote: > > But what I need is analysis of seismograms from 4,000 seismographs world > > wide to detect P-wave energy distribution underground around the earthquake > > to verify EQ Domino Effect > In tha

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread avi.e.gross
stuff along these lines can share some tools in python, or elsewhere, they find useful and that might help fit the needs of the OP but they work best when they have a better idea of what exactly you want to do. Part of what I gleaned, was a want to do a 3-D graph that rotates. Python has multiple

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:54 AM, Rich Shepard wrote:> On Mon, 13 Mar 2023, Thomas Passin wrote: > >> No doubt, depending on the data formats used. But it's still going >> to be a big task. > > Thomas, > > True, but once you have a dataframe with all the information about > all the earthquakes you can extra

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: No doubt, depending on the data formats used. But it's still going to be a big task. Thomas, True, but once you have a dataframe with all the information about all the earthquakes you can extract data for every analysis you want to do. If you've not

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:23 AM, Rich Shepard wrote: On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Rich Shepard
On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that dat

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that data into a

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But some unknown reasons Matplotlib and numpy crash my Python 3.8 for Windows , 32-bit and no support is offered It is possible, using pip, to downgrade versions (e.g., of Matplotlob and numpy) to see if you can find versions that work. Of course moving to

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread a a
ledge of it yet, it can take a while to know enough and if you just need > it for one project, ... > -Original Message- > From: Python-list On > Behalf Of Thomas Passin > Sent: Sunday, March 12, 2023 12:02 AM > To: pytho...@python.org > Subject: Re: Can you proces

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread avi.e.gross
, ... -Original Message- From: Python-list On Behalf Of Thomas Passin Sent: Sunday, March 12, 2023 12:02 AM To: python-list@python.org Subject: Re: Can you process seismographic signals in Python or should I switch to Matlab ? On 3/11/2023 6:54 PM, a a wrote: > My project >

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread Thomas Passin
On 3/11/2023 6:54 PM, a a wrote: My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.html If your goal is to step through this Matlab example, then clearly you should use Matlab. If you do not have access to Matlab or cannot afford it, then you would have to us

RE: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread avi.e.gross
Original Message- From: Python-list On Behalf Of a a Sent: Saturday, March 11, 2023 6:54 PM To: python-list@python.org Subject: Can you process seismographic signals in Python or should I switch to Matlab ? My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake

Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread a a
My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Thomas Passin
On 3/8/2023 3:27 PM, Peter J. Holzer wrote: On 2023-03-08 00:12:04 -0500, Thomas Passin wrote: On 3/7/2023 7:33 AM, Dino wrote: in fact it's a dilemma I am facing now. My back-end returns 10 entries (I am limiting to max 10 matches server side for reasons you can imagine). As the user keeps typ

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Peter J. Holzer
On 2023-03-08 00:12:04 -0500, Thomas Passin wrote: > On 3/7/2023 7:33 AM, Dino wrote: > > in fact it's a dilemma I am facing now. My back-end returns 10 > > entries (I am limiting to max 10 matches server side for reasons you > > can imagine). As the user keeps typing, should I restrict the > > exi

Re: RE: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Dino
On 3/7/2023 2:02 PM, avi.e.gr...@gmail.com wrote: Some of the discussions here leave me confused as the info we think we got early does not last long intact and often morphs into something else and we find much of the discussion is misdirected or wasted. Apologies. I'm the OP and also the OS (

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Dino
On 3/7/2023 1:28 PM, David Lowry-Duda wrote: But I'll note that I use whoosh from time to time and I find it stable and pleasant to work with. It's true that development stopped, but it stopped in a very stable place. I don't recommend using whoosh here, but I would recommend experimenting wit

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-07 Thread Thomas Passin
On 3/7/2023 7:33 AM, Dino wrote: It must be nice to have a server or two... No kidding About everything else you wrote, it makes a ton of sense, in fact it's a dilemma I am facing now. My back-end returns 10 entries (I am limiting to max 10 matches server side for reasons you can imagine). A

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-07 Thread rbowman
On Tue, 7 Mar 2023 07:33:01 -0500, Dino wrote: > Played a little bit with both approaches in my little application. > Re-requesting from the server seems to win hands down in my case. That's necessary for a non-trivial data set. Assume you get 10 suggestions after the user type 'to'. today tom

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-07 Thread Dino
On 3/6/2023 11:05 PM, rbowman wrote: It must be nice to have a server or two... No kidding About everything else you wrote, it makes a ton of sense, in fact it's a dilemma I am facing now. My back-end returns 10 entries (I am limiting to max 10 matches server side for reasons you can imagin

  1   2   3   4   5   6   7   8   9   10   >