Create a module in Python named 'python_1.py' that make the follow:
- When import the module from Python console ('import python_1'), return 'Imported'.
When import the module from iPython console ('import python_1'), return 'Imported from iPython'.
When import the module from Command Prompt ('python python_1.py'), return 'Running as script'.
This is what I've done, but i don't know how to know where have been imported:
def python_1():
print 'Imported from iPython'