how to call a python script inside another python script where both in the same directory? -
i have 2 script--script1.py , script2.py. want call script1.py in script2.py. algo this--
if condition: run script1.py #through command line else : exit
in script1.py
place this:
def main(): if __name__ == "__main__": main()
in script2.py
:
import script1 if condition: script1.main()
Comments
Post a Comment