RE: cpython and python and visual studio 2019

2022-06-09 Thread jschwar
Never mind.  I figured it out myself.  It's not documented very well.  

 

From: jsch...@sbcglobal.net  
Sent: Thursday, June 9, 2022 11:17 AM
To: 'python-list@python.org' 
Subject: cpython and python and visual studio 2019

 

I contacted Visual Studio 2019 support about this and they referred me to
this site, but I'm not sure this is a bug or not
(https://github.com/python/cpython/issues/new?assignees=
 =type-bug=bug.md).  If I should open a bug
request, please let me know and I will.  

 

I'm not new to python, but I'm new to cpython and visual studio.  I need to
install Visual Studio 2019 and get the PCBuild/get_external.bat file up and
running.  I have python 3.10.4 installed.  I tried installing the Community
version of Visual Studio 2019 version 16.11, but from what I understand,
it's supposed to create a folder in my python directory called PCBuild with
that bat file in it and it doesn't.  I've searched my C drive for PCBuild
and get_external.bat and nothing is found.  

 

I've executed this command and from what I can tell, I have installed the
correct version of Visual Studio:

 

python -c "import sys; print(sys.version)"

3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit
(AMD64)]

 

This website says to install version 16.11:
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B

 

I did select the following options when installing Visual Studio 2019:

 

Workloads:

 

Python Development

Desktop Development with C++

 

Under python development I have selected the following:

 

Python native development tools

Python web support

Live Share

Python 3 64-bit (3.9.7)

 

Under Desktop Development with C++ I have selected the following:

 

Included:

C++ Core Desktop features

 

Optional:

MSVC v142 VS 2019 C++ x64/x86 build

Windows 10 SDK (10.0.19041.0)

Just-In-Time debugger

C++ Profiling tools

C++ CMake tools for Windows

C++ ATL for latest v142 build tools

Test Adapter for Boost.Test

Test adapter for Google Test

Live Share

IntelliCode

C++ AddressSanitizer

Windows 10 SDK (10.0.18362.0)

 

Can someone please help me on this?  Like I said, if I should open a bug
report, please let me know and I will.

 

 

-- 
https://mail.python.org/mailman/listinfo/python-list


Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Dave
Hi,

Before I write my own I wondering if anyone knows of a function that will print 
a nicely formatted dictionary?

By nicely formatted I mean not all on one line!

Cheers
Dave

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread MRAB

On 2022-06-09 11:43, Dave wrote:

Hi,

Before I write my own I wondering if anyone knows of a function that will print 
a nicely formatted dictionary?

By nicely formatted I mean not all on one line!


It's called "pretty-printing". Have a look at the 'pprint' module.
--
https://mail.python.org/mailman/listinfo/python-list


cpython and python and visual studio 2019

2022-06-09 Thread jschwar
I contacted Visual Studio 2019 support about this and they referred me to
this site, but I'm not sure this is a bug or not
(https://github.com/python/cpython/issues/new?assignees=
 =type-bug=bug.md).  If I should open a bug
request, please let me know and I will.  

 

I'm not new to python, but I'm new to cpython and visual studio.  I need to
install Visual Studio 2019 and get the PCBuild/get_external.bat file up and
running.  I have python 3.10.4 installed.  I tried installing the Community
version of Visual Studio 2019 version 16.11, but from what I understand,
it's supposed to create a folder in my python directory called PCBuild with
that bat file in it and it doesn't.  I've searched my C drive for PCBuild
and get_external.bat and nothing is found.  

 

I've executed this command and from what I can tell, I have installed the
correct version of Visual Studio:

 

python -c "import sys; print(sys.version)"

3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit
(AMD64)]

 

This website says to install version 16.11:
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B

 

I did select the following options when installing Visual Studio 2019:

 

Workloads:

 

Python Development

Desktop Development with C++

 

Under python development I have selected the following:

 

Python native development tools

Python web support

Live Share

Python 3 64-bit (3.9.7)

 

Under Desktop Development with C++ I have selected the following:

 

Included:

C++ Core Desktop features

 

Optional:

MSVC v142 VS 2019 C++ x64/x86 build

Windows 10 SDK (10.0.19041.0)

