2

Is there a nice way to do this without just listing each one on a separate line (like the working example below)?

from module import func1 as name1
from module import func2 as name2
Gerald
  • 166
  • 1
  • 13
  • 1
    Possible duplicate of [How to do multiple imports in Python?](https://stackoverflow.com/questions/3260599/how-to-do-multiple-imports-in-python) – F. Leone Dec 13 '17 at 20:49
  • It's close, but it's ultimately not the same question. Though, had I seen it before I posted I might have been able to figure it out. However, because the problem is sufficiently different from my question, I feel like my question is valid and not duplicative. – Gerald Dec 13 '17 at 20:59

1 Answers1

3

You can import the attributes with aliases in one line:

from module import func1 as name1, func2 as name2
Ajax1234
  • 69,937
  • 8
  • 61
  • 102