回复: Problem using cx_Freeze > auto-py-to-exe

Daniel Lee Daniel-ZX.Li at hotmail.com
Fri Aug 19 04:39:43 EDT 2022


Thank you so much, I really appreciate it.

发件人: Chris Angelico<mailto:rosuav at gmail.com>
发送时间: 2022年8月19日 8:39
收件人: python-list at python.org<mailto:python-list at python.org>
主题: Re: Problem using cx_Freeze > auto-py-to-exe

On Fri, 19 Aug 2022 at 10:07, Grant Edwards <grant.b.edwards at gmail.com> wrote:
>
> On 2022-08-18, Chris Angelico <rosuav at gmail.com> wrote:
> > On Fri, 19 Aug 2022 at 05:05, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> >> On 2022-08-18, Chris Angelico <rosuav at gmail.com> wrote:
> >>
> >> > It's one of the frustrations with JSON, since that format doesn't
> >> > allow the trailing comma :)
> >>
> >> Yep, that's a constant, low-level pain for all the C code I deal with
> >> which generates JSON. You'd think after 10+ years of maintaining code
> >> that outputs JSON, I wouldn't trip over that any longer...
> >
> > With some JSON files, I just cheat and define a shim at the end of arrays...
> >
> > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2FRosuav%2FMustardMine%2Fmaster%2Ftemplate.json&data=05%7C01%7C%7Cc74e60f1d42f4904e66c08da817b37fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637964663486534639%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W5LULRCXXGHodvem7CdscC9KZDrU7ONXbCAlIuBZ8Xg%3D&reserved=0
>
> That's OK if it's strictly internal. Almost all of the JSON data I
> work with is part of published APIs ― many of which are defined by
> industry consortiums or corporate-wide "standards".
>

That's an export/import format that I defined, so I mandated (a) that
there's an empty-string key as a signature (on import, it can be
anywhere, but on export, it's that final shim), and (b) all arrays are
allowed to have an empty string at the end, which is ignored on
import. Saves so much trouble.

That particular export format is actually designed as a git-managed
config file as well, which is why the line breaks are done the way
they are (anything on a single line is intended to be added/removed as
a single unit), which is why I definitely don't want the "add a comma
to the previous line" deltas.

"Strictly internal" is a subset of "protocols/standards that you are
in control of". :)

ChrisA
--
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-list&data=05%7C01%7C%7Cc74e60f1d42f4904e66c08da817b37fa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637964663486554552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5nlih9a9slRg%2FWdtsS4IbskQKIKUTfj%2BqefVsWa0C4Q%3D&reserved=0



More information about the Python-list mailing list