PYLAUNCH_DEBUG not printing info

2022-06-08 Thread Richard David
Why am I not getting debug output on my windows 10 machine: C:\temp>\Windows\py.exe -0 -V:3.11 *Python 3.11 (64-bit) -V:3.10 Python 3.10 (64-bit) C:\temp>set PYLAUNCH_DEBUG=1 C:\temp>\Windows\py.exe Python 3.11.0b3 (main, Jun 1 2022, 13:29:14) [MSC v.1932 64 bit (AMD64)] on

Re: How to replace characters in a string?

2022-06-08 Thread Greg Ewing
On 9/06/22 5:55 am, Dennis Lee Bieber wrote: There are no mutable strings in Python. If you really want a mutable sequence of characters, you can use array.array, but you won't be able to use it directly in place of a string in most contexts. -- Greg --

Re: How to replace characters in a string?

2022-06-08 Thread Greg Ewing
On 8/06/22 10:26 pm, Jon Ribbens wrote: Here's a head-start on some characters you might want to translate, Another possibility that might make sense in this case is to simply strip out all punctuation before comparing. That would take care of things being spelled with or without hyphens,

Re: How to replace characters in a string?

2022-06-08 Thread Dennis Lee Bieber
On Wed, 8 Jun 2022 11:09:05 +0200, Dave declaimed the following: >Hi, > >Thanks for this! > >So, is there a copy function/method that returns a MutableString like in >objective-C? I’ve solved this problems before in a number of languages like >Objective-C and AppleScript. There are

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2022-06-09 at 04:15:46 +1000, > Chris Angelico wrote: > >> On Thu, 9 Jun 2022 at 04:14, <2qdxy4rzwzuui...@potatochowder.com> wrote: >> > >> > On 2022-06-09 at 03:18:56 +1000, >> > Chris Angelico

Re: How to test characters of a string

2022-06-08 Thread Dennis Lee Bieber
On Wed, 8 Jun 2022 01:53:26 + (UTC), Avi Gross declaimed the following: > >So is it necessary to insist on an exact pattern of two digits followed by a >space?  > > >That would fail on "44 Minutes", "40 Oz. Dream", "50 Mission Cap", "50 Ways to >Say Goodbye", "99 Ways to Die"  > >It looks

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2022-06-08 at 08:07:40 -, > De ongekruisigde wrote: > >> Depending on the problem a regular expression may be the much simpler >> solution. I love them for e.g. text parsing and use them all

Re: How to test characters of a string

2022-06-08 Thread 2QdxY4RzWzUUiLuE
On 2022-06-09 at 04:15:46 +1000, Chris Angelico wrote: > On Thu, 9 Jun 2022 at 04:14, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-06-09 at 03:18:56 +1000, > > Chris Angelico wrote: > > > > > On Thu, 9 Jun 2022 at 03:15, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > > > > >

Re: How to test characters of a string

2022-06-08 Thread Chris Angelico
On Thu, 9 Jun 2022 at 04:14, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-06-09 at 03:18:56 +1000, > Chris Angelico wrote: > > > On Thu, 9 Jun 2022 at 03:15, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > > > On 2022-06-08 at 08:07:40 -, > > > De ongekruisigde wrote: > > > >

Re: How to test characters of a string

2022-06-08 Thread 2QdxY4RzWzUUiLuE
On 2022-06-09 at 03:18:56 +1000, Chris Angelico wrote: > On Thu, 9 Jun 2022 at 03:15, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-06-08 at 08:07:40 -, > > De ongekruisigde wrote: > > > > > Depending on the problem a regular expression may be the much simpler > > > solution.

Re: How to replace characters in a string?

