Friday Finking: Source code organisation
Terry Reedy
tjreedy at udel.edu
Thu Jan 2 13:36:32 EST 2020
On 1/2/2020 2:46 AM, Cameron Simpson wrote:
> Inline code under the if...__main__ stuff cannot be called as a
> function;
Which makes it difficult to test app startup.
> I usually consider the main() function a reusable component.
Which, if called (at least optionally) with a list of string arguments
(sys.argv) as Cameron suggested, makes it easy to test with various
lists of strings.
--
Terry Jan Reedy
More information about the Python-list
mailing list