how to call a python script inside another python script where both in the same directory?
Question: i have two script--script1.py and script2.py. Now i want to call script1.py
with in script2.py. algo will be like this--

IF condition: run script1.py #through command line ELSE : exit


Answer: In `script1.py` place this:

    
    
    def main():
        do something
    
    if __name__ == "__main__":
        main()
    

In `script2.py`:

    
    
    import script1
    
    if condition:
        script1.main()
    

