Passing information between modules

Michael F. Stemper michael.stemper at gmail.com
Sat Nov 19 15:46:16 EST 2022


On 18/11/2022 04.53, Stefan Ram wrote:
>    Can I use "sys.argv" to pass information between modules
>    as follows?
> 
>    in module A:
> 
> import sys
> sys.argv.append( "Hi there!" )
> 
>    in module B:
> 
> import sys
> message = sys.argv[ -1 ]

I just tried and it appears that one can append to sys.argv. However,
it seems like an incredibly bad idea.

-- 
Michael F. Stemper
The name of the story is "A Sound of Thunder".
It was written by Ray Bradbury. You're welcome.


More information about the Python-list mailing list