Just-In-Time debugger

C++ Profiling tools

C++ CMake tools for Windows

C++ ATL for latest v142 build tools

Test Adapter for Boost.Test

Test adapter for Google Test

Live Share

IntelliCode

C++ AddressSanitizer

Windows 10 SDK (10.0.18362.0)

 

Can someone please help me on this?  Like I said, if I should open a bug
report, please let me know and I will.

 

 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Mats Wichmann
On 6/9/22 11:52, Chris Angelico wrote:
> On Fri, 10 Jun 2022 at 03:44, Dave  wrote:
>>
>> Hi,
>>
>> Before I write my own I wondering if anyone knows of a function that will 
>> print a nicely formatted dictionary?
>>
>> By nicely formatted I mean not all on one line!
>>
> 
> https://docs.python.org/3/library/pprint.html
> 
> from pprint import pprint
> pprint(thing)
> 
> ChrisA


I might add the note that there was a recent thread on the Discuss board
about options for styling the pprint output (okay, it was me that
started that one...) - you can choose indent and compact (compact is the
not-all-on-one-line flag) but there might be some other choices missing.
haven't gotten around to following up on that...

https://discuss.python.org/t/pprint-styling-options/15947
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to test characters of a string

2022-06-09 Thread Avi Gross via Python-list
Dave,

Sometimes a task is done faster by NOT programming anything in any language!

Not only have you spent a lot of your own time but many dozens of messages here 
have dragged in others, who gain nothing ;-)

The domain you are operating in seems to have lots of variants in how the 
titles are stored as names and you keep finding new variants. Yes, if your goal 
is to use this as a way to learn more in general about Python, clearly it may 
meet that goal!

Contrary to what I (and some others) said earlier, it may be time to consider 
regular expressions and other heavier artillery! LOL!

I do not plan on sticking with your twists and turns but will quickly address 
your variants.

Sides that come in two's like records are presumably limited to using A and B 
in your example. But multiple disks connected can mean the digit(s) following 
can have double digits or even more. Your python code may have to contain lots 
of functions you create that match some pattern and return some value and 
perhaps other functions that know how to convert from that format to a common 
canonical format of your own so they can be compared.

Your main code may need to try them in various sequences till it finds a match 
and so on.

But when you are done, in what format do you save them? The original or your 
minimal? 

Still confusing to me, as someone who does not give a darn, is the reality that 
many songs may have the same name but be different as in a song from Sinatra 
when he was young and a later recording  with a different orchestra or by a 
Sinatra imitator. They may all be titled something like "New York, New York" or 
"NEW YORK -- NEW YORK" which your algorithm folds into the same characters.

So I am guessing you also need to access other data about the person who sings 
it or what year it was released to make comparisons. At some point you may want 
to create or borrow some sort of class/object that encapsulates your data as 
well as methods that let you do things like make a canonical version of the 
Title and then a way to ask if Object A is reasonably equal to object B might 
happen if you define a function/method of __eq__ for that class.

It might take you years and need periodic refining as you encounter ever more 
varied ways people have chosen to label their music, but so what? LOL!

Humor or sarcasm aside, your incremental exploratory method reminds me why it 
is a good idea to first scope out the outlines of your problem space and make 
some key decisions and write out a fairly detailed set of requirements before 
seriously making more than prototypes. You might get very different help from 
people if they understood that your first request was far from complete but 
only one of many that may better be worked on some other way.
And I wonder if you did any search of the internet to see if anyone had done 
anything similar in Python (or another language) that may handle parts of what 
you need before asking here. I note lots of people who come with what they 
consider a good programming background have to adjust to aspects of languages 
like python as what they know is in some ways wrong or inadequate in a new 
environment. 

-Original Message-
From: Dave 
To: python-list@python.org
Sent: Thu, Jun 9, 2022 2:50 am
Subject: Re: How to test characters of a string

Hi,

I’ve found you also need to take care of multiple disk CD releases. These have 
a format of

“1-01 Track Name”
“2-02  Trackl Name"

Meaning Disk 1 Track1, Disk 2, Track 2.

Also A and B Sides (from Vinyl LPs)

“A1-Track Name”
“B2-Track Name”

