Python - 00_Setup
来源:https://dabeaz-course.github.io/practical-python/Notes/00_Setup.html
peek at
“Peek at” 是一个常见的短语动词,意思是“偷偷看”或“快速浏览”。它通常指快速或短暂地看某物,通常带有一种试图不被发现或只是轻轻一瞥的含义。
用法及例句:
偷偷看 (to glance quickly or secretly at something):
- 指快速地或秘密地看一下某物,通常表示并不想引起注意。
- 例句: “She peeked at her phone during the meeting.”(她在会议期间偷偷看了一眼手机。)
- 例句: “The children peeked at the presents before Christmas morning.”(孩子们在圣诞节早晨前偷偷看了一眼礼物。)
快速浏览 (to look briefly at something without much attention):
- 可以表示快速地浏览某物,不是仔细检查或深入阅读,而只是简短地看一下。
- 例句: “I just peeked at the report, I haven’t had time to read it fully.”(我只是快速浏览了一下报告,还没来得及仔细阅读。)
- 例句: “He peeked at the answers before submitting the test.”(他在提交考试前偷偷看了一下答案。)
常见搭配:
- Peek at something: 偷看某物、快速浏览。
- Take a peek at: 口语中的常见表达,意思是快速看一下某物,带有随意、非正式的语气。
- 例句: “Let me take a peek at your notes.”(让我看一下你的笔记。)
总结:
“Peek at” 用于描述偷偷看或快速浏览某物,通常指短暂地、一瞥地看一下,不是深入或长时间地观察。
peek
v.偷看,窥视;微露出,探出
n.一瞥,偷偷地一看;(计算机)读取数据
Most participants find the material to be quite challenging without peeking at solution code (see below).
大多数参与者在不查看解决方案代码的情况下都会发现这些材料非常具有挑战性(见下文)。
incline
/ɪnˈklaɪn/
词根词缀: in-入 + -clin-倾,斜 + -e
“Incline” 是一个动词和名词,具有“倾向”、“倾斜”或“趋向”的含义。它可以用于描述物理上的倾斜,也可以用于描述心理或行为上的倾向。以下是它的常见用法及例句:
1. 作为动词 (to incline):
1.1 倾向于某事 (to have a tendency toward something):
- 表示某人或某物倾向于某种行为、态度或选择。
- 例句: “I incline to agree with you on this issue.”(在这个问题上,我倾向于同意你的看法。)
- 例句: “He inclines to be more cautious when making decisions.”(他在做决定时更倾向于谨慎。)
1.2 使倾向 (to influence or persuade someone to have a particular opinion or feeling):
- 表示影响某人,使其产生某种想法或态度。
- 例句: “His experiences inclined him to become more empathetic.”(他的经历使他变得更加有同理心。)
1.3 倾斜、偏向 (to lean or bend in a particular direction):
- 指物体或人身体物理上的倾斜或弯曲。
- 例句: “The tree inclines slightly to the left due to the wind.”(这棵树因为风的影响向左稍微倾斜。)
- 例句: “She inclined her head in agreement.”(她点头表示同意。)
2. 作为名词 (an incline):
2.1 斜坡、倾斜 (a slope or a slanted surface):
- 指一个地面或表面向上或向下的斜坡。
- 例句: “The road has a steep incline, so be careful while driving.”(这条路有一个陡坡,所以开车时要小心。)
- 例句: “The incline of the hill made it difficult to climb.”(山的坡度让攀爬变得困难。)
常见搭配:
Incline toward/to something: 倾向于某事。
- 例句: “She inclines toward traditional values.”(她倾向于传统的价值观。)
Be inclined to do something: 倾向于做某事。
- 例句: “I’m inclined to think he’s right.”(我倾向于认为他是对的。)
On an incline: 在坡上,形容某物处于倾斜的表面。
- 例句: “The house is built on an incline.”(房子建在一个斜坡上。)
总结:
- Incline 作为动词时,可以表示心理上的倾向、物理上的倾斜,也可以指使某人倾向于某种观点或行动。
- Incline 作为名词时,通常指斜坡或倾斜的表面。
在不同上下文中,“incline” 可以描述抽象的心理倾向或具体的物理斜度。
You might be inclined to work on this course using a more interactive environment such as Jupyter Notebooks
您可能倾向于使用更具交互性的环境(例如 Jupyter Notebooks)来学习本课程
be great for
“Be great for” 是一个常用的英语短语,表示某物或某人对某个目的、任务或情况非常合适或有益处。它通常用于表达某物适合某一特定用途,或某人具备胜任某一任务或角色的条件。
用法及例句:
适合某个目的或用途 (to be well-suited for a particular purpose):
- 例句: “This book is great for beginners who want to learn coding.”(这本书非常适合想要学习编程的初学者。)
- 例句: “These shoes are great for running long distances.”(这些鞋子非常适合长跑。)
对某人/某事有益 (to be beneficial or helpful to someone or something):
- 例句: “Exercise is great for your health.”(运动对你的健康非常有益。)
- 例句: “A good night’s sleep is great for boosting productivity.”(一晚良好的睡眠有助于提高生产力。)
适合某个场合或活动 (to be appropriate for a specific event or activity):
- 例句: “This dress is great for the party.”(这件连衣裙非常适合参加派对。)
- 例句: “That movie is great for a family night.”(那部电影非常适合家庭电影之夜。)
总结:
“Be great for” 用于表达某物或某人非常适合某个用途、对某人或某事有益,或适合某种场合或活动。
Although notebooks are great for experimentation, many of the exercises in this course teach concepts related to program organization.
尽管笔记本非常适合实验,但本课程中的许多练习教授与程序组织相关的概念。
refactor
“Refactor” 是一个编程术语,用来表示对已有代码进行重构或改进,但不改变其外部行为或功能。以下是 “refactor” 的几种常见用法:
动词:重构代码
- 英语:We need to refactor this function to make it more efficient.
- 中文:我们需要重构这个函数以提高效率。
名词形式:重构的过程
- 英语:This project requires a complete refactor of the backend.
- 中文:这个项目需要对后端进行彻底的重构。
口语中的常用短语:
- Refactor code:重构代码
- Refactor a function/class/module:重构某个函数/类/模块
- Refactor for readability/efficiency:为提高可读性/效率而重构
简单来说,“refactor” 通常指对代码结构进行优化,使其更清晰、简洁或高效,而不影响系统的外部表现。
This includes working with functions, modules, import statements, and refactoring of programs whose source code spans multiple files.
这包括使用函数、模块、导入语句以及重构源代码跨越多个文件的程序。
replicate
近义词 : duplicate
“Replicate” 是一个常用的动词,表示复制、复刻或再现某物。它的用法包括:
动词:复制、复刻
- 英语:The scientists tried to replicate the results of the experiment.
- 中文:科学家们尝试复制实验结果。
在科学和技术领域:
- Replicate an experiment:复现实验
- Replicate a study:复制研究
在数据和数据库管理中:
- Replicate data:复制数据
- Replicate a database:复制数据库
名词(较少用):复制品
- 英语:A replicate of the ancient artifact was displayed in the museum.
- 中文:古代文物的复制品在博物馆展出。
“Replicate” 强调的是忠实地再现或复制原始对象的特性或结果。
In my experience, it is hard to replicate this kind of working environment in notebooks.
根据我的经验,这种工作环境很难在笔记本电脑上复制。
get the most out of
“Get the most out of” 是一个常用的短语,意思是充分利用或最大化某物的价值、效果或好处。它通常用于建议或描述如何从某个资源、经历、机会等中获得最大收益。
用法和例句:
指代利用资源或机会:
- 英语:To get the most out of your vacation, plan your itinerary in advance.
- 中文:为了充分利用你的假期,提前规划你的行程。
指代最大化某种体验:
- 英语:Take notes during the seminar to get the most out of it.
- 中文:在研讨会期间做笔记,以便最大化其效果。
指代优化学习或工作:
- 英语:Use active learning techniques to get the most out of your study time.
- 中文:使用主动学习技巧来充分利用你的学习时间。
指代发挥工具或设备的功能:
- 英语:Learn all the features of the software to get the most out of it.
- 中文:学习软件的所有功能,以便最大化其效用。
总结:
“Get the most out of” 强调的是通过有效的方式或策略,充分利用某物的所有潜力或价值。