# 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)    
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.existorlive.cn/kai-fa-yu-yan-xue-xi/python/0.-gai-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