Side A, Track 1, etc.

Cheers
Dave


> On 8 Jun 2022, at 19:36, Dennis Lee Bieber  wrote:
> 
> 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 to me like you need to compare TWICE just in case. If it matches in 
>> the original (perhaps with some normalization of case and whitespace, fine. 
>> If not will they match if one or both have something to remove as a prefix 
>> such as "02 ". And if you are comparing items where the same song is in two 
>> different numeric sequences on different disks, ...
> 
>     I suspect the OP really needs to extract the /track number/ from the
> ID3 information, and (converting to a 2digit formatted string) see if the
> file name begins with that track number... The format of the those
> filenames appear to be those generated by some software when ripping CDs to
> MP3s -- for example:
> 
> -=-=-
> c:\Music\Roger Miller\All Time Greatest Hits>dir
> Volume in drive C is OS
> Volume Serial Number is 4ACC-3CB4
> 
> Directory of c:\Music\Roger Miller\All Time Greatest Hits
> 
> 04/11/2022  05:06 PM              .
> 04/11/2022  05:06 PM              ..
> 07/26/2018  11:20 AM        4,493,279 01 

Re: How to test characters of a string

2022-06-09 Thread Christian Gollwitzer

Am 08.06.22 um 19:57 schrieb 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:

If you insist:

 >>> s = 'nm-iodine:x:996:57::/var/empty:/run/current-system/sw/bin/nologin'
 >>> print(s.split(':'))
 ['nm-iodine', 'x', '996', '57', '', '/var/empty', 
'/run/current-system/sw/bin/nologin']

Hesitantly, because this is the Python mailing list, I claim (a) ':' is
simpler than r'([^:]*):([^:]*):(\d+):(\d+):([^:]*):([^:]*):(.*)$', and
(b) string.split covers pretty much the same edge cases as re.search.


Ah, but you don't catch the be numeric of fields (0-based) 2 and 3! But
agreed, it's not the best of examples.



Yes, that is a simplistic example, since the : can't even be quoted to 
appear in that format (which would require higher-order parsing than a 
simple split)


Fortunately, the OP has just given another requirement to recognise 
different patterns, and now it went into a direction where it will 
become quite ugly if you avoid REs or any other pattern matching tools.


This is also the main reason I suggested REs initially - often if you 
see other patterns in the data, you can easily adapt a RE solution, 
whereas you'll have to write the thing from ground up anew if you do it 
manually.


Christian

--
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Larry Martell
On Thu, Jun 9, 2022 at 11:44 AM Dave  wrote:
>
> Hi,
>
> Before I write my own I wondering if anyone knows of a function that will 
> print a nicely formatted dictionary?
>
> By nicely formatted I mean not all on one line!

>>> import json
>>> d = {'John': 'Cleese', 'Eric': "Idle", 'Micheal': 'Palin'}
>>> print(json.dumps(d, indent=4))
{
"John": "Cleese",
"Eric": "Idle",
"Micheal": "Palin"
}
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Avi Gross via Python-list
Dave,

Despite your other programming knowledge, I suspect you think this is the forum 
where people come to be tutored. Try here:

https://mail.python.org/mailman/listinfo/tutor

Yes, there are plenty of pretty printers available and you can build your own 
function fairly easily. A module like pprint may have what you want in 
pprint.pprint()  but you can write a function for yourself that takes a  
dictionary and loops through items and prints them one per line and, if you 
feel like it, also prints how many items there are and your own custom touches 
such as doing them alphabetically.
Consider using a search engine before posting. Throw in a few words like 
"python pretty print dictionary function" and refine that if it does not get 
you immediate results. It is free and easy and does not waste time for so many 
others who already know or don't care.
And consider reading a few books perhaps designed to teach python to people 
with some programming experience or taking a course on something like COURSERA 
as a part of your learning process and not depending on volunteers so much. 
Much of what you are asking is covered in fairly beginner and intermediate such 
books/courses.

I think I am now going to ignore messages from you for a while. Signal to noise 
ratio ...


-Original Message-
From: Dave 
To: python-list@python.org
Sent: Thu, Jun 9, 2022 6:43 am
Subject: Function to Print a nicely formatted Dictionary or List?

Hi,

Before I write my own I wondering if anyone knows of a function that will print 
a nicely formatted dictionary?

By nicely formatted I mean not all on one line!

Cheers
Dave

-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Friedrich Rentsch
If you want tables layed out in a framing grid, you might want to take a 
look at this:


https://bitbucket.org/astanin/python-tabulate/pull-requests/31/allow-specifying-float-formats-per-column/diff

Frederic



On 6/9/22 12:43, Dave wrote:

Hi,

Before I write my own I wondering if anyone knows of a function that will print 
a nicely formatted dictionary?

By nicely formatted I mean not all on one line!

Cheers
Dave



--
https://mail.python.org/mailman/listinfo/python-list


Re: How to test characters of a string

2022-06-09 Thread Christian Gollwitzer

Am 09.06.22 um 07:50 schrieb Dave:

Hi,

I’ve found you also need to take care of multiple disk CD releases. These have 
a format of

“1-01 Track Name”
“2-02  Trackl Name"

Meaning Disk 1 Track1, Disk 2, Track 2.

Also A and B Sides (from Vinyl LPs)

“A1-Track Name”
“B2-Track Name”

Side A, Track 1, etc.



Now you're getting into the complexity that is better handled by REs 
than by individual character examination.

The first of your formats matches the RE

\d-\d{2}

(one digit, - two digits). Anchor that to check for a match at the 
beginning.


The second one matches

(A|B)\d-

As long as one digit is enough. What is your goal, to extract these 
numbers or to strip them? Regexes can do both relatively easily.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Chris Angelico
On Fri, 10 Jun 2022 at 03:44, Dave  wrote:
>
> Hi,
>
> Before I write my own I wondering if anyone knows of a function that will 
> print a nicely formatted dictionary?
>
> By nicely formatted I mean not all on one line!
>

https://docs.python.org/3/library/pprint.html

from pprint import pprint
pprint(thing)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Missing global # gdal DRIVER_NAME declaration in gdal_array.py

2022-06-09 Thread Payton Ireland via Python-list
On Tuesday, March 8, 2022 at 12:52:29 PM UTC-6, Shaozhong SHI wrote:
> The following warning kept coming up when running ogr2ogr. 
> 
> Warning 1: Missing global # gdal: DRIVER_NAME declaration in 
> C:\Users\AppData\Local\Programs\Python\Python36\Lib\site-packages\osgeo\gdal_array.py
>  
> 
> What steps to be take to resolve this issue? 
> 
> Regards, 
> 
> David
Hi David,

I am having this same issue. Where you ever able to resolve it?

Payton
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Michael F. Stemper

On 09/06/2022 12.52, Chris Angelico wrote:

On Fri, 10 Jun 2022 at 03:44, Dave  wrote:



Before I write my own I wondering if anyone knows of a function that will print 
a nicely formatted dictionary?

By nicely formatted I mean not all on one line!



https://docs.python.org/3/library/pprint.html

from pprint import pprint
pprint(thing)


 >>> from pprint import pprint
 >>> d = {'two':2, 'three':5}
 >>> pprint(d)
 {'three': 5, 'two': 2}
 >>>

This is all on one line. That might be acceptable to the OP, but it
doesn't actually match what he said.

--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Dave
Hi,

I quite like the format that JSON gives - thanks a lot!

Cheers
Dave

> On 9 Jun 2022, at 20:02, Stefan Ram  wrote:
> 
>  Since nicety is in the eyes of the beholder, I would not
>  hesitate to write a custom function in this case. Python
>  has the standard modules "pprint" and "json".
> 
>  main.py
> 
> import json
> d ={ 1:2, 'alpha': 'beta' }
> print( json.dumps( d, indent=4 ))
> 
>  output
> 
> {
>"1": 2,
>"alpha": "beta"
> }
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Dan Stromberg
On Thu, Jun 9, 2022 at 1:52 PM Michael F. Stemper 
wrote:

> On 09/06/2022 12.52, Chris Angelico wrote:
> > On Fri, 10 Jun 2022 at 03:44, Dave  wrote:
>
> >> Before I write my own I wondering if anyone knows of a function that
> will print a nicely formatted dictionary?
> >>
> >> By nicely formatted I mean not all on one line!
> >>
> >
> > https://docs.python.org/3/library/pprint.html
> >
> > from pprint import pprint
> > pprint(thing)
>
>   >>> from pprint import pprint
>   >>> d = {'two':2, 'three':5}
>   >>> pprint(d)
>   {'three': 5, 'two': 2}
>   >>>
>
> This is all on one line. That might be acceptable to the OP, but it
> doesn't actually match what he said.
>

For small outputs, pprint uses a single line.  For larger outputs, it
inserts newlines. It's intended to be human-readable more than
machine-readable.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Grant Edwards
On 2022-06-09, Dennis Lee Bieber  wrote:

> However, the Gmane list<>NNTP gateway server DOES make the tutor
> list available to news readers (unfortunately, the comp.lang.python
> <> list <> Gmane has been read-only since last fall (unless things
> have changed recently) so I'm stuck with the spammy general
> comp.lang.python news group.

Here's how I fixed that problem:

  https://github.com/GrantEdwards/hybrid-inews

I read this "group" using slrn pointed at gmane.comp.python.general,
on the NNTP server news.gmain.io. When I post to this group from slrn,
it gets e-mailed to the regular mailing list address. Other gmane
"groups" get posts sent via NNTP. slrn is configured to post all
articles via /usr/local/bin/inews (which is the python "inews"
work-alike program above) when connected to news.gmane.io.

How/why people follow mailing lists via actual e-mail is beyond my
ken... 

--
Grant
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Cameron Simpson
On 09Jun2022 21:35, Dave  wrote:
>I quite like the format that JSON gives - thanks a lot!

Note that JSON output is JavaScript notation, not Python. The `pprint` 
module (which has `pprint` and `pformat` functions) outputs Python 
notation.

If you're just writing for human eyes, JSON is fine, though you will 
want to keep in mind that JSON spells `None` as `null`.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to test characters of a string

2022-06-09 Thread Dave
Hi,

I’ve found you also need to take care of multiple disk CD releases. These have 
a format of

“1-01 Track Name”
“2-02  Trackl Name"

Meaning Disk 1 Track1, Disk 2, Track 2.

Also A and B Sides (from Vinyl LPs)

“A1-Track Name”
“B2-Track Name”

Side A, Track 1, etc.

Cheers
Dave


> On 8 Jun 2022, at 19:36, Dennis Lee Bieber  wrote:
> 
> 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 to me like you need to compare TWICE just in case. If it matches in 
>> the original (perhaps with some normalization of case and whitespace, fine. 
>> If not will they match if one or both have something to remove as a prefix 
>> such as "02 ". And if you are comparing items where the same song is in two 
>> different numeric sequences on different disks, ...
> 
>   I suspect the OP really needs to extract the /track number/ from the
> ID3 information, and (converting to a 2digit formatted string) see if the
> file name begins with that track number... The format of the those
> filenames appear to be those generated by some software when ripping CDs to
> MP3s -- for example:
> 
> -=-=-
> c:\Music\Roger Miller\All Time Greatest Hits>dir
> Volume in drive C is OS
> Volume Serial Number is 4ACC-3CB4
> 
> Directory of c:\Music\Roger Miller\All Time Greatest Hits
> 
> 04/11/2022  05:06 PM  .
> 04/11/2022  05:06 PM  ..
> 07/26/2018  11:20 AM 4,493,279 01 Dang Me.mp3
> 07/26/2018  11:20 AM 5,072,414 02 Chug-A-Lug.mp3
> 07/26/2018  11:20 AM 4,275,844 03 Do-Wacka-Do.mp3
> 07/26/2018  11:20 AM 4,284,208 04 In the Summertime.mp3
> 07/26/2018  11:20 AM 6,028,730 05 King of the Road.mp3
> 07/26/2018  11:20 AM 4,662,182 06 You Can't Roller Skate in a
> Buffalo Herd.mp3
> 07/26/2018  11:20 AM 5,624,704 07 Engine, Engine #9.mp3
> 07/26/2018  11:20 AM 5,002,492 08 One Dyin' and a Buryin'.mp3
> 07/26/2018  11:21 AM 6,799,224 09 Last Word in Lonesome Is Me.mp3
> 07/26/2018  11:21 AM 5,637,230 10 Kansas City Star.mp3
> 07/26/2018  11:21 AM 4,656,910 11 England Swings.mp3
> 07/26/2018  11:21 AM 5,836,638 12 Husbands and Wives.mp3
> 07/26/2018  11:21 AM 5,470,216 13 I've Been a Long Time Leavin'.mp3
> 07/26/2018  11:21 AM 6,230,236 14 Walkin' in the Sunshine.mp3
> 07/26/2018  11:21 AM 6,416,060 15 Little Green Apples.mp3
> 07/26/2018  11:21 AM 9,794,442 16 Me and Bobby McGee.mp3
> 07/26/2018  11:22 AM 7,330,642 17 Where Have All the Average People
> Gone.mp3
> 07/26/2018  11:22 AM 7,334,752 18 South.mp3
> 07/26/2018  11:22 AM 6,981,924 19 Tomorrow Night in Baltimore.mp3
> 07/26/2018  11:22 AM 9,353,872 20 River in the Rain.mp3
>  20 File(s)121,285,999 bytes
>   2 Dir(s)  295,427,198,976 bytes free
> 
> c:\Music\Roger Miller\All Time Greatest Hits>
> -=-=-
> 
>   Untested (especially the ID3 "variable" -- substitute variables as
> needed to match the original code):
> 
 id3Track = 2
 track_number = "%2.2d " % id3Track
 track_number
> '02 '
 filename = "02 This is the life.mp3"
 if filename.startswith(track_number):
> ...   nametitle = filename[3:]
> ... else:
> ...   nametitle = filename
> ...   
 if nametitle.endswith(".mp3"):
> ...   nametitle = nametitle[:-4]
> ...   
 nametitle
> 'This is the life'
> 
>   Handling ASCII ' and " vs Unicode "smart" quotes is a different matter.
> 
>   One may still run the risk of having a filename without a track number
> BUT having a number that just manages to match the track number. To account
> for that I'd suggest using the sequence:
> 
> * Strip extension (if filename.lower().endswith(".mp3"): ...)
> * Handle any Unicode/ASCII quotes in both filename AND ID3 track title
> * Compare filename and title.
> * IF MATCHED -- done
> * IF NOT MATCHED
> * Format ID3 track number as shown above
> * Compare filename to (formatted track number + track 
> title)
> * IF MATCHED -- done
> * IF NOT MATCHED
> * Log full filename and ID3 track 
> title/track number to a
> log for later examination.
> 
> 
> 
> -- 
>   Wulfraed Dennis Lee Bieber AF6VN
>   wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PYLAUNCH_DEBUG not printing info

2022-06-09 Thread Eryk Sun
On 6/9/22, Peter Otten <__pete...@web.de> wrote:
>
> Looks like the variable is now called PYLAUNCHER_DEBUG:
>
> https://docs.python.org/3.11/using/windows.html#diagnostics

I wonder why Steve changed the name of the environment variable
without supporting the old "PYLAUNCH_DEBUG" name, at least for a
couple of releases. Since 3.11 is still in beta, with the first
release candidate expected in August, there's still time to restore
support for the old name.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PYLAUNCH_DEBUG not printing info

2022-06-09 Thread Peter Otten

On 09/06/2022 00:53, Richard David wrote:

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 
win32
Type "help", "copyright", "credits" or "license" for more information.

^Z




Does getenv() confirm that the variable is set?

>>> import os
>>> os.getenv("PYLAUNCH_DEBUG")
'1'
--
https://mail.python.org/mailman/listinfo/python-list


Re: PYLAUNCH_DEBUG not printing info

2022-06-09 Thread Peter Otten

On 09/06/2022 00:53, Richard David wrote:

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 
win32
Type "help", "copyright", "credits" or "license" for more information.

^Z




Looks like the variable is now called PYLAUNCHER_DEBUG:

https://docs.python.org/3.11/using/windows.html#diagnostics
--
https://mail.python.org/mailman/listinfo/python-list