Python567
Jan 06, 2021 - 12:30
I want to be able to import another file and then run it in. For example:
I have a file with a print command in it. In my other file I want to import and execute it. How do I do that?
I want to be able to import another file and then run it in. For example:
I have a file with a print command in it. In my other file I want to import and execute it. How do I do that?
% cat a.py
import b
% cat b.py
print("Hello")
% python3 a.py
Hello
@ccc Sorry, I don‘t understand that.
a.py the text import bb.py the text print("Hello")a.py and it should output Hello