> For the complete documentation index, see [llms.txt](https://gitbook.existorlive.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.existorlive.cn/kai-fa-yu-yan-xue-xi/python/0.-gai-shu.md).

# 0.概述

#### 1. 引入模块

\#Swift\
\#基本语法\
\#语言

在 python 用 **import** 或者 **from...import** 来导入相应的模块。\
将整个模块(somemodule)导入，格式为： **import somemodule**\
从某个模块中导入某个函数,格式为： **from somemodule import somefunction**\
从某个模块中导入多个函数,格式为： **from somemodule import firstfunc, secondfunc, thirdfunc**\
将某个模块中的全部函数导入，格式为： \*\*from somemodule import \*\*\*

```python
import sys
print('================Python import mode==========================')
print ('命令行参数为:')
for i in sys.argv:
    print (i)
print ('\n python 路径为',sys.path)

from sys import argv,path  #  导入特定的成员
 
print('================python from import===================================')
print('path:',path) # 因为已经导入path成员，所以此处引用时不需要加sys.path
```

####

#### 2. builtin 模块

builtin 是内置模块，不需要显式地 import ；

builtin 中定义了 python 的基本能力，包括 基本的数据类型 (Number,String,Tuple等) 以及 常用函数 (print, abs 等)\
​

```python
import builtins      # 不需要显式import

if __name__ == '__main__':
    builtins.print(11)      # print 定义在 builtin 中

```

#### 3. 内置函数

```python
def issubclass(x, A_tuple)

def isinstance(x, A_tuple)  // 是否

def type(obj)    
```
