Run Python Script inside another Python Script
This is one method where you can run one python script inside another python script. Using this process you can add as many functions as you want and call your functions using the second, third, or more scripts. Watch the video for better understanding.
Save it as script1.py
#script1.py def helo(): return "hello world" def heloo(): return "ya i said it" def helooo(): return "oh thats it" def heloooo(): return "time for a nap"
Save it as script2.py
#script2.py import script1 try: print(script1.helo()) except AttributeError: print("No such Function born")
Comments
Post a Comment