Python: How can I import all variables?

前端 未结 4 1061
广开言路
广开言路 2020-12-09 07:42

I\'m new to Python and programming in general (a couple of weeks at most).

Concerning Python and using modules, I realise that functions can imported using fro

4条回答
  •  甜味超标
    2020-12-09 07:56

    You gave the solution yourself: from a import * will work just fine. Python does not differentiate between functions and variables in this respect.

    >>> from a import *
    >>> if name == "Michael" and age == 15:
    ...     print('Simple!')
    ...
    Simple!
    

提交回复
热议问题