René's URL Explorer Experiment


Title: GitHub - Jason-LH/magic-python: 带你玩不一样的 Python

Open Graph Title: GitHub - Jason-LH/magic-python: 带你玩不一样的 Python

X Title: GitHub - Jason-LH/magic-python: 带你玩不一样的 Python

Description: 带你玩不一样的 Python. Contribute to Jason-LH/magic-python development by creating an account on GitHub.

Open Graph Description: 带你玩不一样的 Python. Contribute to Jason-LH/magic-python development by creating an account on GitHub.

X Description: 带你玩不一样的 Python. Contribute to Jason-LH/magic-python development by creating an account on GitHub.

Opengraph URL: https://github.com/Jason-LH/magic-python

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:b77af693-5cb7-875f-c33b-2d97257a329b
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-id8662:212B98:AE305C:E80E67:6981320E
html-safe-nonced95727abc6a3a3e7b345be9a1bf51b16845c49e602e880306fdb09680341b7ff
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjYyOjIxMkI5ODpBRTMwNUM6RTgwRTY3OjY5ODEzMjBFIiwidmlzaXRvcl9pZCI6IjI4NzMxMTQwODgwNTE5MTMyMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2b7267cab9358d85cdccf7e8af2d8ac2f2428f0e6588f54fb1485fe400919cda
hovercard-subject-tagrepository:284718167
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/Jason-LH/magic-python
twitter:imagehttps://opengraph.githubassets.com/3bd2c4453641ef69013619e5625a8bc5b520a13f2d6a0876491f31c56705bf17/Jason-LH/magic-python
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3bd2c4453641ef69013619e5625a8bc5b520a13f2d6a0876491f31c56705bf17/Jason-LH/magic-python
og:image:alt带你玩不一样的 Python. Contribute to Jason-LH/magic-python development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None39fe8101494cbb823c09b619b68c80cd4d05ab7279997038dbe06bb91608abe1
turbo-cache-controlno-preview
go-importgithub.com/Jason-LH/magic-python git https://github.com/Jason-LH/magic-python.git
octolytics-dimension-user_id18021280
octolytics-dimension-user_loginJason-LH
octolytics-dimension-repository_id284718167
octolytics-dimension-repository_nwoJason-LH/magic-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id262793810
octolytics-dimension-repository_parent_nwoiswbm/magic-python
octolytics-dimension-repository_network_root_id262793810
octolytics-dimension-repository_network_root_nwoiswbm/magic-python
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
released5b34a4e4898b066c629879feb4b184bc471d6a7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FJason-LH%2Fmagic-python
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%2FJason-LH%2Fmagic-python
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=Jason-LH%2Fmagic-python
Reloadhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
Reloadhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
Reloadhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
Jason-LH https://patch-diff.githubusercontent.com/Jason-LH
magic-pythonhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
iswbm/magic-pythonhttps://patch-diff.githubusercontent.com/iswbm/magic-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FJason-LH%2Fmagic-python
Fork 0 https://patch-diff.githubusercontent.com/login?return_to=%2FJason-LH%2Fmagic-python
Star 0 https://patch-diff.githubusercontent.com/login?return_to=%2FJason-LH%2Fmagic-python
0 stars https://patch-diff.githubusercontent.com/Jason-LH/magic-python/stargazers
477 forks https://patch-diff.githubusercontent.com/Jason-LH/magic-python/forks
Branches https://patch-diff.githubusercontent.com/Jason-LH/magic-python/branches
Tags https://patch-diff.githubusercontent.com/Jason-LH/magic-python/tags
Activity https://patch-diff.githubusercontent.com/Jason-LH/magic-python/activity
Star https://patch-diff.githubusercontent.com/login?return_to=%2FJason-LH%2Fmagic-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FJason-LH%2Fmagic-python
Code https://patch-diff.githubusercontent.com/Jason-LH/magic-python
Pull requests 0 https://patch-diff.githubusercontent.com/Jason-LH/magic-python/pulls
Actions https://patch-diff.githubusercontent.com/Jason-LH/magic-python/actions
Projects 0 https://patch-diff.githubusercontent.com/Jason-LH/magic-python/projects
Security 0 https://patch-diff.githubusercontent.com/Jason-LH/magic-python/security
Insights https://patch-diff.githubusercontent.com/Jason-LH/magic-python/pulse
Code https://patch-diff.githubusercontent.com/Jason-LH/magic-python
Pull requests https://patch-diff.githubusercontent.com/Jason-LH/magic-python/pulls
Actions https://patch-diff.githubusercontent.com/Jason-LH/magic-python/actions
Projects https://patch-diff.githubusercontent.com/Jason-LH/magic-python/projects
Security https://patch-diff.githubusercontent.com/Jason-LH/magic-python/security
Insights https://patch-diff.githubusercontent.com/Jason-LH/magic-python/pulse
Brancheshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/branches
Tagshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/tags
https://patch-diff.githubusercontent.com/Jason-LH/magic-python/branches
https://patch-diff.githubusercontent.com/Jason-LH/magic-python/tags
12 Commitshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/commits/master/
https://patch-diff.githubusercontent.com/Jason-LH/magic-python/commits/master/
.gitignorehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/.gitignore
.gitignorehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/.gitignore
Python 黑魔法指南 v1.0.pdfhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/Python%20%E9%BB%91%E9%AD%94%E6%B3%95%E6%8C%87%E5%8D%97%20v1.0.pdf
Python 黑魔法指南 v1.0.pdfhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/Python%20%E9%BB%91%E9%AD%94%E6%B3%95%E6%8C%87%E5%8D%97%20v1.0.pdf
Python 黑魔法指南 v2.0.pdfhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/Python%20%E9%BB%91%E9%AD%94%E6%B3%95%E6%8C%87%E5%8D%97%20v2.0.pdf
Python 黑魔法指南 v2.0.pdfhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/Python%20%E9%BB%91%E9%AD%94%E6%B3%95%E6%8C%87%E5%8D%97%20v2.0.pdf
README.mdhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/README.md
README.mdhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/README.md
usercustomize.pyhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/usercustomize.py
usercustomize.pyhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/blob/master/usercustomize.py
READMEhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
https://camo.githubusercontent.com/de4f207bb581ee235f35b8c0c2646aba05b274ab5891f0561ba8a556c13ec9ba/687474703a2f2f696d6167652e697377626d2e636f6d2f32303230303731393233313235312e706e67
https://camo.githubusercontent.com/53f5a4c86d02d0e2e3a133a57001e6dc8829fbc84031c9004660522a0fea27c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e67756167652d507974686f6e2d626c75652e737667
https://camo.githubusercontent.com/a9e01507968cb5a6e14dd4c216a2d076fa1ceed77ea625867a47be166590f0c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6672616d776f726b2d537068696e782d677265656e2e737667
https://www.zhihu.com/people/wongbingming
https://juejin.im/user/5b08d982f265da0db3502c55
http://image.iswbm.com/20200607114246.png
https://patch-diff.githubusercontent.com/Jason-LH/magic-python#在线阅读
《Python 黑魔法指南》https://github.com/iswbm/magic-python/blob/master/Python%20%E9%BB%91%E9%AD%94%E6%B3%95%E6%8C%87%E5%8D%97%20v2.0.pdf
https://patch-diff.githubusercontent.com/Jason-LH/magic-python#目录大纲
https://camo.githubusercontent.com/2231073a15b72dff8d0efbfb362c1ed16dde2b478dae808007c2d227cbaa881c/687474703a2f2f696d6167652e697377626d2e636f6d2f32303230303731393232313935322e706e67
第一章:魔法冷知识https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------
1.1 默默无闻的省略号很好用https://patch-diff.githubusercontent.com/Jason-LH/magic-python#11------------
1.2 使用 end 来结束代码块https://patch-diff.githubusercontent.com/Jason-LH/magic-python#12----end-------
1.3 可直接运行的 zip 包https://patch-diff.githubusercontent.com/Jason-LH/magic-python#13--------zip--
1.4 反斜杠的倔强: 不写最后https://patch-diff.githubusercontent.com/Jason-LH/magic-python#14-------------
1.5 如何修改解释器提示符https://patch-diff.githubusercontent.com/Jason-LH/magic-python#15-----------
1.6 简洁而优雅的链式比较https://patch-diff.githubusercontent.com/Jason-LH/magic-python#16------------
1.7 and 和 or 的短路效应https://patch-diff.githubusercontent.com/Jason-LH/magic-python#17-and---or------
1.8 连接多个列表最极客的方式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#18-------------
1.9 字典居然是可以排序的?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#19------------
1.10 哪些情况下不需要续行符?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#110-------------
1.11 用户无感知的小整数池https://patch-diff.githubusercontent.com/Jason-LH/magic-python#111-----------
1.12 神奇的 intern 机制https://patch-diff.githubusercontent.com/Jason-LH/magic-python#112-----intern---
1.13 site-packages和 dist-packageshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#113-site-packages--dist-packages
1.14 argument 和 parameter 的区别https://patch-diff.githubusercontent.com/Jason-LH/magic-python#114-argument---parameter----
1.15 /usr/bin/env python 有什么用?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#115--usr-bin-env-python------
1.16 dict() 与 {} 生成空字典有什么区别?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#116-dict-------------------
1.17 有趣但没啥用的 import 用法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#117---------import---
1.18 正负得正,负负得正https://patch-diff.githubusercontent.com/Jason-LH/magic-python#118----------
1.19 return不一定都是函数的终点https://patch-diff.githubusercontent.com/Jason-LH/magic-python#119-return----------
1.20 字符串里的缝隙是什么?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#120------------
1.21 Python2下 也能使用 print(“”)https://patch-diff.githubusercontent.com/Jason-LH/magic-python#121-python2-------print----
1.22 字母也玩起了障眼法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#122----------
1.23 数值与字符串的比较https://patch-diff.githubusercontent.com/Jason-LH/magic-python#123----------
1.24 时有时无的切片异常https://patch-diff.githubusercontent.com/Jason-LH/magic-python#124----------
1.25 迷一样的字符串https://patch-diff.githubusercontent.com/Jason-LH/magic-python#125--------
1.26 x 与 +x 等价吗?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#126-x----x-----
1.27 += 不等同于=+https://patch-diff.githubusercontent.com/Jason-LH/magic-python#127----------
1.28 循环中的局部变量泄露https://patch-diff.githubusercontent.com/Jason-LH/magic-python#128-----------
1.29 局部/全局变量傻傻分不清https://patch-diff.githubusercontent.com/Jason-LH/magic-python#129-------------
1.30 break /continue 和 上下文管理器哪个优先级高?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#130-break--continue----------------
第二章:魔法命令行https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------
2.1 懒人必备技能:使用 “_”https://patch-diff.githubusercontent.com/Jason-LH/magic-python#21--------------
2.2 最快查看包搜索路径的方式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#22-------------
2.3 使用 json.tool 来格式化 JSONhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#23----jsontool------json
2.4 命令行式执行 Python 代码https://patch-diff.githubusercontent.com/Jason-LH/magic-python#24--------python---
2.5 用调试模式执行脚本https://patch-diff.githubusercontent.com/Jason-LH/magic-python#25----------
2.6 如何快速搭建 FTP 服务器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#26--------ftp----
2.7 快速构建 HTML 帮助文档https://patch-diff.githubusercontent.com/Jason-LH/magic-python#27------html-----
2.8 最正确且优雅的装包方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#28------------
2.9 往 Python Shell 中传入参数https://patch-diff.githubusercontent.com/Jason-LH/magic-python#29---python-shell------
2.10 让脚本报错后立即进入调试模式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#210---------------
2.11 极简模式执行 Python Shellhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#211--------python-shell
2.12 在执行任意代码前自动念一段平安经https://patch-diff.githubusercontent.com/Jason-LH/magic-python#212-----------------
2.13 启动 Python Shell 前自动执行某脚本https://patch-diff.githubusercontent.com/Jason-LH/magic-python#213----python-shell---------
第三章:炫技魔法操作https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
3.1 八种连接列表的方式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#31----------
1、最直观的相加https://patch-diff.githubusercontent.com/Jason-LH/magic-python#1-------
2、借助 itertoolshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#2----itertools
3、使用 * 解包https://patch-diff.githubusercontent.com/Jason-LH/magic-python#3--------
4、使用 extendhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#4----extend
5、使用列表推导式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#5--------
6、使用 heapqhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#6----heapq
7、借助魔法方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#7-------
8. 使用 yield fromhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#8----yield-from
3.2 合并字典的 8 种方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#32-------8----
1、最简单的原地更新https://patch-diff.githubusercontent.com/Jason-LH/magic-python#1---------
2、先解包再合并字典https://patch-diff.githubusercontent.com/Jason-LH/magic-python#2---------
3、借助 itertoolshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#3----itertools
4、借助 ChainMaphttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#4----chainmap
5、使用dict.items() 合并https://patch-diff.githubusercontent.com/Jason-LH/magic-python#5---dictitems-----
6、最酷炫的字典解析式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#6----------
7、Python 3.9 新特性https://patch-diff.githubusercontent.com/Jason-LH/magic-python#7-python-39----
3.3 花式导包的八种方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#33----------
1. 直接 importhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#1----import
2. 使用 _import_https://patch-diff.githubusercontent.com/Jason-LH/magic-python#2-------import--
3. 使用 importlib 模块https://patch-diff.githubusercontent.com/Jason-LH/magic-python#3----importlib---
4. 使用 imp 模块https://patch-diff.githubusercontent.com/Jason-LH/magic-python#4----imp---
5. 使用 execfilehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#5----execfile
6. 使用 exec 执行https://patch-diff.githubusercontent.com/Jason-LH/magic-python#6----exec---
7. import_from_github_comhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#7-import-from-github-com
8、远程导入模块https://patch-diff.githubusercontent.com/Jason-LH/magic-python#8-------
3.4 条件语句的七种写法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#34----------
第一种:原代码https://patch-diff.githubusercontent.com/Jason-LH/magic-python#-------
第二种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
第三种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
第四种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
第五种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
第六种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
第七种https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---
3.5 判断是否包含子串的七种方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#35--------------
1、使用 in 和 not inhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#1----in---not-in
2、使用 find 方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#2----find---
3、使用 index 方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#3----index---
4、使用 count 方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#4----count---
5、通过魔法方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#5-------
6、借助 operatorhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#6----operator
7、使用正则匹配https://patch-diff.githubusercontent.com/Jason-LH/magic-python#7-------
3.6 海象运算符的三种用法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#36-----------
第一个用法:if/elsehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#------if-else
第二个用法:whilehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#------while
第三个用法:推导式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------
第四章:魔法进阶扫盲https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
4.1 精通装饰器八大用法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#41----------
Hello,装饰器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#hello----
入门:日志打印器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--------
入门:时间计时器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--------
进阶:带参数的函数装饰器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#------------
高阶:不带参数的类装饰器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#------------
高阶:带参数的类装饰器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#-----------
使用偏函数与类实现装饰器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#------------
如何写能装饰类的装饰器?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#------------
wraps 装饰器有啥用?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#wraps--------
4.2 深入理解描述符https://patch-diff.githubusercontent.com/Jason-LH/magic-python#42--------
为什么要使用描述符?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
描述符的访问规则https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--------
基于描述符如何实现propertyhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------property
基于描述符如何实现staticmethodhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------staticmethod
基于描述符如何实现classmethodhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------classmethod
所有实例共享描述符https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------
4.3 精通上下文管理器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#43---------
what context manager?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#what-context-manager-
how context manager?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#how-context-manager-
why context manager?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#why-context-manager-
how contextlib?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#how-contextlib-
第五章:魔法开发技巧https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
5.1 嵌套上下文管理的另类写法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#51-------------
5.2 将嵌套 for 循环写成单行https://patch-diff.githubusercontent.com/Jason-LH/magic-python#52-----for-------
5.3 单行实现 for 死循环如何写?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#53------for--------
5.4 如何关闭异常自动关联上下文?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#54---------------
5.5 自带的缓存机制不用白不用https://patch-diff.githubusercontent.com/Jason-LH/magic-python#55-------------
5.6 如何流式读取数G超大文件https://patch-diff.githubusercontent.com/Jason-LH/magic-python#56--------g----
5.7 实现类似 defer 的延迟调用https://patch-diff.githubusercontent.com/Jason-LH/magic-python#57------defer------
5.8 如何快速计算函数运行时间https://patch-diff.githubusercontent.com/Jason-LH/magic-python#58-------------
5.9 重定向标准输出到日志https://patch-diff.githubusercontent.com/Jason-LH/magic-python#59-----------
5.10 快速定位错误进入调试模式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#510-------------
5.11 在程序退出前执行代码的技巧https://patch-diff.githubusercontent.com/Jason-LH/magic-python#511--------------
5.12 逗号也有它的独特用法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#512-----------
5.13 如何在运行状态查看源代码?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#513--------------
5.14 少为人知的重试机制https://patch-diff.githubusercontent.com/Jason-LH/magic-python#514----------
5.15 让我爱不释手的用户环境https://patch-diff.githubusercontent.com/Jason-LH/magic-python#515------------
5.16 字符串的分割技巧https://patch-diff.githubusercontent.com/Jason-LH/magic-python#516---------
5.17 反转字符串/列表最优雅的方式https://patch-diff.githubusercontent.com/Jason-LH/magic-python#517---------------
5.18 如何将 print 内容输出到文件https://patch-diff.githubusercontent.com/Jason-LH/magic-python#518------print--------
5.19 改变默认递归次数限制https://patch-diff.githubusercontent.com/Jason-LH/magic-python#519-----------
5.20 让你晕头转向的 else 用法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#520---------else---
5.21 单分派泛函数如何写?https://patch-diff.githubusercontent.com/Jason-LH/magic-python#521-----------
第六章:良好编码习惯https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
6.1 不要直接调用类的私有方法https://patch-diff.githubusercontent.com/Jason-LH/magic-python#61-------------
6.2 默认参数最好不为可变对象https://patch-diff.githubusercontent.com/Jason-LH/magic-python#62-------------
6.3 增量赋值的性能更好https://patch-diff.githubusercontent.com/Jason-LH/magic-python#63----------
6.4 别再使用 pprint 打印了https://patch-diff.githubusercontent.com/Jason-LH/magic-python#64------pprint----
1. 吐槽问题https://patch-diff.githubusercontent.com/Jason-LH/magic-python#1-----
2. 解决问题https://patch-diff.githubusercontent.com/Jason-LH/magic-python#2-----
打印中文https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----
打印双引号https://patch-diff.githubusercontent.com/Jason-LH/magic-python#-----
3. 何必折腾https://patch-diff.githubusercontent.com/Jason-LH/magic-python#3-----
打印中文https://patch-diff.githubusercontent.com/Jason-LH/magic-python#-----1
4. 总结一下https://patch-diff.githubusercontent.com/Jason-LH/magic-python#4-----
第七章:神奇的魔法模块https://patch-diff.githubusercontent.com/Jason-LH/magic-python#-----------
7.1 远程登陆服务器的最佳利器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#71-------------
1. 使用 subprocesshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#1----subprocess
2. 使用 sh.sshhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#2----shssh
3. 使用 paramikohttps://patch-diff.githubusercontent.com/Jason-LH/magic-python#3----paramiko
方法1:基于用户名和密码的 sshclient 方式登录https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--1-----------sshclient-----
方法2:基于用户名和密码的 transport 方式登录https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--2-----------transport-----
方法3:基于公钥密钥的 SSHClient 方式登录https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--3---------sshclient-----
方法4:基于密钥的 Transport 方式登录https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--4-------transport-----
实现 sftp 文件传输https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---sftp-----
注意事项https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----
4. 写在最后https://patch-diff.githubusercontent.com/Jason-LH/magic-python#4-----
7.2 代码 BUG 变得酷炫的利器https://patch-diff.githubusercontent.com/Jason-LH/magic-python#72----bug--------
1. 环境要求https://patch-diff.githubusercontent.com/Jason-LH/magic-python#1-----
2. 效果对比https://patch-diff.githubusercontent.com/Jason-LH/magic-python#2-----
3. 配置全局可用https://patch-diff.githubusercontent.com/Jason-LH/magic-python#3-------
4. 单文件中使用https://patch-diff.githubusercontent.com/Jason-LH/magic-python#4-------
5. 自定义设置https://patch-diff.githubusercontent.com/Jason-LH/magic-python#5------
5.1 设置颜色https://patch-diff.githubusercontent.com/Jason-LH/magic-python#51-----
5.2 设置显示内容https://patch-diff.githubusercontent.com/Jason-LH/magic-python#52-------
5.3 设置怎么显示https://patch-diff.githubusercontent.com/Jason-LH/magic-python#53-------
7.3 少有人知的 Python "重试机制"https://patch-diff.githubusercontent.com/Jason-LH/magic-python#73-------python-------
最基本的重试https://patch-diff.githubusercontent.com/Jason-LH/magic-python#----------
设置停止基本条件https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--------
设置何时进行重试https://patch-diff.githubusercontent.com/Jason-LH/magic-python#--------
重试后错误重新抛出https://patch-diff.githubusercontent.com/Jason-LH/magic-python#---------
设置回调函数https://patch-diff.githubusercontent.com/Jason-LH/magic-python#------
https://camo.githubusercontent.com/9d74b72511559c576f634855e538352cff1138a8b9a1564816cf125004aa1f39/687474703a2f2f696d6167652e697377626d2e636f6d2f32303230303531323133303132322e706e67
Readme https://patch-diff.githubusercontent.com/Jason-LH/magic-python#readme-ov-file
Please reload this pagehttps://patch-diff.githubusercontent.com/Jason-LH/magic-python
Activityhttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/activity
0 starshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/stargazers
0 watchinghttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/watchers
0 forkshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/forks
Report repository https://patch-diff.githubusercontent.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2FJason-LH%2Fmagic-python&report=Jason-LH+%28user%29
Releaseshttps://patch-diff.githubusercontent.com/Jason-LH/magic-python/releases
Packages 0https://patch-diff.githubusercontent.com/users/Jason-LH/packages?repo_name=magic-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.