| Skip to content | https://patch-diff.githubusercontent.com/hooj0/python-examples#start-of-content |
|
| https://patch-diff.githubusercontent.com/ |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhooj0%2Fpython-examples |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhooj0%2Fpython-examples |
|
Sign up
| https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=hooj0%2Fpython-examples |
| Reload | https://patch-diff.githubusercontent.com/hooj0/python-examples |
| Reload | https://patch-diff.githubusercontent.com/hooj0/python-examples |
| Reload | https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
hooj0
| https://patch-diff.githubusercontent.com/hooj0 |
| python-examples | https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
Notifications
| https://patch-diff.githubusercontent.com/login?return_to=%2Fhooj0%2Fpython-examples |
|
Fork
0
| https://patch-diff.githubusercontent.com/login?return_to=%2Fhooj0%2Fpython-examples |
|
Star
0
| https://patch-diff.githubusercontent.com/login?return_to=%2Fhooj0%2Fpython-examples |
|
0
stars
| https://patch-diff.githubusercontent.com/hooj0/python-examples/stargazers |
|
0
forks
| https://patch-diff.githubusercontent.com/hooj0/python-examples/forks |
|
Branches
| https://patch-diff.githubusercontent.com/hooj0/python-examples/branches |
|
Tags
| https://patch-diff.githubusercontent.com/hooj0/python-examples/tags |
|
Activity
| https://patch-diff.githubusercontent.com/hooj0/python-examples/activity |
|
Star
| https://patch-diff.githubusercontent.com/login?return_to=%2Fhooj0%2Fpython-examples |
|
Notifications
| https://patch-diff.githubusercontent.com/login?return_to=%2Fhooj0%2Fpython-examples |
|
Code
| https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
Issues
0
| https://patch-diff.githubusercontent.com/hooj0/python-examples/issues |
|
Pull requests
0
| https://patch-diff.githubusercontent.com/hooj0/python-examples/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/hooj0/python-examples/actions |
|
Projects
0
| https://patch-diff.githubusercontent.com/hooj0/python-examples/projects |
|
Security
Uh oh!
There was an error while loading. Please reload this page.
| https://patch-diff.githubusercontent.com/hooj0/python-examples/security |
| Please reload this page | https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
Insights
| https://patch-diff.githubusercontent.com/hooj0/python-examples/pulse |
|
Code
| https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
Issues
| https://patch-diff.githubusercontent.com/hooj0/python-examples/issues |
|
Pull requests
| https://patch-diff.githubusercontent.com/hooj0/python-examples/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/hooj0/python-examples/actions |
|
Projects
| https://patch-diff.githubusercontent.com/hooj0/python-examples/projects |
|
Security
| https://patch-diff.githubusercontent.com/hooj0/python-examples/security |
|
Insights
| https://patch-diff.githubusercontent.com/hooj0/python-examples/pulse |
| Branches | https://patch-diff.githubusercontent.com/hooj0/python-examples/branches |
| Tags | https://patch-diff.githubusercontent.com/hooj0/python-examples/tags |
| https://patch-diff.githubusercontent.com/hooj0/python-examples/branches |
| https://patch-diff.githubusercontent.com/hooj0/python-examples/tags |
| 681 Commits | https://patch-diff.githubusercontent.com/hooj0/python-examples/commits/master/ |
| https://patch-diff.githubusercontent.com/hooj0/python-examples/commits/master/ |
| .idea | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.idea |
| .idea | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.idea |
| .settings | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.settings |
| .settings | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.settings |
| 00_examples_helloworld | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/00_examples_helloworld |
| 00_examples_helloworld | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/00_examples_helloworld |
| 01_examples_variable | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/01_examples_variable |
| 01_examples_variable | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/01_examples_variable |
| 02_examples_in_out | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/02_examples_in_out |
| 02_examples_in_out | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/02_examples_in_out |
| 03_examples_string | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/03_examples_string |
| 03_examples_string | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/03_examples_string |
| 04_examples_data_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/04_examples_data_type |
| 04_examples_data_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/04_examples_data_type |
| 05_examples_math | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/05_examples_math |
| 05_examples_math | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/05_examples_math |
| 06_examples_datetime | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/06_examples_datetime |
| 06_examples_datetime | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/06_examples_datetime |
| 07_examples_data_struct | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/07_examples_data_struct |
| 07_examples_data_struct | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/07_examples_data_struct |
| 08_examples_if_else | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/08_examples_if_else |
| 08_examples_if_else | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/08_examples_if_else |
| 09_examples_loop | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/09_examples_loop |
| 09_examples_loop | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/09_examples_loop |
| 10_examples_func | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/10_examples_func |
| 10_examples_func | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/10_examples_func |
| 11_examples_pkg_modules | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/11_examples_pkg_modules |
| 11_examples_pkg_modules | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/11_examples_pkg_modules |
| 12_examples_serialization | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/12_examples_serialization |
| 12_examples_serialization | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/12_examples_serialization |
| 13_examples_io | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/13_examples_io |
| 13_examples_io | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/13_examples_io |
| 14_examples_os_dir | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/14_examples_os_dir |
| 14_examples_os_dir | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/14_examples_os_dir |
| 15_examples_os_file | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/15_examples_os_file |
| 15_examples_os_file | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/15_examples_os_file |
| 16_examples_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/16_examples_exception |
| 16_examples_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/16_examples_exception |
| 17_examples_object | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/17_examples_object |
| 17_examples_object | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/17_examples_object |
| 18_examples_standand_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/18_examples_standand_lib |
| 18_examples_standand_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/18_examples_standand_lib |
| 19_examples_json | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/19_examples_json |
| 19_examples_json | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/19_examples_json |
| 20_examples_regex | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/20_examples_regex |
| 20_examples_regex | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/20_examples_regex |
| 21_examples_socket | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/21_examples_socket |
| 21_examples_socket | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/21_examples_socket |
| 22_examples_email | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/22_examples_email |
| 22_examples_email | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/22_examples_email |
| 23_examples_thread | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/23_examples_thread |
| 23_examples_thread | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/23_examples_thread |
| 24_examples_db | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/24_examples_db |
| 24_examples_db | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/24_examples_db |
| 25_examples_shell | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/25_examples_shell |
| 25_examples_shell | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/25_examples_shell |
| 26_examples_yaml | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/26_examples_yaml |
| 26_examples_yaml | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/26_examples_yaml |
| 27_examples_template | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/27_examples_template |
| 27_examples_template | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/27_examples_template |
| 28_examples_asyncio | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/28_examples_asyncio |
| 28_examples_asyncio | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/28_examples_asyncio |
| 29_examples_asyncio_advanced | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/29_examples_asyncio_advanced |
| 29_examples_asyncio_advanced | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/29_examples_asyncio_advanced |
| 30_examples_process_bar | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/30_examples_process_bar |
| 30_examples_process_bar | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/30_examples_process_bar |
| 31_examples_requests | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/31_examples_requests |
| 31_examples_requests | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/31_examples_requests |
| 32_examples_excel | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/32_examples_excel |
| 32_examples_excel | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/32_examples_excel |
| 33_examples_sign_xml | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/33_examples_sign_xml |
| 33_examples_sign_xml | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/33_examples_sign_xml |
| 34_examples_marshmallow_dataclass | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/34_examples_marshmallow_dataclass |
| 34_examples_marshmallow_dataclass | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/34_examples_marshmallow_dataclass |
| 50_samples_varables | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/50_samples_varables |
| 50_samples_varables | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/50_samples_varables |
| app_generator_copyright | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_copyright |
| app_generator_copyright | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_copyright |
| app_generator_sql_doc | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_sql_doc |
| app_generator_sql_doc | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_sql_doc |
| app_generator_toc | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_toc |
| app_generator_toc | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_toc |
| app_mini_tools | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_mini_tools |
| app_mini_tools | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_mini_tools |
| app_webhook | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_webhook |
| app_webhook | https://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_webhook |
| .gitignore | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.gitignore |
| .gitignore | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.gitignore |
| .project | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.project |
| .project | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.project |
| .pydevproject | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.pydevproject |
| .pydevproject | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.pydevproject |
| comment | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/comment |
| comment | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/comment |
| readme.md | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/readme.md |
| readme.md | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/readme.md |
| tutorial.md | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/tutorial.md |
| tutorial.md | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/tutorial.md |
| README | https://patch-diff.githubusercontent.com/hooj0/python-examples |
| 00_examples_helloworld | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/00_examples_helloworld |
| hello_world | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/00_examples_helloworld/hello_world.py |
| 01_examples_variable | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable |
| variables | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py |
| variable 变量#L12 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L12 |
| 描述:变量是存储任何类型数据的一种媒介#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L14 |
| del var 删除变量#L17 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L17 |
| a = b = c = 1 多个变量赋值#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L19 |
| 变量 用大小写字母、_、数字进行表示,且不能用 数字开头#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L22 |
| 纯小写字符变量#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L27 |
| 不能以数字开头#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L31 |
| 大小写混合变量#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L35 |
| 带_组合变量#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L39 |
| 带_和数字、字母组合变量#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L43 |
| _ 下划线开头变量#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L47 |
| 常量,由全大写字符串和下划线、数字组成#L56 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L56 |
| 删除变量#L61 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L61 |
| 多个变量赋值#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L65 |
| 02_examples_in_out | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out |
| io_input | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py |
| input 接收输入参数,可以输入文本#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L20 |
| 变量接收输入参数#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L24 |
| 输入之前可以打印输入提示文本#L28 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L28 |
| io_print | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py |
| 直接输入内容#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L22 |
| 中间的 “,” 会用空格进行输出,相当于是拼接字符串#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L24 |
| "\n" 就是换行#L26 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L26 |
| 多个字符串拼接输出#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L31 |
| 传递数字或变量#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L36 |
| 设置分隔符,默认的是‘ ’空格;设置结束符号,默认是 '\n'#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L39 |
| 设置打印内容输出流,默认是 sys.stdout,输出到屏幕控制台;#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L43 |
| 03_examples_string | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string |
| str_escape | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py |
| 转义字符、多行输出#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L45 |
| 字符转义#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L47 |
| r"..." 表示字符串原样输出,忽略特殊字符#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L51 |
| 多行输出 '''......''' 中间可以进行换行#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L55 |
| \ 进行续行, 当一行不够显示,要换行而又不进行拼接#L67 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L67 |
| 加号拼接#L72 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L72 |
| 相邻字符在同一行也可以拼接#L76 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L76 |
| u'......' 表示Unicode编码字符串#L80 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L80 |
| str_fmt_func | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py |
| 字符串输出#L26 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L26 |
| 表达式输出#L38 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L38 |
| 格式化输出#L56 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L56 |
| str_format | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py |
| 在八进制数前面显示零('0'),在十六进制前面显示'0x'或者'0X'(取决于用的是'x'还是'X')#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L32 |
| % 用来格式化字符串的#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L42 |
| %d 用来格式化参:整数#L44 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L44 |
| %x 用来格式化参:十六进制数#L46 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L46 |
| % 字符串替换传参, 格式化#L49 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L49 |
| 多个字符串用 % (参数1,参数2...)#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L51 |
| %d 进行整数格式化操作#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L55 |
| %2d 表示前面补空字符串 2个;%15d 表示补空格15个#L57 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L57 |
| %f 浮点数格式化,可以进行小数位的保留#L64 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L64 |
| %.f 不保留小数#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L68 |
| %.2f 保留2位小数#L70 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L70 |
| %x 十六进制#L78 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L78 |
| %s 会进行数学转换到十进制#L81 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L81 |
| %%进行百分号转义#L84 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L84 |
| * 定义宽度或者小数点精度#L89 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L89 |
| 在正数前面显示加号( + )#L92 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L92 |
| 在正数前面显示空格#L94 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L94 |
| 0 显示的数字前面填充'0'而不是默认的空格#L96 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L96 |
| 混合模式#L106 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L106 |
| 小数格式化#L115 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L115 |
| d 针对整数类型, {n:size} size代表空格宽度#L118 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L118 |
| 访问字典值,结合索引和key进行访问#L124 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L124 |
| 直接用key访问字典,** 参数转换#L127 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L127 |
| str_function | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py |
| chr() 可以将ASCII数字转换为字符串#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L42 |
| ord() 可以将字符串转换为ASCII的值#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L45 |
| encode 可以进行字符串编码#L48 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L48 |
| b 表示byte字符串#L54 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L54 |
| len 字符串长度#L59 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L59 |
| 字符串重复出现: str * int#L66 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L66 |
| 字符串拼接,字符串不能和非字符串拼接#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L68 |
| 取字符串中特定字符#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L71 |
| 字符串分片切块: str[头下标:尾下标] 不包含尾下标元素#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L77 |
| 默认的分切索引很有用:默认的第一个索引为零,第二个索引默认为字符串可以被分切的长度#L93 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L93 |
| 不输出起始位置,默认是0#L96 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L96 |
| 全部字符串#L98 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L98 |
| 规律#L100 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L100 |
| in / not in 成员运算#L104 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L104 |
| str_function_inner | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py |
| string.capitalize() 把字符串的第一个字符大写#L62 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L62 |
| 返回一个原字符串居中,并使用空格填充至长度 width 的新字符串#L67 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L67 |
| 返回 str 在 string 里面出现的次数,如果 beg 或者 end 指定则返回指定范围内 str 出现的次数#L72 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L72 |
| 以 encoding 指定的编码格式编码 string,如果出错默认报一个ValueError 的异常,除非 errors 指定的是'ignore'或者'replace'#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L77 |
| 以 encoding 指定的编码格式解码 string,如果出错默认报一个 ValueError 的 异 常 , 除 非 errors 指 定 的 是 'ignore' 或 者'replace'#L81 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L81 |
| 检查字符串是否以 obj 结束,如果beg 或者 end 指定则检查指定的范围内是否以 obj 结束,如果是,返回 True,否则返回 False.#L85 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L85 |
| 把字符串 string 中的 tab 符号转为空格,默认的空格数 tabsize 是 8.#L91 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L91 |
| 检测 str 是否包含在 string 中,如果 beg 和 end 指定范围,则检查是否包含在指定范围内,如果是返回开始的索引值,否则返回-1#L95 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L95 |
| 跟find()方法一样,只不过如果str不在 string中会报一个异常.#L100 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L100 |
| 如果 string 所有字符都是字母或数字则返回 True,否则返回 False#L105 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L105 |
| 如果 string 至少有一个字符并且所有字符都是字母则返回 True,否则返回 False#L111 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L111 |
| 如果 string 只包含十进制数字则返回 True 否则返回 False.#L116 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L116 |
| 如果 string 只包含数字则返回 True 否则返回 False.#L121 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L121 |
| 如果 string 都是小写,则返回 True,否则返回 False#L126 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L126 |
| 如果 string 中只包含数字字符,则返回 True,否则返回 False#L133 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L133 |
| 如果 string 中只包含空格,则返回 True,否则返回 False.#L138 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L138 |
| 如果 string 是单词形式,首字母大写,其他小写。则返回 True,否则返回 False#L144 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L144 |
| 如果 string 中包含至少一个区分大小写的字符,并且所有这些(区分大小写的)字符都是大写,则返回 True,否则返回 False#L150 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L150 |
| Merges (concatenates)以 string 作为分隔符,将 seq 中所有的元素(的字符串表示)合并为一个新的字符串#L156 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L156 |
| 返回一个原字符串左对齐,并使用空格填充至长度 width 的新字符串#L162 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L162 |
| 转换 string 中所有大写字符为小写.#L167 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L167 |
| 截掉 string 左边的空格#L171 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L171 |
| 第一个参数是字符串,表示需要转换的字符,第二个参数也是字符串表示转换的目标。#L176 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L176 |
| 返回字符串 str 中最大的字母。#L185 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L185 |
| 返回字符串 str 中最小的字母。#L189 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L189 |
| 有点像 find()和 split()的结合体,从 str 出现的第一个位置起,#L193 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L193 |
| 如果 string 中不包含str 则 string_pre_str == string.#L195 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L195 |
| 把 string 中的 str1 替换成 str2,如果 num 指定,则替换不超过 num 次.#L200 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L200 |
| 类似于 find()函数,不过是从右边开始查找.#L206 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L206 |
| 类似于 index(),不过是从右边开始.#L212 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L212 |
| 返回一个原字符串右对齐,并使用空格填充至长度 width 的新字符串#L218 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L218 |
| 类似于 partition()函数,不过是从右边开始查找.#L222 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L222 |
| 删除 string 字符串末尾的空格.#L227 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L227 |
| 以 str 为分隔符切片 string,如果 num有指定值,则仅分隔 num 个子字符串#L231 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L231 |
| 按照行分隔,返回一个包含各行作为元素的列表,如果 num 指定则仅切片 num 个行.#L237 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L237 |
| 检查字符串是否是以 obj 开头,是则返回 True,否则返回 False。如果beg 和 end 指定值,则在指定范围内检查.#L241 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L241 |
| 在 string 上执行 lstrip()和 rstrip()#L246 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L246 |
| 翻转 string 中的大小写#L250 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L250 |
| 返回"标题化"的 string,就是说所有单词都是以大写开始,其余字母均为小写(见 istitle())#L254 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L254 |
| string.upper() 转换 string 中的小写字母为大写#L258 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L258 |
| 返回长度为 width 的字符串,原字符串 string 右对齐,前面填充0#L262 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L262 |
| 04_examples_data_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type |
| cast_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py |
| int类型转换#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L31 |
| float类型转换#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L36 |
| complex 复数转换#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L40 |
| 字符串转换#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L43 |
| 表达式转换#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L47 |
| 元组转换#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L50 |
| list 列表转换#L54 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L54 |
| set 集合转换#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L58 |
| dict字典转换#L62 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L62 |
| 整数转字符#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L65 |
| 字符转整数#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L68 |
| 整数转16进制字符串#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L71 |
| 整数转8进制#L75 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L75 |
| 类型转换#L79 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L79 |
| data_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py |
| 整数类型#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L33 |
| 十六进制 ox前缀开头, 0-9/a-f 表示#L38 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L38 |
| 长整数 是比较大的整数#L52 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L52 |
| 浮点型#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L55 |
| E1小数点向后移动 1 位#L59 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L59 |
| E2小数点向后移动 2 位#L61 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L61 |
| E3小数点向后移动 3 位#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L63 |
| 浮点型 4 + 2 位小数#L69 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L69 |
| 浮点型 6位小数#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L71 |
| 2 位小数#L73 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L73 |
| 字符串#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L77 |
| 布尔值#L86 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L86 |
| 空值#L104 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L104 |
| 复数#L110 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L110 |
| object_type | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/object_type.py |
| 05_examples_math | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math |
| math_function | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py |
| 绝对值 abs#L62 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L62 |
| 上入整数#L67 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L67 |
| 下舍整数#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L71 |
| 返回e的x次幂(ex)#L76 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L76 |
| 返回数字的绝对值#L79 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L79 |
| 将一个浮点数的整数和小数进行拆分#L97 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L97 |
| 乘方#L101 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L101 |
| round 四舍五入#L105 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L105 |
| 保留2位小数#L110 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L110 |
| 保留3位小数#L112 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L112 |
| 3位小数#L114 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L114 |
| sqrt 求平方根#L117 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L117 |
| 从序列的元素中随机挑选一个元素#L122 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L122 |
| 从指定范围内,按指定基数递增的集合中获取一个随机数,基数缺省值为1#L127 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L127 |
| 0,1)范围内。#L134 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L134 |
| 改变随机数生成器的种子seed。如果你不了解其原理,你不必特别去设定seed,Python会帮你选择seed。#L139 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L139 |
| 将序列的所有元素随机排序#L142 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L142 |
| 随机生成下一个实数,它在[x,y]范围内。#L152 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L152 |
| 返回的x弧度的正弦值。#L157 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L157 |
| 返回x的反余弦弧度值。#L162 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L162 |
| 返回x的反正弦弧度值。#L164 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L164 |
| 返回x弧度的正切值。#L166 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L166 |
| 返回x的弧度的余弦值。#L168 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L168 |
| 返回x的反正切弧度值。#L170 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L170 |
| 返回给定的 X 及 Y 坐标值的反正切值。#L172 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L172 |
| 返回欧几里德范数 sqrt(xx + yy)。#L174 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L174 |
| 将弧度转换为角度,如degrees(math.pi/2) , 返回90.0#L176 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L176 |
| 将角度转换为弧度#L178 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L178 |
| math_operator | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py |
| 加法运算#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L63 |
| 减法运算#L69 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L69 |
| 乘法运算#L75 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L75 |
| 乘方#L80 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L80 |
| 除法运算#L85 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L85 |
| 除法取整数#L91 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L91 |
| 取模运算,余数#L97 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L97 |
| 赋值操作#L102 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L102 |
| 位运算符#L126 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L126 |
| 按位与运算符#L175 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L175 |
| 按位或运算符#L177 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L177 |
| 按位异或运算符#L179 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L179 |
| 按位取反运算符#L181 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L181 |
| 左移动运算符#L184 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L184 |
| 右移动运算符#L186 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L186 |
| 06_examples_datetime | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime |
| date_calendar | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py |
| 返回一个多行字符串格式的year年month月日历#L46 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L46 |
| w 是每天之间宽度,l是每天之间高度#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L51 |
| 一年的日历,c 表示每个月日历之前的宽度间距#L56 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L56 |
| 当前每周起始日期的设置。默认情况下,首次载入caendar模块时返回0,即星期一#L61 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L61 |
| 是否闰年#L64 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L64 |
| 返回两年之间闰月数量#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L68 |
| 返回这个月的日历的二维数组#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L71 |
| 直接打印日历,相当于 prin(calendar.calendar(year,w,l,c))#L74 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L74 |
| 返回当前月的最开始日期的前一天的星期和当前月日期的最后一天#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L77 |
| 打印某个月的日历,相当于 print calendar.calendar(year,w,l,c)#L82 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L82 |
| 返回当前日期秒数#L85 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L85 |
| 设置每周的起始日期码#L88 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L88 |
| 返回星期几#L91 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L91 |
| date_time | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py |
| 时间戳#L180 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L180 |
| 当前时间,t.tm_isdst可取0或1,取决于当地当时是不是夏令时#L187 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L187 |
| 可读时间#L192 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L192 |
| 格式化时间#L197 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L197 |
| 字符串转时间#L202 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L202 |
| 字符格式化成时间#L208 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L208 |
| 时区#L213 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L213 |
| 休眠时间#L216 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L216 |
| 用以浮点数计算的秒数返回当前的CPU时间#L221 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L221 |
| 返回每次运行的时间#L231 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L231 |
| 当前时间;未给参数相当于asctime()#L238 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L238 |
| 指定某个时间,传秒数;相当于asctime(localtime(secs))#L240 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L240 |
| 接收时间戳,返回格林时间,t.tm_isdst始终为0#L243 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L243 |
| 07_examples_data_struct | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct |
| data_struct | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py |
| 将列表当做堆栈使用,结合append、pop方法,达到先进后出的目的#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L24 |
| 将列表当作队列使用#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L35 |
| 添加到最前面#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L39 |
| 弹出最前面的#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L43 |
| 弹出最后面的#L46 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L46 |
| 添加到最前面#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L50 |
| 列表推导式#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L55 |
| 调用一些方法#L61 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L61 |
| 过滤#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L65 |
| 循环嵌套#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L68 |
| 元组和序列#L90 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L90 |
| 集合:可以用大括号({})创建集合。注意:如果要创建一个空集合,你必须用 set() 而不是 {} ;后者创建一个空的字典#L98 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L98 |
| 集合也支持推导式#L102 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L102 |
| 遍历技巧#L112 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L112 |
| 遍历字典结构,在字典中遍历时,关键字和对应的值可以使用 items() 方法同时解读出来#L114 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L114 |
| 在序列中遍历时,索引位置和对应值可以使用 enumerate() 函数同时得到#L118 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L118 |
| 同时遍历两个或更多的序列,可以使用 zip() 组合:#L125 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L125 |
| dict | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py |
| 构造一个dict 数据字典#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L45 |
| 构造dict 方法2,用列表List 嵌套 元组#L49 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L49 |
| 构造dict 方法3,有点像属性和值的对应#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L53 |
| 构造dict 动态方法#L57 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L57 |
| 通过get去获取key值#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L63 |
| 也可以通过 obj['xxx'] 这种形式取值,类似JavaScript中的对象取值#L66 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L66 |
| 处理不存在的key#L70 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L70 |
| 不存在#L81 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L81 |
| 通过get 方法,设置默认值。如果存在就返回值,不存在就返回默认值 = None#L84 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L84 |
| 设置不存在的时候,默认值为 empty#L86 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L86 |
| 设置值#L90 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L90 |
| 删除元素#L100 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L100 |
| 删除元素,和JavaScript类似#L104 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L104 |
| 返回所有key#L109 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L109 |
| 返回所有value#L112 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L112 |
| 将value转换list#L115 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L115 |
| 排序#L118 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L118 |
| 清空字典#L124 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L124 |
| 字典浅拷贝#L141 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L141 |
| 创建一个字典对象,key值为seq对象,value为None#L146 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L146 |
| 创建一个字典对象,key值为seq对象,value为2#L149 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L149 |
| 将存在键值的字典N更新到字典tmp#L154 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L154 |
| 返回可以直接遍历键值对#L159 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L159 |
| iter | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py |
| iter 构造迭代器#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L29 |
| next下一个元素#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L32 |
| 循环遍历#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L37 |
| 循环遍历#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L43 |
| list | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py |
| 创建一个list#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L53 |
| len() 获取list长度#L57 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L57 |
| 通过索引、下标 访问;索引从0开始#L60 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L60 |
| 当索引越界超出长度就会出现错误#L64 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L64 |
| append 添加新的元素#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L71 |
| insert 插入元素到指定索引位置#L75 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L75 |
| 当索引比长度还大时,元素会添加到末尾#L78 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L78 |
| 对已知存在的元素进行赋值#L83 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L83 |
| pop 删除末尾的元素#L87 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L87 |
| 删除指定索引位置的元素 pop(index)#L89 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L89 |
| 删除指定索引位置的元素#L93 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L93 |
| 不同类型的元素的list#L97 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L97 |
| list 进行叠加,会出现并集结果#L103 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L103 |
| list[index-start, index-end] 对列表进行分片处理,同字符串分片一样,不包含截止下标的元素#L108 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L108 |
| 从3开始,到最后#L113 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L113 |
| 输出全部元素#L115 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L115 |
| 删除某个区间的元素#L118 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L118 |
| 在指定区间插入值,如果区间有元素将被覆盖#L123 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L123 |
| 判断list中是否存在某个元素#L127 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L127 |
| list 进行排序#L131 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L131 |
| 倒序#L136 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L136 |
| 清空元素#L143 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L143 |
| 删除对象list#L148 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L148 |
| 复制#L152 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L152 |
| 元素出现次数#L160 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L160 |
| 元素首次出现的下标#L162 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L162 |
| 最大元素和最小元素#L167 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L167 |
| 继承某个list集合,相当于两个集合进行拼接#L171 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L171 |
| range | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py |
| range 序列#L12 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L12 |
| 生成指定截止区间的整数集合#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L25 |
| 生成指定区间,带有起始位置的序列集合#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L32 |
| 生成指定区间,带有起始位置,并且有步长的序列集合#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L39 |
| set | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py |
| 构造 set,通过set(iterable)方法构造,参数是一个iterable集合#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L32 |
| 添加元素 add,通过add方法添加新元素#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L43 |
| 删除元素#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L47 |
| 清空所有元素#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L51 |
| 求numbers1、numbers2的交集#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L58 |
| 字符串直接被构建成set#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L65 |
| tuple | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py |
| tuple 和 list 雷同,但是它创建数据后不能随意修改#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L36 |
| 构建元组#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L40 |
| 取值方法,用索引下标的方式#L49 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L49 |
| 分片获取数据#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L53 |
| 定义一个元素的tuple, 必须带一个 逗号,不然python不知道是否是运算操作#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L58 |
| 并集#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L68 |
| 删除对象#L73 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L73 |
| 元组的长度#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L77 |
| 复制#L80 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L80 |
| 判断元素是否存在元组中#L83 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L83 |
| 循环遍历#L87 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L87 |
| 08_examples_if_else | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else |
| if_elif_else | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py |
| 条件语句#L12 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L12 |
| 相反,则为True#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L63 |
| if elif else 语句#L90 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L90 |
| 客户端输入参数进行if判断#L101 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L101 |
| 逻辑运算符#L113 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L113 |
| 成员运算#L142 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L142 |
| 身份运算, id() 指向内存地址#L150 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L150 |
| 三元运算#L180 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L180 |
| 09_examples_loop | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop |
| for_while | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py |
| for 循环#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L30 |
| 通过下标进行迭代循环#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L35 |
| range 序列函数,range可以生成一个指定区间的list集合#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L40 |
| 正常结束会被执行,break中断的不被执行#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L53 |
| while 循环#L73 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L73 |
| continue continue后的语句不被执行,正常结束else被执行#L91 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L91 |
| 站位,不做任何事情#L101 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L101 |
| 10_examples_func | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func |
| function | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py |
| 定义函数(必备参数)#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L37 |
| 执行函数#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L41 |
| 带返回值的函数#L44 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L44 |
| 函数变量作用域#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L50 |
| 内部的赋值不会影响外部#L59 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L59 |
| 缺省参数(age/sex/address 为缺省参数)#L64 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L64 |
| get_user() name为必传参数#L68 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L68 |
| 函数返回值(命名参数)#L76 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L76 |
| 可变参数(不定长参数)#L96 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L96 |
| 可变参数(不定长参数) kw key-value 参数#L107 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L107 |
| 按引用传递参数,传入list值,发现方法里面对list进行操作会影响外部定义的变量#L118 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L118 |
| lambda 来创建匿名函数#L129 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L129 |
| 11_examples_pkg_modules/modules | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules |
| module | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py |
| import sys引入python标准库中的sys.py模块;这是引入某一模块的方法#L11 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L11 |
| 导入模块#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L13 |
| 导入模块中的方法#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L16 |
| 导入时,会允许模块中的if代码块#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L19 |
| sys.argv是一个包含命令行参数的列表#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L29 |
| sys.path包含了一个Python解释器自动查找所需模块的路径的列表#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L33 |
| 定义自定义模块,并导入使用其中定义的方法#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L36 |
| 定义一个变量,接收模块方法#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L39 |
| 调用模块中的方法#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L43 |
| 输出模块中的变量#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L47 |
| 输出当前模块主程序函数名称#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L50 |
| 查看一个模块里的方法和全局变量#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L55 |
| 列举当前模块的方法、变量、以及导入的模块和变量#L60 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L60 |
| module_center | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module_center.py |
| using_name | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py |
| 一个模块被另一个程序第一次引入时,其主程序将运行。#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py#L13 |
| 说明: 每个模块都有一个__name__属性,当其值是'main'时,表明该模块自身在运行,否则是被引入#L15 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py#L15 |
| 11_examples_pkg_modules/packages/core/files | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files |
| a | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/a.py |
| b | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/b.py |
| c | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/c.py |
| d | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/d.py |
| file | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/file.py |
| __init__ | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/__init__.py |
| 11_examples_pkg_modules/packages/core/filters | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/filters |
| filter | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/filters/filter.py |
| __init__ | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/filters/__init__.py |
| 11_examples_pkg_modules/packages/core/parser | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/parser |
| parser | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/parser/parser.py |
| __init__ | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/parser/__init__.py |
| 11_examples_pkg_modules/packages/core | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core |
| __init__ | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/__init__.py |
| 11_examples_pkg_modules/packages | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages |
| run | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py |
| 导入包名#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L24 |
| 必须全名访问,packages.flie.method()#L26 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L26 |
| 导入包和模块#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L31 |
| 名称会简短#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L33 |
| 直接导入方法和变量#L38 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L38 |
| 使用导入的方法和变量#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L40 |
| 导入后使用短名称#L46 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L46 |
| 必须全名访问,packages.flie.method()#L48 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L48 |
| 由于 init的package文件中没有定义 d.py 所以导入的时候,d.py不被导入#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L53 |
| 11_examples_pkg_modules | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules |
| run | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/run.py |
| 12_examples_serialization | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization |
| io_serialization | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py |
| 序列化----------------------------------------#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L24 |
| 反序列化--------------------------------------#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L32 |
| 加载序列化的数据#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L35 |
| 格式化输出反序列数据#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L39 |
| 加载数据#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L43 |
| 格式化输出反序列数据#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L47 |
| 13_examples_io | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io |
| io_file | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py |
| 打开文件-----------------------------------------------------#L111 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L111 |
| 打开一个文件,文件不存发生在异常#L113 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L113 |
| 默认mode = r,w 是写入模式,并且指针移动到文件头部会清空里面的内容#L117 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L117 |
| 创建新文件并打开写入,文件已存在会发生异常#L121 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L121 |
| 打开文件并追加内容,不存在会自动创建#L125 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L125 |
| 读写模式,文件不存发生在异常#L129 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L129 |
| 二进制模式,组合使用 读二进制、写二进制#L133 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L133 |
| 文本模式#L137 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L137 |
| 创建新文件--------------------------------------------------#L142 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L142 |
| 写文件 -----------------------------------------------------#L146 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L146 |
| 其他非字符串内容需要转换#L154 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L154 |
| 读文件 -----------------------------------------------------#L157 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L157 |
| 读取所有内容#L160 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L160 |
| 取得文件指针位置#L163 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L163 |
| 移动指针位置#L166 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L166 |
| 读取一行#L171 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L171 |
| 读取当前指针后的所有内容,列表方式返回#L174 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L174 |
| 关闭释放 -------------------------------------------------#L177 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L177 |
| io_file_next | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_next.py |
| next 读取文件内容#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_next.py#L21 |
| io_file_read | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_read.py |
| read 读取内容#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_read.py#L21 |
| io_file_truncate | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py |
| read 读取内容#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py#L27 |
| read 读取内容#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py#L50 |
| io_file_write | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_write.py |
| io_inner_fun | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_inner_fun.py |
| io_rw | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_rw.py |
| 写文件#L11 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_rw.py#L11 |
| 14_examples_os_dir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir |
| os_access | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_access.py |
| 检验权限模式#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_access.py#L14 |
| os_chdir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chdir.py |
| 切换到目录#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chdir.py#L31 |
| os_chmod | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py |
| 更改权限#L15 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py#L15 |
| 其他用户赋予权限#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py#L51 |
| os_chown | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py |
| 假定 /tmp/foo.txt 文件存在.#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py#L24 |
| linux 查看用户组#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py#L27 |
| os_chroot | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chroot.py |
| 设置根目录为 /tmp#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chroot.py#L25 |
| os_dir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py |
| 改变当前工作目录#L210 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L210 |
| 更改文件所有者#L216 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L216 |
| 改变当前进程的根目录#L219 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L219 |
| 关闭文件描述符#L222 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L222 |
| 关闭所有文件描述符,从 fd_low (包含) 到 fd_high (不包含), 错误会忽略#L231 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L231 |
| 关闭文件#L234 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L234 |
| 复制文件描述符 fd#L238 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L238 |
| 将一个文件描述符 fd 复制到另一个 fd2#L241 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L241 |
| 通过文件描述符改变当前工作目录#L244 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L244 |
| 改变一个文件的访问权限,该文件由参数fd指定,参数mode是Unix下的文件访问权限。#L247 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L247 |
| 修改一个文件的所有权,这个函数修改一个文件的用户ID和用户组ID,该文件由文件描述符fd指定。#L250 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L250 |
| 返回描述终端文件描述符编码的字符串。文件描述符必须附加到终端。 如果设备不是终端,则返回无。#L257 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L257 |
| 打开文件#L262 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L262 |
| 通过文件描述符 fd 创建一个文件对象,并返回这个文件对象#L264 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L264 |
| 返回一个打开的文件的系统配置信息。#L275 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L275 |
| 返回文件描述符fd的状态#L280 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L280 |
| 强制将文件描述符为fd的文件写入硬盘。#L283 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L283 |
| 裁剪文件描述符fd对应的文件, 所以它最大不能超过文件大小。#L286 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L286 |
| 如果文件描述符fd是打开的,同时与tty(-like)设备相连,则返回true, 否则False。#L289 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L289 |
| 返回path指定的文件夹包含的文件或文件夹的名字的列表#L292 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L292 |
| 设置文件描述符 fd当前位置为pos, how方式修改: SEEK_SET 或者 0 设置从文件开始的计算的pos;#L295 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L295 |
| 从开始位置读取字符串#L298 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L298 |
| 递归文件夹创建函数#L304 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L304 |
| 文件夹权限#L306 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L306 |
| os_fchdir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py |
| 切换到目录#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py#L29 |
| 打开文件目录#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py#L34 |
| os_fchmod | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py |
| 打开文件,获取fd#L52 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L52 |
| 设置文件夹 对于 拥有者读、写、执行的权限#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L55 |
| 设置文件夹 只能 读#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L58 |
| 设置所有权限#L61 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L61 |
| os_fchown | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py |
| 打开文件#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py#L31 |
| 设置文件的用户id = 100#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py#L34 |
| os_fpathconf | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py |
| 打开文件#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py#L31 |
| 配置名称列表#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py#L34 |
| os_fstat | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py |
| 打开文件#L44 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L44 |
| 文件gid#L50 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L50 |
| 文件uid#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L53 |
| os_fstatvfs | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py |
| 打开文件#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py#L43 |
| 获取文件描述#L46 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py#L46 |
| os_getcwd | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py |
| 切换目录#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L27 |
| 当前工作目录#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L30 |
| 打开文件夹,文件夹不能用 os.O_RDWR#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L33 |
| 切换工作目录,fd 必须为文件夹#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L36 |
| os_getcwdu | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py |
| 切换工作目录#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L29 |
| 打开文件夹#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L34 |
| 切换工作目录#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L37 |
| os_lchown | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lchown.py |
| 打开文件#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lchown.py#L31 |
| os_link | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_link.py |
| 创建快捷方式链接#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_link.py#L31 |
| os_listdir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_listdir.py |
| os_lstat | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lstat.py |
| os_makedirs | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_makedirs.py |
| 递归创建文件夹#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_makedirs.py#L30 |
| os_mkdir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py |
| 创建文件夹,不能递归创建#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py#L29 |
| 递归创建文件夹#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py#L32 |
| os_readlink | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_readlink.py |
| 创建软连接#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_readlink.py#L30 |
| os_removedirs | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py |
| 列出目录#L28 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py#L28 |
| 递归删除目录#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py#L31 |
| os_rmdir | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py |
| 切换工作目录#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L29 |
| 文件列表#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L32 |
| 该目录不能包含文件或文件夹#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L35 |
| os_sys | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py |
| 进程管理#L11 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py#L11 |
| 打开文件#L136 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py#L136 |
| os_unlink | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py |
| 列举目录#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py#L29 |
| 取消软连接#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py#L32 |
| os_utime | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_utime.py |
| _os_chflags | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_chflags.py |
| 设置路径的标记为数字标记。#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_chflags.py#L14 |
| _os_lchflags | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py |
| 打开文件#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L40 |
| 关闭文件#L44 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L44 |
| 修改文件标记#L47 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L47 |
| _os_lchmod | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchmod.py |
| 打开文件#L53 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchmod.py#L53 |
| 15_examples_os_file | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file |
| os_close | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py |
| 打开文件#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L27 |
| 写入字符串#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L30 |
| 关闭文件#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L33 |
| os_closerange | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py |
| 打开文件#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L36 |
| 写入字符串#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L39 |
| 关闭文件#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L42 |
| os_dup | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py |
| 打开文件#L28 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L28 |
| 复制文件内容#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L31 |
| 写入新文本#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L34 |
| 关闭文件fd、dup_fd#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L37 |
| os_dup2 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py |
| 打开文件#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L31 |
| 写入文件#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L34 |
| 复制文件#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L37 |
| 移动文件指针#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L41 |
| 关闭文件#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L45 |
| os_fdatasync | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py |
| 打开文件#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L30 |
| 写入文件内容#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L33 |
| 同步文件到硬盘,防止文件内容丢失#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L36 |
| 移动文件指针#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L39 |
| 读取文件内容#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L42 |
| os_fdopen | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py |
| 打开文件#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L32 |
| 打开文件fd,获取文件对象; 并且开启写入权限#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L35 |
| 写入新内容#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L40 |
| 移动指针#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L43 |
| 当前位置#L48 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L48 |
| os_file | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py |
| 改变当前工作目录#L212 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L212 |
| 设置路径的标记为数字标记。#L218 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L218 |
| 更改权限#L236 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L236 |
| 更改文件所有者#L268 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L268 |
| 改变当前进程的根目录#L271 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L271 |
| 关闭文件描述符#L274 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L274 |
| 关闭所有文件描述符,从 fd_low (包含) 到 fd_high (不包含), 错误会忽略#L283 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L283 |
| 关闭文件#L286 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L286 |
| 复制文件描述符 fd#L290 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L290 |
| 将一个文件描述符 fd 复制到另一个 fd2#L293 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L293 |
| 通过文件描述符改变当前工作目录#L296 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L296 |
| 改变一个文件的访问权限,该文件由参数fd指定,参数mode是Unix下的文件访问权限。#L299 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L299 |
| 修改一个文件的所有权,这个函数修改一个文件的用户ID和用户组ID,该文件由文件描述符fd指定。#L302 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L302 |
| 返回描述终端文件描述符编码的字符串。文件描述符必须附加到终端。 如果设备不是终端,则返回无。#L309 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L309 |
| 打开文件#L314 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L314 |
| 通过文件描述符 fd 创建一个文件对象,并返回这个文件对象#L316 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L316 |
| 返回一个打开的文件的系统配置信息。#L327 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L327 |
| 返回文件描述符fd的状态#L332 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L332 |
| 强制将文件描述符为fd的文件写入硬盘。#L335 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L335 |
| 裁剪文件描述符fd对应的文件, 所以它最大不能超过文件大小。#L338 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L338 |
| 如果文件描述符fd是打开的,同时与tty(-like)设备相连,则返回true, 否则False。#L341 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L341 |
| 返回path指定的文件夹包含的文件或文件夹的名字的列表#L344 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L344 |
| 设置文件描述符 fd当前位置为pos, how方式修改: SEEK_SET 或者 0 设置从文件开始的计算的pos;#L347 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L347 |
| 从开始位置读取字符串#L350 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L350 |
| 递归文件夹创建函数#L356 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L356 |
| 文件夹权限#L358 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L358 |
| os_fpathconf | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py |
| 打开文件#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py#L32 |
| 最大连接数#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py#L37 |
| os_fsync | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py |
| 打开读取文件#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L30 |
| 写入内容#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L33 |
| 同步文件内容到物理硬盘#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L36 |
| 移动文件指针到最前面#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L39 |
| os_ftruncate | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py |
| 打开文件#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L30 |
| 写入内容#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L33 |
| 截取文件内容#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L36 |
| 移动文件指针#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L39 |
| os_isatty | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py |
| 打开文件#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py#L29 |
| 判断文件与设备相连#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py#L32 |
| os_lseek | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py |
| 打开文件#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L31 |
| 所有 fsync() 方法#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L36 |
| 移动到文件行首#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L41 |
| 移动到文件末尾#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L45 |
| os_major | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_major.py |
| os_makedev | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_makedev.py |
| os_mkfifo | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mkfifo.py |
| 创建文件#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mkfifo.py#L29 |
| os_mknod | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py |
| 创建文件,无后缀#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py#L31 |
| 创建文件#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py#L34 |
| os_open | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_open.py |
| 打开文件#L44 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_open.py#L44 |
| os_openpty | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_openpty.py |
| 打开终端#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_openpty.py#L29 |
| os_pipe | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py |
| 文件描述符 r, w 用于读、写#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py#L31 |
| 获取线程id#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py#L34 |
| os_popen | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_popen.py |
| 执行命令行操作文件系统#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_popen.py#L32 |
| os_read | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py |
| 打开文件#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py#L32 |
| 读取内容#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py#L35 |
| os_remove | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_remove.py |
| 删除文件,不能删除文件夹#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_remove.py#L30 |
| os_rename | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_rename.py |
| 列出目录#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_rename.py#L34 |
| os_renames | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_renames.py |
| os_stat | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_stat.py |
| os_statvfs | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_statvfs.py |
| 文件系统的信息#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_statvfs.py#L41 |
| os_stat_float_times | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_stat_float_times.py |
| os_symlink | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_symlink.py |
| 创建软连接#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_symlink.py#L30 |
| os_tcgetpgrp | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcgetpgrp.py |
| os_tcsetpgrp | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcsetpgrp.py |
| 设置pgrp#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcsetpgrp.py#L19 |
| os_tempnam | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tempnam.py |
| 生成某个文件夹下的带指定前缀的唯一路径#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tempnam.py#L30 |
| os_tmpfile | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpfile.py |
| 创建临时文件#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpfile.py#L30 |
| os_tmpnam | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpnam.py |
| 生成临时路径#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpnam.py#L30 |
| os_ttyname | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ttyname.py |
| os_walk | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_walk.py |
| os_write | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py |
| 打开文件#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L32 |
| 写入字符串#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L35 |
| 输入返回值#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L39 |
| 关闭文件#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L45 |
| 16_examples_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception |
| clean_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py |
| 以上这段代码的问题是,当执行完毕后,文件会保持打开状态,并没有被关闭。#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L51 |
| 关键词 with 语句就可以保证诸如文件之类的对象在使用完之后一定会正确的执行他的清理方法:#L54 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L54 |
| 以上这段代码执行完毕后,就算在处理过程中出问题了,文件 f 总是会关闭#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L58 |
| custom_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/custom_exception.py |
| exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py |
| 多次捕获异常#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py#L37 |
| 这个子句将在try子句没有发生任何异常的时候执行#L52 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py#L52 |
| my_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/my_exception.py |
| raise_exception | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py |
| 抛出异常#L11 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py#L11 |
| 捕获抛出的异常#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py#L14 |
| 17_examples_object | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object |
| class | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py |
| 创建一个‘Student’ Class类#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L25 |
| 实例化类#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L36 |
| 访问属性#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L39 |
| 访问方法#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L43 |
| extend | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py |
| 继承Person 对象#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L29 |
| 继承多个类#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L77 |
| 访问 父类属性#L109 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L109 |
| 私有属性无法方法#L112 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L112 |
| init | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/init.py |
| 创建实例化,init方法被执行#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/init.py#L21 |
| method | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/method.py |
| 私有属性不能访问#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/method.py#L33 |
| overload | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overload.py |
| overwrite | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overwrite.py |
| 继承 Phone#L17 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overwrite.py#L17 |
| private | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py |
| 私有属性无法访问#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L23 |
| 私有方法无法访问#L26 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L26 |
| 公有方法访问私有属性#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L29 |
| 18_examples_standand_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib |
| doctest_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py |
| 运行测试,通过doc的结果和代码运行结果进行比较#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py#L23 |
| TestCase 测试用例#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py#L43 |
| glob_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py |
| 显示方法帮助文档手册#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L14 |
| 搜索当前目录下的*.py后缀的文件#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L20 |
| 搜索路径包含lib字符的文件#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L23 |
| os_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py |
| 显示所有属性和方法#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L16 |
| 显示该包的帮助手册#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L19 |
| 显示某个方法帮助手册#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L22 |
| 切换目录#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L30 |
| 调用系统命令#L33 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L33 |
| 调用系统命令#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L36 |
| random_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py |
| 随机取数组中一个值#L15 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L15 |
| 随机生成一个长度为10的数组#L18 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L18 |
| 产生随机float数#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L21 |
| 随机生成一个小于6的随机数#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L24 |
| 随机生成一个数组#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L27 |
| 随机生成1~10的整数#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L30 |
| re_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py |
| 找到所有匹配的字符#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L13 |
| 转换表达式#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L16 |
| 找到不重复的字符串#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L19 |
| 查找首个匹配的字符串#L28 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L28 |
| 拆分字符串#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L34 |
| 最大分割2个字符串#L38 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L38 |
| shutil_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py |
| 统计使用空间#L17 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L17 |
| 移动目录#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L20 |
| 复制文件#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L23 |
| 复制目录#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L27 |
| 压缩文件#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L30 |
| sys_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py |
| 日志输入输出#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py#L25 |
| 退出#L30 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py#L30 |
| timeit_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py |
| 计算耗时#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py#L16 |
| 执行一段代码 number=2 次#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py#L41 |
| urllib_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py |
| 打开url,读取内容#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L16 |
| 读取300个字符#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L22 |
| 请求状态#L31 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L31 |
| 带参数的请求#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L35 |
| 设置密码的请求方式#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L42 |
| 转换参数进行查询#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L58 |
| 转换参数进行查询#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L65 |
| 代理#L73 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L73 |
| zlib_lib | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py |
| 压缩#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L21 |
| 解压缩#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L25 |
| 加密#L29 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L29 |
| 19_examples_json | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json |
| json_sample | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py |
| Python 字典类型转换为 JSON 对象#L48 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L48 |
| 如果你要处理的是文件而不是字符串,你可以使用 json.dump() 和 json.load() 来编码和解码JSON数据。例如:#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L65 |
| 读取数据#L70 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L70 |
| json_translate | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py |
| 示例:gitmojis.json 和 git-emoji-list.rst 进行读取和转换#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L16 |
| 描述:将gitmojis.json文件中的 emoji、description 属性,#L18 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L18 |
| 读取git-emoji-list.rst文件内容#L26 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L26 |
| 读取gitmojis.json文件内容#L38 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L38 |
| 数据替换#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L58 |
| 20_examples_regex | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex |
| regex | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py |
| match 没有匹配到#L134 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L134 |
| 删除注释#L152 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L152 |
| 移除非数字的内容#L156 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L156 |
| 剃除字母#L160 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L160 |
| 21_examples_socket | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket |
| client | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py |
| 和指定地址、端口的服务器建立链接#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L19 |
| 向服务器发送信息#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L22 |
| 接受服务器消息#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L25 |
| client2 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client2.py |
| server | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py |
| 建立socket对象#L17 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L17 |
| 绑定地址和端口#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L20 |
| 最大建立一个监听#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L22 |
| 客户端链接#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L25 |
| server2 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server2.py |
| sk | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/sk.py |
| socket_client | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_client.py |
| socket_server | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py |
| 创建 socket 对象#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L71 |
| 绑定端口#L78 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L78 |
| 设置最大连接数,超过后排队#L81 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L81 |
| 重复建立链接或发送消息#L84 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L84 |
| 22_examples_email | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email |
| mail_stmp | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/mail_stmp.py |
| 三个参数:第一个为文本内容,第二个 plain 设置文本格式,第三个 utf-8 设置编码#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/mail_stmp.py#L41 |
| send_mail | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py |
| 第三方SMTP服务#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L20 |
| 发送人#L25 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L25 |
| 接收人#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L27 |
| send_mail2 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail2.py |
| send_mail_html | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_html.py |
| send_mail_image | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_image.py |
| send_mail_part | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_part.py |
| 23_examples_thread | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread |
| thread_function | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py |
| 为线程定义一个函数#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py#L27 |
| 创建两个线程#L35 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py#L35 |
| thread_module | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py |
| 创建线程#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L63 |
| 启动新线程#L67 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L67 |
| 等待线程执行完成#L72 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L72 |
| thread_queue | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py |
| 创建线程锁#L75 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L75 |
| 创建线程队列#L77 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L77 |
| 填充队列#L93 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L93 |
| 等待队列清空#L102 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L102 |
| 等待所有线程完成#L108 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L108 |
| thread_schedul | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_schedul.py |
| 定时3秒后运行#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_schedul.py#L21 |
| thread_sync | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py |
| 创建线程锁#L60 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L60 |
| 创建线程#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L63 |
| 启动新线程#L67 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L67 |
| 等待线程执行完成#L71 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L71 |
| 24_examples_db | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db |
| db_call_proc | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L16 |
| 关闭数据库连接#L34 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L34 |
| db_call_proc_params | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L16 |
| 关闭数据库连接#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L32 |
| db_connect | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_connect.py |
| db_create_table | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L16 |
| 使用 execute() 方法执行 SQL,如果表存在则删除#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L19 |
| 使用预处理语句创建表#L22 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L22 |
| 执行创建表语句#L32 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L32 |
| 关闭数据库连接#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L36 |
| db_delete | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L16 |
| 关闭数据库连接#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L37 |
| db_inject | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L16 |
| 关闭数据库连接#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L37 |
| db_insert | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L16 |
| 关闭数据库连接#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L37 |
| db_insert_format | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L16 |
| 关闭数据库连接#L36 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L36 |
| db_insert_many | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L16 |
| 关闭数据库连接#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L39 |
| db_query_all | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py |
| 打开数据库连接#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L20 |
| 使用 cursor() 方法创建一个游标对象 cursor#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L23 |
| 关闭数据库连接#L42 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L42 |
| db_query_cursors | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py |
| 打开数据库连接#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L20 |
| 使用 cursor() 方法创建一个游标对象 cursor#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L23 |
| 关闭数据库连接#L55 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L55 |
| db_query_fetch | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py |
| 打开数据库连接#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L20 |
| 使用 cursor() 方法创建一个游标对象 cursor#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L23 |
| 关闭数据库连接#L54 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L54 |
| db_query_one | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py |
| 打开数据库连接#L20 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L20 |
| 使用 cursor() 方法创建一个游标对象 cursor#L23 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L23 |
| 关闭数据库连接#L41 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L41 |
| db_template | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py |
| 定义上下文管理器,连接后自动关闭连接#L15 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py#L15 |
| 使用模板查询#L39 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py#L39 |
| db_transtion | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py |
| 打开数据库连接#L24 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L24 |
| 使用 cursor() 方法创建一个游标对象 cursor#L27 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L27 |
| 关闭数据库连接#L48 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L48 |
| db_update | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py |
| 打开数据库连接#L13 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L13 |
| 使用 cursor() 方法创建一个游标对象 cursor#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L16 |
| 关闭数据库连接#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L37 |
| 25_examples_shell | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/25_examples_shell |
| shell_cmd | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/25_examples_shell/shell_cmd.py |
| 26_examples_yaml | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml |
| pyYAML | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml/pyyaml_convert.py |
| ruamel_YAML | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml/ruamel_yaml_convert.py |
| 50_samples_varables | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables |
| var_assignment_process | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py |
| 示例:可迭代对象赋值给多个变量#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L14 |
| 统计平均分,去掉最高低分#L19 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L19 |
| 去掉部分数据#L37 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L37 |
| 获取 name、email#L40 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L40 |
| phones 列表类型的,无论phones数据包含几个元素#L45 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L45 |
| 只取最后两个数据#L51 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L51 |
| phones 列表类型的,无论phones数据包含几个元素#L58 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L58 |
| 注意:#L63 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L63 |
| trailing 则是 tuple 元组#L65 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L65 |
| 扩展的迭代解压语法#L74 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L74 |
| 取到第一个元素,作为类型,进行分别处理#L89 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L89 |
| 星号解压语法#L99 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L99 |
| 占位符赋值;解压一部分,丢弃其他(一个或多个)的值#L112 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L112 |
| 简单递归#L121 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L121 |
| var_multi_assignment | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py |
| 示例:多变量赋值#L12 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L12 |
| 描述:唯一的前提就是变量的数量必须跟序列元素的数量是一样的#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L14 |
| 进一步赋值#L43 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L43 |
| 字符串赋值#L54 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L54 |
| 占位符赋值;解压一部分,丢弃其他的值#L66 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L66 |
| 当赋值的变量数量比被赋值的对象数据长度多,将发生异常#L75 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L75 |
| app_generator_copyright | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright |
| generator-copyright | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright/generator-copyright.py |
| 描述:生成 copyright 信息,插入到文件中#L14 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright/generator-copyright.py#L14 |
| app_generator_toc | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc |
| generator-toc | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc/generator-toc.py |
| 描述:生成项目工程的 makedown 格式的 目录索引 TOC 的文档#L16 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc/generator-toc.py#L16 |
| 生成 目录索引 TOC 的文档 工具类#L21 | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc/generator-toc.py#L21 |
| **** | https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master |
|
examples
| https://patch-diff.githubusercontent.com/topics/examples |
|
python3
| https://patch-diff.githubusercontent.com/topics/python3 |
|
python-learning
| https://patch-diff.githubusercontent.com/topics/python-learning |
|
python-examples
| https://patch-diff.githubusercontent.com/topics/python-examples |
|
python-study
| https://patch-diff.githubusercontent.com/topics/python-study |
|
Readme
| https://patch-diff.githubusercontent.com/hooj0/python-examples#readme-ov-file |
| Please reload this page | https://patch-diff.githubusercontent.com/hooj0/python-examples |
|
Activity | https://patch-diff.githubusercontent.com/hooj0/python-examples/activity |
|
0
stars | https://patch-diff.githubusercontent.com/hooj0/python-examples/stargazers |
|
0
watching | https://patch-diff.githubusercontent.com/hooj0/python-examples/watchers |
|
0
forks | https://patch-diff.githubusercontent.com/hooj0/python-examples/forks |
|
Report repository
| https://patch-diff.githubusercontent.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fhooj0%2Fpython-examples&report=hooj0+%28user%29 |
| Releases | https://patch-diff.githubusercontent.com/hooj0/python-examples/releases |
| Packages
0 | https://patch-diff.githubusercontent.com/users/hooj0/packages?repo_name=python-examples |
|
Python
99.6%
| https://patch-diff.githubusercontent.com/hooj0/python-examples/search?l=python |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |