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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -