Mar-01-2020, 07:57 PM
yep, you misunderstood the question. In the OP original code if they import it in another module, then the 2 functions are accessible, but also lines 9-11 get executed at the time of the import. OP wants to prevent this from happening
(Feb-29-2020, 06:15 AM)sbabu Wrote: only displays the information when executed directly, but it must not not display anything if it is imported as a module
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs