ggonmar
ggonmar

Reputation: 839

How to get the module name from the alias

Given

import a_long_module_name as short_name

Is there a way of obtaining the name of the module from the alias, so I can

x=something(short_name)
print(x)
>> a_long_module_name 

Thanks!

Upvotes: 0

Views: 210

Answers (1)

Tajinder Singh
Tajinder Singh

Reputation: 1531

An example with numpy

import numpy as np

print (np.__name__)

It prints "numpy"

Upvotes: 4

Related Questions