I need to create a module that implements:
When imported from a python console (import ) it prints "Imported"
When imported from a ipyhton console (import ) it prints "Imported from ipython"
When run from a system command line (python .py) it prints "Running as a script"
I think that the last function can be done with
if __name__ == "__main__":
print("Running as a script")
And I guess that the first one is with a basic function that prints "Imported from ipython", but how can I make that the module difference between python and ipython? Thank you!!