2022-06-08 Thread Barry Scott
> On 8 Jun 2022, at 18:01, Dave wrote: > > Hi, > > This is a tool I’m using on my own files to save me time. Basically or most > of the tracks were imported with different version iTunes over the years. > There are two problems: > > 1. File System characters are replaced (you can’t have

Re: How to test characters of a string

2022-06-08 Thread Chris Angelico
On Thu, 9 Jun 2022 at 03:15, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-06-08 at 08:07:40 -, > De ongekruisigde wrote: > > > Depending on the problem a regular expression may be the much simpler > > solution. I love them for e.g. text parsing and use them all the time. > >

Re: How to test characters of a string

2022-06-08 Thread 2QdxY4RzWzUUiLuE
On 2022-06-08 at 08:07:40 -, De ongekruisigde wrote: > Depending on the problem a regular expression may be the much simpler > solution. I love them for e.g. text parsing and use them all the time. > Unrivaled when e.g. parts of text have to be extracted, e.g. from lines > like these: > >

Re: How to test characters of a string

2022-06-08 Thread Barry Scott
> On 7 Jun 2022, at 23:24, Dave wrote: > > Yes, it was probably just a typeo on my part. > > I’ve now fixed the majority of cases but still got two strings that look > identical but fail to match, this time (again by 10cc), “I’m Mandy Fly Me”. > > I’m putting money on it being a utf8

Re: How to replace characters in a string?

2022-06-08 Thread Dave
Hi, This is a tool I’m using on my own files to save me time. Basically or most of the tracks were imported with different version iTunes over the years. There are two problems: 1. File System characters are replaced (you can’t have ‘/‘ or ‘:’ in a file name). 2. Smart Quotes were added

Re: How to replace characters in a string?

2022-06-08 Thread Avi Gross via Python-list
Dave, Your goal is to compare titles and there can be endless replacements needed if you allow the text to contain anything but ASCII. Have you considered stripping out things instead? I mean remove lots of stuff that is not ASCII in the first place and perhaps also remove lots of extra

Re: How to replace characters in a string?

2022-06-08 Thread Jon Ribbens via Python-list
On 2022-06-08, Dave wrote: > I misunderstood how it worked, basically I’ve added this function: > > def filterCommonCharacters(theString): > myNewString = theString.replace("\u2019", "'") > return myNewString > Which returns a new string replacing the common characters. > > This can

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Christian Gollwitzer wrote: > Am 07.06.22 um 23:01 schrieb Christian Gollwitzer: > >>> In [3]: re.sub(r'^\d+\s*', '', s) Out[3]: 'Trinket' >>> > > that RE does match what you intended to do, but not exactly what you > wrote in the OP. that would be '^\d\d.' start with exactly two

Re: How to replace characters in a string?

2022-06-08 Thread Dave
> On 8 Jun 2022, at 11:25, Dave wrote: > >myNewString = theString.replace("\u2014", “]” #just an example Opps! Make that myNewString = myNewString.replace("\u2014", “]” #just an example -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Dave wrote: > I hate regEx and avoid it whenever possible, I’ve never found something that > was impossible to do without it. I love regular expressions and use them where appropriate. Saves tons of code and is often much more readable than the pages of code required to do the

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, dn wrote: > On 08/06/2022 10.18, De ongekruisigde wrote: >> On 2022-06-08, Christian Gollwitzer wrote: >>> Am 07.06.22 um 21:56 schrieb Dave: It depends on the language I’m using, in Objective C, I’d use isNumeric, just wanted to know what the equivalent is in Python.

Re: How to replace characters in a string?

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Dave wrote: > Hi All, > > I decided to start a new thread as this really is a new subject. > > I've got two that appear to be identical, but fail to compare. After getting > the ascii encoding I see that they are indeed different, my question is how > can I replace the \u2019m

Re: How to replace characters in a string?

2022-06-08 Thread Dan Stromberg
On Wed, Jun 8, 2022 at 1:11 AM Dave wrote: > I've got two that appear to be identical, but fail to compare. After > getting the ascii encoding I see that they are indeed different, my > question is how can I replace the \u2019m with a regular single quote mark > (or apostrophe)? > Perhaps try

Re: How to replace characters in a string?

2022-06-08 Thread Roel Schroeven
Op 8/06/2022 om 11:25 schreef Dave: Hi, I misunderstood how it worked, basically I’ve added this function: def filterCommonCharacters(theString): myNewString = theString.replace("\u2019", "'") return myNewString Which returns a new string replacing the common characters. This can

Re: How to replace characters in a string?

2022-06-08 Thread Dave
Hi, I misunderstood how it worked, basically I’ve added this function: def filterCommonCharacters(theString): myNewString = theString.replace("\u2019", "'") return myNewString Which returns a new string replacing the common characters. This can easily be extended to include other

Re: How to replace characters in a string?

2022-06-08 Thread Joel Goldstick
On Wed, Jun 8, 2022 at 5:22 AM Karsten Hilbert wrote: > > Am Wed, Jun 08, 2022 at 11:09:05AM +0200 schrieb Dave: > > > myString = 'Hello' > > myNewstring = myString.replace(myString,'e','a’) > > That won't work (last quote) but apart from that: > > myNewstring = myString.replace('e', 'a') > >

Re: How to replace characters in a string?

2022-06-08 Thread Karsten Hilbert
Am Wed, Jun 08, 2022 at 11:09:05AM +0200 schrieb Dave: > myString = 'Hello' > myNewstring = myString.replace(myString,'e','a’) That won't work (last quote) but apart from that: myNewstring = myString.replace('e', 'a') Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B --

Re: How to replace characters in a string?

2022-06-08 Thread Chris Angelico
On Wed, 8 Jun 2022 at 19:13, Dave wrote: > > Hi, > > Thanks for this! > > So, is there a copy function/method that returns a MutableString like in > objective-C? I’ve solved this problems before in a number of languages like > Objective-C and AppleScript. > > Basically there is a set of common

Re: How to replace characters in a string?

2022-06-08 Thread Dave
Hi, Thanks for this! So, is there a copy function/method that returns a MutableString like in objective-C? I’ve solved this problems before in a number of languages like Objective-C and AppleScript. Basically there is a set of common characters that need “normalizing” and I have a method

Re: How to replace characters in a string?

2022-06-08 Thread Chris Angelico
On Wed, 8 Jun 2022 at 18:20, Dave wrote: > > PS > > I’ve also tried: > myCompareFile1 = myTitleName > myCompareFile1.replace("\u2019", "'") > myCompareFile2 = myCompareFileName > myCompareFile2.replace("\u2019", "'") > Which also doesn’t work, the replace itself work but it still fails the >

Re: How to replace characters in a string?

2022-06-08 Thread Dave
PS I’ve also tried: myCompareFile1 = myTitleName myCompareFile1.replace("\u2019", "'") myCompareFile2 = myCompareFileName myCompareFile2.replace("\u2019", "'") Which also doesn’t work, the replace itself work but it still fails the compare? > On 8 Jun 2022, at 10:08, Dave wrote: > > Hi All, >

Re: How to replace characters in a string?

2022-06-08 Thread Chris Angelico
On Wed, 8 Jun 2022 at 18:12, Dave wrote: > I tried the but it doesn’t seem to work? > myCompareFile1 = ascii(myTitleName) > myCompareFile1.replace("\u2019", "'") Strings in Python are immutable. When you call ascii(), you get back a new string, but it's one that has actual backslashes and such

How to replace characters in a string?

2022-06-08 Thread Dave
Hi All, I decided to start a new thread as this really is a new subject. I've got two that appear to be identical, but fail to compare. After getting the ascii encoding I see that they are indeed different, my question is how can I replace the \u2019m with a regular single quote mark (or