Hi everyone,
today I learnt about the import statement and tried it with two python files. One, let’s call it code1.py contains 2 defined functions that I wrote and two random print statements. I imported code1 to code2.py, which is the second python file, using import code1. When I try to call a function in code2.py via print(code1.function()), I get not only the function called but also both of the print statements executed, which I don’t want. Could anyone please help me with how you make it so when you call a function (in code 2) that is imported (from code1 )that the other print statements from the original file (code1) don’t get executed in code2? Thanks a lot!