René's URL Explorer Experiment


Title: GitHub - hooj0/python-examples: :art: python 3 study examples

Open Graph Title: GitHub - hooj0/python-examples: :art: python 3 study examples

X Title: GitHub - hooj0/python-examples: :art: python 3 study examples

Description: :art: python 3 study examples. Contribute to hooj0/python-examples development by creating an account on GitHub.

Open Graph Description: :art: python 3 study examples. Contribute to hooj0/python-examples development by creating an account on GitHub.

X Description: :art: python 3 study examples. Contribute to hooj0/python-examples development by creating an account on GitHub.

Opengraph URL: https://github.com/hooj0/python-examples

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:91f39497-b092-c672-2e8f-e9a82e879912
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-idD85A:1E5F68:8EB8F6A:BCA151D:696DFA9E
html-safe-nonce944780eacaedb2366d717c5e6e9829cd1f284fcddf855d221c9f51851a9acaac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODVBOjFFNUY2ODo4RUI4RjZBOkJDQTE1MUQ6Njk2REZBOUUiLCJ2aXNpdG9yX2lkIjoiNTY4MDg5ODk3Mjk4MTI2MzAwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac65b9e69538f67bce339f39d3a31ff8f2239296b1d3b2f575928528f4866f31d1
hovercard-subject-tagrepository:109703888
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location//
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/hooj0/python-examples
twitter:imagehttps://opengraph.githubassets.com/70d61524350d8f287cffc61f78c3a336747e377401289888d551cd726f6e68cf/hooj0/python-examples
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/70d61524350d8f287cffc61f78c3a336747e377401289888d551cd726f6e68cf/hooj0/python-examples
og:image:alt:art: python 3 study examples. Contribute to hooj0/python-examples development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064
turbo-cache-controlno-preview
go-importgithub.com/hooj0/python-examples git https://github.com/hooj0/python-examples.git
octolytics-dimension-user_id28861745
octolytics-dimension-user_loginhooj0
octolytics-dimension-repository_id109703888
octolytics-dimension-repository_nwohooj0/python-examples
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id109703888
octolytics-dimension-repository_network_root_nwohooj0/python-examples
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7e5ae23c70136152637ceee8d6faceb35596ec46
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://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 AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://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
Reloadhttps://patch-diff.githubusercontent.com/hooj0/python-examples
Reloadhttps://patch-diff.githubusercontent.com/hooj0/python-examples
Reloadhttps://patch-diff.githubusercontent.com/hooj0/python-examples
hooj0 https://patch-diff.githubusercontent.com/hooj0
python-exampleshttps://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 pagehttps://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
Brancheshttps://patch-diff.githubusercontent.com/hooj0/python-examples/branches
Tagshttps://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 Commitshttps://patch-diff.githubusercontent.com/hooj0/python-examples/commits/master/
https://patch-diff.githubusercontent.com/hooj0/python-examples/commits/master/
.ideahttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.idea
.ideahttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.idea
.settingshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.settings
.settingshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/.settings
00_examples_helloworldhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/00_examples_helloworld
00_examples_helloworldhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/00_examples_helloworld
01_examples_variablehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/01_examples_variable
01_examples_variablehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/01_examples_variable
02_examples_in_outhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/02_examples_in_out
02_examples_in_outhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/02_examples_in_out
03_examples_stringhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/03_examples_string
03_examples_stringhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/03_examples_string
04_examples_data_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/04_examples_data_type
04_examples_data_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/04_examples_data_type
05_examples_mathhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/05_examples_math
05_examples_mathhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/05_examples_math
06_examples_datetimehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/06_examples_datetime
06_examples_datetimehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/06_examples_datetime
07_examples_data_structhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/07_examples_data_struct
07_examples_data_structhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/07_examples_data_struct
08_examples_if_elsehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/08_examples_if_else
08_examples_if_elsehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/08_examples_if_else
09_examples_loophttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/09_examples_loop
09_examples_loophttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/09_examples_loop
10_examples_funchttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/10_examples_func
10_examples_funchttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/10_examples_func
11_examples_pkg_moduleshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/11_examples_pkg_modules
11_examples_pkg_moduleshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/11_examples_pkg_modules
12_examples_serializationhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/12_examples_serialization
12_examples_serializationhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/12_examples_serialization
13_examples_iohttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/13_examples_io
13_examples_iohttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/13_examples_io
14_examples_os_dirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/14_examples_os_dir
14_examples_os_dirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/14_examples_os_dir
15_examples_os_filehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/15_examples_os_file
15_examples_os_filehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/15_examples_os_file
16_examples_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/16_examples_exception
16_examples_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/16_examples_exception
17_examples_objecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/17_examples_object
17_examples_objecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/17_examples_object
18_examples_standand_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/18_examples_standand_lib
18_examples_standand_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/18_examples_standand_lib
19_examples_jsonhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/19_examples_json
19_examples_jsonhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/19_examples_json
20_examples_regexhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/20_examples_regex
20_examples_regexhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/20_examples_regex
21_examples_sockethttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/21_examples_socket
21_examples_sockethttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/21_examples_socket
22_examples_emailhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/22_examples_email
22_examples_emailhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/22_examples_email
23_examples_threadhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/23_examples_thread
23_examples_threadhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/23_examples_thread
24_examples_dbhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/24_examples_db
24_examples_dbhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/24_examples_db
25_examples_shellhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/25_examples_shell
25_examples_shellhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/25_examples_shell
26_examples_yamlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/26_examples_yaml
26_examples_yamlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/26_examples_yaml
27_examples_templatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/27_examples_template
27_examples_templatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/27_examples_template
28_examples_asynciohttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/28_examples_asyncio
28_examples_asynciohttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/28_examples_asyncio
29_examples_asyncio_advancedhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/29_examples_asyncio_advanced
29_examples_asyncio_advancedhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/29_examples_asyncio_advanced
30_examples_process_barhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/30_examples_process_bar
30_examples_process_barhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/30_examples_process_bar
31_examples_requestshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/31_examples_requests
31_examples_requestshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/31_examples_requests
32_examples_excelhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/32_examples_excel
32_examples_excelhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/32_examples_excel
33_examples_sign_xmlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/33_examples_sign_xml
33_examples_sign_xmlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/33_examples_sign_xml
34_examples_marshmallow_dataclasshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/34_examples_marshmallow_dataclass
34_examples_marshmallow_dataclasshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/34_examples_marshmallow_dataclass
50_samples_varableshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/50_samples_varables
50_samples_varableshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/50_samples_varables
app_generator_copyrighthttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_copyright
app_generator_copyrighthttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_copyright
app_generator_sql_dochttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_sql_doc
app_generator_sql_dochttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_sql_doc
app_generator_tochttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_toc
app_generator_tochttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_generator_toc
app_mini_toolshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_mini_tools
app_mini_toolshttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_mini_tools
app_webhookhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_webhook
app_webhookhttps://patch-diff.githubusercontent.com/hooj0/python-examples/tree/master/app_webhook
.gitignorehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.gitignore
.gitignorehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.gitignore
.projecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.project
.projecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.project
.pydevprojecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.pydevproject
.pydevprojecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/.pydevproject
commenthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/comment
commenthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/comment
readme.mdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/readme.md
readme.mdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/readme.md
tutorial.mdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/tutorial.md
tutorial.mdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/tutorial.md
READMEhttps://patch-diff.githubusercontent.com/hooj0/python-examples
00_examples_helloworldhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/00_examples_helloworld
hello_worldhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/00_examples_helloworld/hello_world.py
01_examples_variablehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable
variableshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py
variable 变量#L12https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L12
描述:变量是存储任何类型数据的一种媒介#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L14
del var 删除变量#L17https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L17
a = b = c = 1 多个变量赋值#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L19
变量 用大小写字母、_、数字进行表示,且不能用 数字开头#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L22
纯小写字符变量#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L27
不能以数字开头#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L31
大小写混合变量#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L35
带_组合变量#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L39
带_和数字、字母组合变量#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L43
_ 下划线开头变量#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L47
常量,由全大写字符串和下划线、数字组成#L56https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L56
删除变量#L61https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L61
多个变量赋值#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/01_examples_variable/variables.py#L65
02_examples_in_outhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out
io_inputhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py
input 接收输入参数,可以输入文本#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L20
变量接收输入参数#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L24
输入之前可以打印输入提示文本#L28https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_input.py#L28
io_printhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py
直接输入内容#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L22
中间的 “,” 会用空格进行输出,相当于是拼接字符串#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L24
"\n" 就是换行#L26https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L26
多个字符串拼接输出#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L31
传递数字或变量#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L36
设置分隔符,默认的是‘ ’空格;设置结束符号,默认是 '\n'#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L39
设置打印内容输出流,默认是 sys.stdout,输出到屏幕控制台;#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/02_examples_in_out/io_print.py#L43
03_examples_stringhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string
str_escapehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py
转义字符、多行输出#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L45
字符转义#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L47
r"..." 表示字符串原样输出,忽略特殊字符#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L51
多行输出 '''......''' 中间可以进行换行#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L55
\ 进行续行, 当一行不够显示,要换行而又不进行拼接#L67https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L67
加号拼接#L72https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L72
相邻字符在同一行也可以拼接#L76https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L76
u'......' 表示Unicode编码字符串#L80https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_escape.py#L80
str_fmt_funchttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py
字符串输出#L26https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L26
表达式输出#L38https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L38
格式化输出#L56https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_fmt_func.py#L56
str_formathttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py
在八进制数前面显示零('0'),在十六进制前面显示'0x'或者'0X'(取决于用的是'x'还是'X')#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L32
% 用来格式化字符串的#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L42
%d 用来格式化参:整数#L44https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L44
%x 用来格式化参:十六进制数#L46https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L46
% 字符串替换传参, 格式化#L49https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L49
多个字符串用 % (参数1,参数2...)#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L51
%d 进行整数格式化操作#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L55
%2d 表示前面补空字符串 2个;%15d 表示补空格15个#L57https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L57
%f 浮点数格式化,可以进行小数位的保留#L64https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L64
%.f 不保留小数#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L68
%.2f 保留2位小数#L70https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L70
%x 十六进制#L78https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L78
%s 会进行数学转换到十进制#L81https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L81
%%进行百分号转义#L84https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L84
* 定义宽度或者小数点精度#L89https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L89
在正数前面显示加号( + )#L92https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L92
在正数前面显示空格#L94https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L94
0 显示的数字前面填充'0'而不是默认的空格#L96https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L96
混合模式#L106https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L106
小数格式化#L115https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L115
d 针对整数类型, {n:size} size代表空格宽度#L118https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L118
访问字典值,结合索引和key进行访问#L124https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L124
直接用key访问字典,** 参数转换#L127https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_format.py#L127
str_functionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py
chr() 可以将ASCII数字转换为字符串#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L42
ord() 可以将字符串转换为ASCII的值#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L45
encode 可以进行字符串编码#L48https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L48
b 表示byte字符串#L54https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L54
len 字符串长度#L59https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L59
字符串重复出现: str * int#L66https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L66
字符串拼接,字符串不能和非字符串拼接#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L68
取字符串中特定字符#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L71
字符串分片切块: str[头下标:尾下标] 不包含尾下标元素#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L77
默认的分切索引很有用:默认的第一个索引为零,第二个索引默认为字符串可以被分切的长度#L93https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L93
不输出起始位置,默认是0#L96https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L96
全部字符串#L98https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L98
规律#L100https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L100
in / not in 成员运算#L104https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function.py#L104
str_function_innerhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py
string.capitalize() 把字符串的第一个字符大写#L62https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L62
返回一个原字符串居中,并使用空格填充至长度 width 的新字符串#L67https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L67
返回 str 在 string 里面出现的次数,如果 beg 或者 end 指定则返回指定范围内 str 出现的次数#L72https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L72
以 encoding 指定的编码格式编码 string,如果出错默认报一个ValueError 的异常,除非 errors 指定的是'ignore'或者'replace'#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L77
以 encoding 指定的编码格式解码 string,如果出错默认报一个 ValueError 的 异 常 , 除 非 errors 指 定 的 是 'ignore' 或 者'replace'#L81https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L81
检查字符串是否以 obj 结束,如果beg 或者 end 指定则检查指定的范围内是否以 obj 结束,如果是,返回 True,否则返回 False.#L85https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L85
把字符串 string 中的 tab 符号转为空格,默认的空格数 tabsize 是 8.#L91https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L91
检测 str 是否包含在 string 中,如果 beg 和 end 指定范围,则检查是否包含在指定范围内,如果是返回开始的索引值,否则返回-1#L95https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L95
跟find()方法一样,只不过如果str不在 string中会报一个异常.#L100https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L100
如果 string 所有字符都是字母或数字则返回 True,否则返回 False#L105https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L105
如果 string 至少有一个字符并且所有字符都是字母则返回 True,否则返回 False#L111https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L111
如果 string 只包含十进制数字则返回 True 否则返回 False.#L116https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L116
如果 string 只包含数字则返回 True 否则返回 False.#L121https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L121
如果 string 都是小写,则返回 True,否则返回 False#L126https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L126
如果 string 中只包含数字字符,则返回 True,否则返回 False#L133https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L133
如果 string 中只包含空格,则返回 True,否则返回 False.#L138https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L138
如果 string 是单词形式,首字母大写,其他小写。则返回 True,否则返回 False#L144https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L144
如果 string 中包含至少一个区分大小写的字符,并且所有这些(区分大小写的)字符都是大写,则返回 True,否则返回 False#L150https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L150
Merges (concatenates)以 string 作为分隔符,将 seq 中所有的元素(的字符串表示)合并为一个新的字符串#L156https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L156
返回一个原字符串左对齐,并使用空格填充至长度 width 的新字符串#L162https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L162
转换 string 中所有大写字符为小写.#L167https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L167
截掉 string 左边的空格#L171https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L171
第一个参数是字符串,表示需要转换的字符,第二个参数也是字符串表示转换的目标。#L176https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L176
返回字符串 str 中最大的字母。#L185https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L185
返回字符串 str 中最小的字母。#L189https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L189
有点像 find()和 split()的结合体,从 str 出现的第一个位置起,#L193https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L193
如果 string 中不包含str 则 string_pre_str == string.#L195https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L195
把 string 中的 str1 替换成 str2,如果 num 指定,则替换不超过 num 次.#L200https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L200
类似于 find()函数,不过是从右边开始查找.#L206https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L206
类似于 index(),不过是从右边开始.#L212https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L212
返回一个原字符串右对齐,并使用空格填充至长度 width 的新字符串#L218https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L218
类似于 partition()函数,不过是从右边开始查找.#L222https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L222
删除 string 字符串末尾的空格.#L227https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L227
以 str 为分隔符切片 string,如果 num有指定值,则仅分隔 num 个子字符串#L231https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L231
按照行分隔,返回一个包含各行作为元素的列表,如果 num 指定则仅切片 num 个行.#L237https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L237
检查字符串是否是以 obj 开头,是则返回 True,否则返回 False。如果beg 和 end 指定值,则在指定范围内检查.#L241https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L241
在 string 上执行 lstrip()和 rstrip()#L246https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L246
翻转 string 中的大小写#L250https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L250
返回"标题化"的 string,就是说所有单词都是以大写开始,其余字母均为小写(见 istitle())#L254https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L254
string.upper() 转换 string 中的小写字母为大写#L258https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L258
返回长度为 width 的字符串,原字符串 string 右对齐,前面填充0#L262https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/03_examples_string/str_function_inner.py#L262
04_examples_data_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type
cast_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py
int类型转换#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L31
float类型转换#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L36
complex 复数转换#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L40
字符串转换#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L43
表达式转换#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L47
元组转换#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L50
list 列表转换#L54https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L54
set 集合转换#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L58
dict字典转换#L62https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L62
整数转字符#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L65
字符转整数#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L68
整数转16进制字符串#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L71
整数转8进制#L75https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L75
类型转换#L79https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/cast_type.py#L79
data_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py
整数类型#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L33
十六进制 ox前缀开头, 0-9/a-f 表示#L38https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L38
长整数 是比较大的整数#L52https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L52
浮点型#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L55
E1小数点向后移动 1 位#L59https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L59
E2小数点向后移动 2 位#L61https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L61
E3小数点向后移动 3 位#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L63
浮点型 4 + 2 位小数#L69https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L69
浮点型 6位小数#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L71
2 位小数#L73https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L73
字符串#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L77
布尔值#L86https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L86
空值#L104https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L104
复数#L110https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/data_type.py#L110
object_typehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/04_examples_data_type/object_type.py
05_examples_mathhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math
math_functionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py
绝对值 abs#L62https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L62
上入整数#L67https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L67
下舍整数#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L71
返回e的x次幂(ex)#L76https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L76
返回数字的绝对值#L79https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L79
将一个浮点数的整数和小数进行拆分#L97https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L97
乘方#L101https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L101
round 四舍五入#L105https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L105
保留2位小数#L110https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L110
保留3位小数#L112https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L112
3位小数#L114https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L114
sqrt 求平方根#L117https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L117
从序列的元素中随机挑选一个元素#L122https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L122
从指定范围内,按指定基数递增的集合中获取一个随机数,基数缺省值为1#L127https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L127
0,1)范围内。#L134https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L134
改变随机数生成器的种子seed。如果你不了解其原理,你不必特别去设定seed,Python会帮你选择seed。#L139https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L139
将序列的所有元素随机排序#L142https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L142
随机生成下一个实数,它在[x,y]范围内。#L152https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L152
返回的x弧度的正弦值。#L157https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L157
返回x的反余弦弧度值。#L162https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L162
返回x的反正弦弧度值。#L164https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L164
返回x弧度的正切值。#L166https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L166
返回x的弧度的余弦值。#L168https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L168
返回x的反正切弧度值。#L170https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L170
返回给定的 X 及 Y 坐标值的反正切值。#L172https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L172
返回欧几里德范数 sqrt(xx + yy)。#L174https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L174
将弧度转换为角度,如degrees(math.pi/2) , 返回90.0#L176https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L176
将角度转换为弧度#L178https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_function.py#L178
math_operatorhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py
加法运算#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L63
减法运算#L69https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L69
乘法运算#L75https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L75
乘方#L80https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L80
除法运算#L85https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L85
除法取整数#L91https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L91
取模运算,余数#L97https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L97
赋值操作#L102https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L102
位运算符#L126https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L126
按位与运算符#L175https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L175
按位或运算符#L177https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L177
按位异或运算符#L179https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L179
按位取反运算符#L181https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L181
左移动运算符#L184https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L184
右移动运算符#L186https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/05_examples_math/math_operator.py#L186
06_examples_datetimehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime
date_calendarhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py
返回一个多行字符串格式的year年month月日历#L46https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L46
w 是每天之间宽度,l是每天之间高度#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L51
一年的日历,c 表示每个月日历之前的宽度间距#L56https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L56
当前每周起始日期的设置。默认情况下,首次载入caendar模块时返回0,即星期一#L61https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L61
是否闰年#L64https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L64
返回两年之间闰月数量#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L68
返回这个月的日历的二维数组#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L71
直接打印日历,相当于 prin(calendar.calendar(year,w,l,c))#L74https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L74
返回当前月的最开始日期的前一天的星期和当前月日期的最后一天#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L77
打印某个月的日历,相当于 print calendar.calendar(year,w,l,c)#L82https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L82
返回当前日期秒数#L85https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L85
设置每周的起始日期码#L88https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L88
返回星期几#L91https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_calendar.py#L91
date_timehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py
时间戳#L180https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L180
当前时间,t.tm_isdst可取0或1,取决于当地当时是不是夏令时#L187https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L187
可读时间#L192https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L192
格式化时间#L197https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L197
字符串转时间#L202https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L202
字符格式化成时间#L208https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L208
时区#L213https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L213
休眠时间#L216https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L216
用以浮点数计算的秒数返回当前的CPU时间#L221https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L221
返回每次运行的时间#L231https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L231
当前时间;未给参数相当于asctime()#L238https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L238
指定某个时间,传秒数;相当于asctime(localtime(secs))#L240https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L240
接收时间戳,返回格林时间,t.tm_isdst始终为0#L243https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/06_examples_datetime/date_time.py#L243
07_examples_data_structhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct
data_structhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py
将列表当做堆栈使用,结合append、pop方法,达到先进后出的目的#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L24
将列表当作队列使用#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L35
添加到最前面#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L39
弹出最前面的#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L43
弹出最后面的#L46https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L46
添加到最前面#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L50
列表推导式#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L55
调用一些方法#L61https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L61
过滤#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L65
循环嵌套#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L68
元组和序列#L90https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L90
集合:可以用大括号({})创建集合。注意:如果要创建一个空集合,你必须用 set() 而不是 {} ;后者创建一个空的字典#L98https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L98
集合也支持推导式#L102https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L102
遍历技巧#L112https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L112
遍历字典结构,在字典中遍历时,关键字和对应的值可以使用 items() 方法同时解读出来#L114https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L114
在序列中遍历时,索引位置和对应值可以使用 enumerate() 函数同时得到#L118https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L118
同时遍历两个或更多的序列,可以使用 zip() 组合:#L125https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/data_struct.py#L125
dicthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py
构造一个dict 数据字典#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L45
构造dict 方法2,用列表List 嵌套 元组#L49https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L49
构造dict 方法3,有点像属性和值的对应#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L53
构造dict 动态方法#L57https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L57
通过get去获取key值#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L63
也可以通过 obj['xxx'] 这种形式取值,类似JavaScript中的对象取值#L66https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L66
处理不存在的key#L70https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L70
不存在#L81https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L81
通过get 方法,设置默认值。如果存在就返回值,不存在就返回默认值 = None#L84https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L84
设置不存在的时候,默认值为 empty#L86https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L86
设置值#L90https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L90
删除元素#L100https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L100
删除元素,和JavaScript类似#L104https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L104
返回所有key#L109https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L109
返回所有value#L112https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L112
将value转换list#L115https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L115
排序#L118https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L118
清空字典#L124https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L124
字典浅拷贝#L141https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L141
创建一个字典对象,key值为seq对象,value为None#L146https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L146
创建一个字典对象,key值为seq对象,value为2#L149https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L149
将存在键值的字典N更新到字典tmp#L154https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L154
返回可以直接遍历键值对#L159https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/dict.py#L159
iterhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py
iter 构造迭代器#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L29
next下一个元素#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L32
循环遍历#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L37
循环遍历#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/iter.py#L43
listhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py
创建一个list#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L53
len() 获取list长度#L57https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L57
通过索引、下标 访问;索引从0开始#L60https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L60
当索引越界超出长度就会出现错误#L64https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L64
append 添加新的元素#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L71
insert 插入元素到指定索引位置#L75https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L75
当索引比长度还大时,元素会添加到末尾#L78https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L78
对已知存在的元素进行赋值#L83https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L83
pop 删除末尾的元素#L87https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L87
删除指定索引位置的元素 pop(index)#L89https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L89
删除指定索引位置的元素#L93https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L93
不同类型的元素的list#L97https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L97
list 进行叠加,会出现并集结果#L103https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L103
list[index-start, index-end] 对列表进行分片处理,同字符串分片一样,不包含截止下标的元素#L108https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L108
从3开始,到最后#L113https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L113
输出全部元素#L115https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L115
删除某个区间的元素#L118https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L118
在指定区间插入值,如果区间有元素将被覆盖#L123https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L123
判断list中是否存在某个元素#L127https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L127
list 进行排序#L131https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L131
倒序#L136https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L136
清空元素#L143https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L143
删除对象list#L148https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L148
复制#L152https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L152
元素出现次数#L160https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L160
元素首次出现的下标#L162https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L162
最大元素和最小元素#L167https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L167
继承某个list集合,相当于两个集合进行拼接#L171https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/list.py#L171
rangehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py
range 序列#L12https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L12
生成指定截止区间的整数集合#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L25
生成指定区间,带有起始位置的序列集合#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L32
生成指定区间,带有起始位置,并且有步长的序列集合#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/range.py#L39
sethttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py
构造 set,通过set(iterable)方法构造,参数是一个iterable集合#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L32
添加元素 add,通过add方法添加新元素#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L43
删除元素#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L47
清空所有元素#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L51
求numbers1、numbers2的交集#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L58
字符串直接被构建成set#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/set.py#L65
tuplehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py
tuple 和 list 雷同,但是它创建数据后不能随意修改#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L36
构建元组#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L40
取值方法,用索引下标的方式#L49https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L49
分片获取数据#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L53
定义一个元素的tuple, 必须带一个 逗号,不然python不知道是否是运算操作#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L58
并集#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L68
删除对象#L73https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L73
元组的长度#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L77
复制#L80https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L80
判断元素是否存在元组中#L83https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L83
循环遍历#L87https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/07_examples_data_struct/tuple.py#L87
08_examples_if_elsehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else
if_elif_elsehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py
条件语句#L12https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L12
相反,则为True#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L63
if elif else 语句#L90https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L90
客户端输入参数进行if判断#L101https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L101
逻辑运算符#L113https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L113
成员运算#L142https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L142
身份运算, id() 指向内存地址#L150https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L150
三元运算#L180https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/08_examples_if_else/if_elif_else.py#L180
09_examples_loophttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop
for_whilehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py
for 循环#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L30
通过下标进行迭代循环#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L35
range 序列函数,range可以生成一个指定区间的list集合#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L40
正常结束会被执行,break中断的不被执行#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L53
while 循环#L73https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L73
continue continue后的语句不被执行,正常结束else被执行#L91https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L91
站位,不做任何事情#L101https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/09_examples_loop/for_while.py#L101
10_examples_funchttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func
functionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py
定义函数(必备参数)#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L37
执行函数#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L41
带返回值的函数#L44https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L44
函数变量作用域#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L50
内部的赋值不会影响外部#L59https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L59
缺省参数(age/sex/address 为缺省参数)#L64https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L64
get_user() name为必传参数#L68https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L68
函数返回值(命名参数)#L76https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L76
可变参数(不定长参数)#L96https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L96
可变参数(不定长参数) kw key-value 参数#L107https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L107
按引用传递参数,传入list值,发现方法里面对list进行操作会影响外部定义的变量#L118https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L118
lambda 来创建匿名函数#L129https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/10_examples_func/function.py#L129
11_examples_pkg_modules/moduleshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules
modulehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py
import sys引入python标准库中的sys.py模块;这是引入某一模块的方法#L11https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L11
导入模块#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L13
导入模块中的方法#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L16
导入时,会允许模块中的if代码块#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L19
sys.argv是一个包含命令行参数的列表#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L29
sys.path包含了一个Python解释器自动查找所需模块的路径的列表#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L33
定义自定义模块,并导入使用其中定义的方法#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L36
定义一个变量,接收模块方法#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L39
调用模块中的方法#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L43
输出模块中的变量#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L47
输出当前模块主程序函数名称#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L50
查看一个模块里的方法和全局变量#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L55
列举当前模块的方法、变量、以及导入的模块和变量#L60https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module.py#L60
module_centerhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/module_center.py
using_namehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py
一个模块被另一个程序第一次引入时,其主程序将运行。#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py#L13
说明: 每个模块都有一个__name__属性,当其值是'main'时,表明该模块自身在运行,否则是被引入#L15https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/modules/using_name.py#L15
11_examples_pkg_modules/packages/core/fileshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files
ahttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/a.py
bhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/b.py
chttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/c.py
dhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/files/d.py
filehttps://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/filtershttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/filters
filterhttps://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/parserhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/core/parser
parserhttps://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/corehttps://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/packageshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages
runhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py
导入包名#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L24
必须全名访问,packages.flie.method()#L26https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L26
导入包和模块#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L31
名称会简短#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L33
直接导入方法和变量#L38https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L38
使用导入的方法和变量#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L40
导入后使用短名称#L46https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L46
必须全名访问,packages.flie.method()#L48https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L48
由于 init的package文件中没有定义 d.py 所以导入的时候,d.py不被导入#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/packages/run.py#L53
11_examples_pkg_moduleshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules
runhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/11_examples_pkg_modules/run.py
12_examples_serializationhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization
io_serializationhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py
序列化----------------------------------------#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L24
反序列化--------------------------------------#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L32
加载序列化的数据#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L35
格式化输出反序列数据#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L39
加载数据#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L43
格式化输出反序列数据#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/12_examples_serialization/io_serialization.py#L47
13_examples_iohttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io
io_filehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py
打开文件-----------------------------------------------------#L111https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L111
打开一个文件,文件不存发生在异常#L113https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L113
默认mode = r,w 是写入模式,并且指针移动到文件头部会清空里面的内容#L117https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L117
创建新文件并打开写入,文件已存在会发生异常#L121https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L121
打开文件并追加内容,不存在会自动创建#L125https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L125
读写模式,文件不存发生在异常#L129https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L129
二进制模式,组合使用 读二进制、写二进制#L133https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L133
文本模式#L137https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L137
创建新文件--------------------------------------------------#L142https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L142
写文件 -----------------------------------------------------#L146https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L146
其他非字符串内容需要转换#L154https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L154
读文件 -----------------------------------------------------#L157https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L157
读取所有内容#L160https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L160
取得文件指针位置#L163https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L163
移动指针位置#L166https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L166
读取一行#L171https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L171
读取当前指针后的所有内容,列表方式返回#L174https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L174
关闭释放 -------------------------------------------------#L177https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file.py#L177
io_file_nexthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_next.py
next 读取文件内容#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_next.py#L21
io_file_readhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_read.py
read 读取内容#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_read.py#L21
io_file_truncatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py
read 读取内容#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py#L27
read 读取内容#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_truncate.py#L50
io_file_writehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_file_write.py
io_inner_funhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_inner_fun.py
io_rwhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_rw.py
写文件#L11https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/13_examples_io/io_rw.py#L11
14_examples_os_dirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir
os_accesshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_access.py
检验权限模式#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_access.py#L14
os_chdirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chdir.py
切换到目录#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chdir.py#L31
os_chmodhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py
更改权限#L15https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py#L15
其他用户赋予权限#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chmod.py#L51
os_chownhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py
假定 /tmp/foo.txt 文件存在.#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py#L24
linux 查看用户组#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chown.py#L27
os_chroothttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chroot.py
设置根目录为 /tmp#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_chroot.py#L25
os_dirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py
改变当前工作目录#L210https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L210
更改文件所有者#L216https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L216
改变当前进程的根目录#L219https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L219
关闭文件描述符#L222https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L222
关闭所有文件描述符,从 fd_low (包含) 到 fd_high (不包含), 错误会忽略#L231https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L231
关闭文件#L234https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L234
复制文件描述符 fd#L238https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L238
将一个文件描述符 fd 复制到另一个 fd2#L241https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L241
通过文件描述符改变当前工作目录#L244https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L244
改变一个文件的访问权限,该文件由参数fd指定,参数mode是Unix下的文件访问权限。#L247https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L247
修改一个文件的所有权,这个函数修改一个文件的用户ID和用户组ID,该文件由文件描述符fd指定。#L250https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L250
返回描述终端文件描述符编码的字符串。文件描述符必须附加到终端。 如果设备不是终端,则返回无。#L257https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L257
打开文件#L262https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L262
通过文件描述符 fd 创建一个文件对象,并返回这个文件对象#L264https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L264
返回一个打开的文件的系统配置信息。#L275https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L275
返回文件描述符fd的状态#L280https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L280
强制将文件描述符为fd的文件写入硬盘。#L283https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L283
裁剪文件描述符fd对应的文件, 所以它最大不能超过文件大小。#L286https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L286
如果文件描述符fd是打开的,同时与tty(-like)设备相连,则返回true, 否则False。#L289https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L289
返回path指定的文件夹包含的文件或文件夹的名字的列表#L292https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L292
设置文件描述符 fd当前位置为pos, how方式修改: SEEK_SET 或者 0 设置从文件开始的计算的pos;#L295https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L295
从开始位置读取字符串#L298https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L298
递归文件夹创建函数#L304https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L304
文件夹权限#L306https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_dir.py#L306
os_fchdirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py
切换到目录#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py#L29
打开文件目录#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchdir.py#L34
os_fchmodhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py
打开文件,获取fd#L52https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L52
设置文件夹 对于 拥有者读、写、执行的权限#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L55
设置文件夹 只能 读#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L58
设置所有权限#L61https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchmod.py#L61
os_fchownhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py
打开文件#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py#L31
设置文件的用户id = 100#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fchown.py#L34
os_fpathconfhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py
打开文件#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py#L31
配置名称列表#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fpathconf.py#L34
os_fstathttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py
打开文件#L44https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L44
文件gid#L50https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L50
文件uid#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstat.py#L53
os_fstatvfshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py
打开文件#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py#L43
获取文件描述#L46https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_fstatvfs.py#L46
os_getcwdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py
切换目录#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L27
当前工作目录#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L30
打开文件夹,文件夹不能用 os.O_RDWR#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L33
切换工作目录,fd 必须为文件夹#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwd.py#L36
os_getcwduhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py
切换工作目录#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L29
打开文件夹#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L34
切换工作目录#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_getcwdu.py#L37
os_lchownhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lchown.py
打开文件#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lchown.py#L31
os_linkhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_link.py
创建快捷方式链接#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_link.py#L31
os_listdirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_listdir.py
os_lstathttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_lstat.py
os_makedirshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_makedirs.py
递归创建文件夹#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_makedirs.py#L30
os_mkdirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py
创建文件夹,不能递归创建#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py#L29
递归创建文件夹#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_mkdir.py#L32
os_readlinkhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_readlink.py
创建软连接#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_readlink.py#L30
os_removedirshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py
列出目录#L28https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py#L28
递归删除目录#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_removedirs.py#L31
os_rmdirhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py
切换工作目录#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L29
文件列表#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L32
该目录不能包含文件或文件夹#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_rmdir.py#L35
os_syshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py
进程管理#L11https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py#L11
打开文件#L136https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_sys.py#L136
os_unlinkhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py
列举目录#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py#L29
取消软连接#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_unlink.py#L32
os_utimehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/os_utime.py
_os_chflagshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_chflags.py
设置路径的标记为数字标记。#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_chflags.py#L14
_os_lchflagshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py
打开文件#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L40
关闭文件#L44https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L44
修改文件标记#L47https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchflags.py#L47
_os_lchmodhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchmod.py
打开文件#L53https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/14_examples_os_dir/_os_lchmod.py#L53
15_examples_os_filehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file
os_closehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py
打开文件#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L27
写入字符串#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L30
关闭文件#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_close.py#L33
os_closerangehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py
打开文件#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L36
写入字符串#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L39
关闭文件#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_closerange.py#L42
os_duphttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py
打开文件#L28https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L28
复制文件内容#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L31
写入新文本#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L34
关闭文件fd、dup_fd#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup.py#L37
os_dup2https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py
打开文件#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L31
写入文件#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L34
复制文件#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L37
移动文件指针#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L41
关闭文件#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_dup2.py#L45
os_fdatasynchttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py
打开文件#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L30
写入文件内容#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L33
同步文件到硬盘,防止文件内容丢失#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L36
移动文件指针#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L39
读取文件内容#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdatasync.py#L42
os_fdopenhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py
打开文件#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L32
打开文件fd,获取文件对象; 并且开启写入权限#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L35
写入新内容#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L40
移动指针#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L43
当前位置#L48https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fdopen.py#L48
os_filehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py
改变当前工作目录#L212https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L212
设置路径的标记为数字标记。#L218https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L218
更改权限#L236https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L236
更改文件所有者#L268https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L268
改变当前进程的根目录#L271https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L271
关闭文件描述符#L274https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L274
关闭所有文件描述符,从 fd_low (包含) 到 fd_high (不包含), 错误会忽略#L283https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L283
关闭文件#L286https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L286
复制文件描述符 fd#L290https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L290
将一个文件描述符 fd 复制到另一个 fd2#L293https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L293
通过文件描述符改变当前工作目录#L296https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L296
改变一个文件的访问权限,该文件由参数fd指定,参数mode是Unix下的文件访问权限。#L299https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L299
修改一个文件的所有权,这个函数修改一个文件的用户ID和用户组ID,该文件由文件描述符fd指定。#L302https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L302
返回描述终端文件描述符编码的字符串。文件描述符必须附加到终端。 如果设备不是终端,则返回无。#L309https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L309
打开文件#L314https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L314
通过文件描述符 fd 创建一个文件对象,并返回这个文件对象#L316https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L316
返回一个打开的文件的系统配置信息。#L327https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L327
返回文件描述符fd的状态#L332https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L332
强制将文件描述符为fd的文件写入硬盘。#L335https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L335
裁剪文件描述符fd对应的文件, 所以它最大不能超过文件大小。#L338https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L338
如果文件描述符fd是打开的,同时与tty(-like)设备相连,则返回true, 否则False。#L341https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L341
返回path指定的文件夹包含的文件或文件夹的名字的列表#L344https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L344
设置文件描述符 fd当前位置为pos, how方式修改: SEEK_SET 或者 0 设置从文件开始的计算的pos;#L347https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L347
从开始位置读取字符串#L350https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L350
递归文件夹创建函数#L356https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L356
文件夹权限#L358https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_file.py#L358
os_fpathconfhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py
打开文件#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py#L32
最大连接数#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fpathconf.py#L37
os_fsynchttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py
打开读取文件#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L30
写入内容#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L33
同步文件内容到物理硬盘#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L36
移动文件指针到最前面#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_fsync.py#L39
os_ftruncatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py
打开文件#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L30
写入内容#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L33
截取文件内容#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L36
移动文件指针#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ftruncate.py#L39
os_isattyhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py
打开文件#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py#L29
判断文件与设备相连#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_isatty.py#L32
os_lseekhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py
打开文件#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L31
所有 fsync() 方法#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L36
移动到文件行首#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L41
移动到文件末尾#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_lseek.py#L45
os_majorhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_major.py
os_makedevhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_makedev.py
os_mkfifohttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mkfifo.py
创建文件#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mkfifo.py#L29
os_mknodhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py
创建文件,无后缀#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py#L31
创建文件#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_mknod.py#L34
os_openhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_open.py
打开文件#L44https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_open.py#L44
os_openptyhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_openpty.py
打开终端#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_openpty.py#L29
os_pipehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py
文件描述符 r, w 用于读、写#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py#L31
获取线程id#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_pipe.py#L34
os_popenhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_popen.py
执行命令行操作文件系统#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_popen.py#L32
os_readhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py
打开文件#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py#L32
读取内容#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_read.py#L35
os_removehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_remove.py
删除文件,不能删除文件夹#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_remove.py#L30
os_renamehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_rename.py
列出目录#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_rename.py#L34
os_renameshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_renames.py
os_stathttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_stat.py
os_statvfshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_statvfs.py
文件系统的信息#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_statvfs.py#L41
os_stat_float_timeshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_stat_float_times.py
os_symlinkhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_symlink.py
创建软连接#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_symlink.py#L30
os_tcgetpgrphttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcgetpgrp.py
os_tcsetpgrphttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcsetpgrp.py
设置pgrp#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tcsetpgrp.py#L19
os_tempnamhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tempnam.py
生成某个文件夹下的带指定前缀的唯一路径#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tempnam.py#L30
os_tmpfilehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpfile.py
创建临时文件#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpfile.py#L30
os_tmpnamhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpnam.py
生成临时路径#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_tmpnam.py#L30
os_ttynamehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_ttyname.py
os_walkhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_walk.py
os_writehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py
打开文件#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L32
写入字符串#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L35
输入返回值#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L39
关闭文件#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/15_examples_os_file/os_write.py#L45
16_examples_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception
clean_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py
以上这段代码的问题是,当执行完毕后,文件会保持打开状态,并没有被关闭。#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L51
关键词 with 语句就可以保证诸如文件之类的对象在使用完之后一定会正确的执行他的清理方法:#L54https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L54
以上这段代码执行完毕后,就算在处理过程中出问题了,文件 f 总是会关闭#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/clean_exception.py#L58
custom_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/custom_exception.py
exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py
多次捕获异常#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py#L37
这个子句将在try子句没有发生任何异常的时候执行#L52https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/exception.py#L52
my_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/my_exception.py
raise_exceptionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py
抛出异常#L11https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py#L11
捕获抛出的异常#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/16_examples_exception/raise_exception.py#L14
17_examples_objecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object
classhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py
创建一个‘Student’ Class类#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L25
实例化类#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L36
访问属性#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L39
访问方法#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/class.py#L43
extendhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py
继承Person 对象#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L29
继承多个类#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L77
访问 父类属性#L109https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L109
私有属性无法方法#L112https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/extend.py#L112
inithttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/init.py
创建实例化,init方法被执行#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/init.py#L21
methodhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/method.py
私有属性不能访问#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/method.py#L33
overloadhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overload.py
overwritehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overwrite.py
继承 Phone#L17https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/overwrite.py#L17
privatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py
私有属性无法访问#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L23
私有方法无法访问#L26https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L26
公有方法访问私有属性#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/17_examples_object/private.py#L29
18_examples_standand_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib
doctest_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py
运行测试,通过doc的结果和代码运行结果进行比较#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py#L23
TestCase 测试用例#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/doctest_lib.py#L43
glob_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py
显示方法帮助文档手册#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L14
搜索当前目录下的*.py后缀的文件#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L20
搜索路径包含lib字符的文件#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/glob_lib.py#L23
os_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py
显示所有属性和方法#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L16
显示该包的帮助手册#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L19
显示某个方法帮助手册#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L22
切换目录#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L30
调用系统命令#L33https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L33
调用系统命令#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/os_lib.py#L36
random_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py
随机取数组中一个值#L15https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L15
随机生成一个长度为10的数组#L18https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L18
产生随机float数#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L21
随机生成一个小于6的随机数#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L24
随机生成一个数组#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L27
随机生成1~10的整数#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/random_lib.py#L30
re_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py
找到所有匹配的字符#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L13
转换表达式#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L16
找到不重复的字符串#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L19
查找首个匹配的字符串#L28https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L28
拆分字符串#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L34
最大分割2个字符串#L38https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/re_lib.py#L38
shutil_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py
统计使用空间#L17https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L17
移动目录#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L20
复制文件#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L23
复制目录#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L27
压缩文件#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/shutil_lib.py#L30
sys_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py
日志输入输出#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py#L25
退出#L30https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/sys_lib.py#L30
timeit_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py
计算耗时#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py#L16
执行一段代码 number=2 次#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/timeit_lib.py#L41
urllib_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py
打开url,读取内容#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L16
读取300个字符#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L22
请求状态#L31https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L31
带参数的请求#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L35
设置密码的请求方式#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L42
转换参数进行查询#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L58
转换参数进行查询#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L65
代理#L73https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/urllib_lib.py#L73
zlib_libhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py
压缩#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L21
解压缩#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L25
加密#L29https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/18_examples_standand_lib/zlib_lib.py#L29
19_examples_jsonhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json
json_samplehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py
Python 字典类型转换为 JSON 对象#L48https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L48
如果你要处理的是文件而不是字符串,你可以使用 json.dump() 和 json.load() 来编码和解码JSON数据。例如:#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L65
读取数据#L70https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_sample.py#L70
json_translatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py
示例:gitmojis.json 和 git-emoji-list.rst 进行读取和转换#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L16
描述:将gitmojis.json文件中的 emoji、description 属性,#L18https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L18
读取git-emoji-list.rst文件内容#L26https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L26
读取gitmojis.json文件内容#L38https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L38
数据替换#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/19_examples_json/json_translate.py#L58
20_examples_regexhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex
regexhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py
match 没有匹配到#L134https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L134
删除注释#L152https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L152
移除非数字的内容#L156https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L156
剃除字母#L160https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/20_examples_regex/regex.py#L160
21_examples_sockethttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket
clienthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py
和指定地址、端口的服务器建立链接#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L19
向服务器发送信息#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L22
接受服务器消息#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client.py#L25
client2https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/client2.py
serverhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py
建立socket对象#L17https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L17
绑定地址和端口#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L20
最大建立一个监听#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L22
客户端链接#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server.py#L25
server2https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/server2.py
skhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/sk.py
socket_clienthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_client.py
socket_serverhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py
创建 socket 对象#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L71
绑定端口#L78https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L78
设置最大连接数,超过后排队#L81https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L81
重复建立链接或发送消息#L84https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/21_examples_socket/socket_server.py#L84
22_examples_emailhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email
mail_stmphttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/mail_stmp.py
三个参数:第一个为文本内容,第二个 plain 设置文本格式,第三个 utf-8 设置编码#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/mail_stmp.py#L41
send_mailhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py
第三方SMTP服务#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L20
发送人#L25https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L25
接收人#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail.py#L27
send_mail2https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail2.py
send_mail_htmlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_html.py
send_mail_imagehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_image.py
send_mail_parthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/22_examples_email/send_mail_part.py
23_examples_threadhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread
thread_functionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py
为线程定义一个函数#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py#L27
创建两个线程#L35https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_function.py#L35
thread_modulehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py
创建线程#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L63
启动新线程#L67https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L67
等待线程执行完成#L72https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_module.py#L72
thread_queuehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py
创建线程锁#L75https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L75
创建线程队列#L77https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L77
填充队列#L93https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L93
等待队列清空#L102https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L102
等待所有线程完成#L108https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_queue.py#L108
thread_schedulhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_schedul.py
定时3秒后运行#L21https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_schedul.py#L21
thread_synchttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py
创建线程锁#L60https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L60
创建线程#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L63
启动新线程#L67https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L67
等待线程执行完成#L71https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/23_examples_thread/thread_sync.py#L71
24_examples_dbhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db
db_call_prochttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L16
关闭数据库连接#L34https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc.py#L34
db_call_proc_paramshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L16
关闭数据库连接#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_call_proc_params.py#L32
db_connecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_connect.py
db_create_tablehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L16
使用 execute() 方法执行 SQL,如果表存在则删除#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L19
使用预处理语句创建表#L22https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L22
执行创建表语句#L32https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L32
关闭数据库连接#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_create_table.py#L36
db_deletehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L16
关闭数据库连接#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_delete.py#L37
db_injecthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L16
关闭数据库连接#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_inject.py#L37
db_inserthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L16
关闭数据库连接#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert.py#L37
db_insert_formathttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L16
关闭数据库连接#L36https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_format.py#L36
db_insert_manyhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L16
关闭数据库连接#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_insert_many.py#L39
db_query_allhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py
打开数据库连接#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L20
使用 cursor() 方法创建一个游标对象 cursor#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L23
关闭数据库连接#L42https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_all.py#L42
db_query_cursorshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py
打开数据库连接#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L20
使用 cursor() 方法创建一个游标对象 cursor#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L23
关闭数据库连接#L55https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_cursors.py#L55
db_query_fetchhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py
打开数据库连接#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L20
使用 cursor() 方法创建一个游标对象 cursor#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L23
关闭数据库连接#L54https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_fetch.py#L54
db_query_onehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py
打开数据库连接#L20https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L20
使用 cursor() 方法创建一个游标对象 cursor#L23https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L23
关闭数据库连接#L41https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_query_one.py#L41
db_templatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py
定义上下文管理器,连接后自动关闭连接#L15https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py#L15
使用模板查询#L39https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_template.py#L39
db_transtionhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py
打开数据库连接#L24https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L24
使用 cursor() 方法创建一个游标对象 cursor#L27https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L27
关闭数据库连接#L48https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_transtion.py#L48
db_updatehttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py
打开数据库连接#L13https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L13
使用 cursor() 方法创建一个游标对象 cursor#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L16
关闭数据库连接#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/24_examples_db/db_update.py#L37
25_examples_shellhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/25_examples_shell
shell_cmdhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/25_examples_shell/shell_cmd.py
26_examples_yamlhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml
pyYAMLhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml/pyyaml_convert.py
ruamel_YAMLhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/26_examples_yaml/ruamel_yaml_convert.py
50_samples_varableshttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables
var_assignment_processhttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py
示例:可迭代对象赋值给多个变量#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L14
统计平均分,去掉最高低分#L19https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L19
去掉部分数据#L37https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L37
获取 name、email#L40https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L40
phones 列表类型的,无论phones数据包含几个元素#L45https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L45
只取最后两个数据#L51https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L51
phones 列表类型的,无论phones数据包含几个元素#L58https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L58
注意:#L63https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L63
trailing 则是 tuple 元组#L65https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L65
扩展的迭代解压语法#L74https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L74
取到第一个元素,作为类型,进行分别处理#L89https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L89
星号解压语法#L99https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L99
占位符赋值;解压一部分,丢弃其他(一个或多个)的值#L112https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L112
简单递归#L121https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_assignment_process.py#L121
var_multi_assignmenthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py
示例:多变量赋值#L12https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L12
描述:唯一的前提就是变量的数量必须跟序列元素的数量是一样的#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L14
进一步赋值#L43https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L43
字符串赋值#L54https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L54
占位符赋值;解压一部分,丢弃其他的值#L66https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L66
当赋值的变量数量比被赋值的对象数据长度多,将发生异常#L75https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/50_samples_varables/var_multi_assignment.py#L75
app_generator_copyrighthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright
generator-copyrighthttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright/generator-copyright.py
描述:生成 copyright 信息,插入到文件中#L14https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_copyright/generator-copyright.py#L14
app_generator_tochttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc
generator-tochttps://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc/generator-toc.py
描述:生成项目工程的 makedown 格式的 目录索引 TOC 的文档#L16https://patch-diff.githubusercontent.com/hooj0/python-examples/blob/master/app_generator_toc/generator-toc.py#L16
生成 目录索引 TOC 的文档 工具类#L21https://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 pagehttps://patch-diff.githubusercontent.com/hooj0/python-examples
Activityhttps://patch-diff.githubusercontent.com/hooj0/python-examples/activity
0 starshttps://patch-diff.githubusercontent.com/hooj0/python-examples/stargazers
0 watchinghttps://patch-diff.githubusercontent.com/hooj0/python-examples/watchers
0 forkshttps://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
Releaseshttps://patch-diff.githubusercontent.com/hooj0/python-examples/releases
Packages 0https://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
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.