- 博客(8)
- 收藏
- 关注
原创 IPython与Jupyter内核
目录1. IPython介绍2. 更换jupyter notebook内核2.1 查看jupyter内核列表: `jupyter kernel list`2.2 为jupyter添加kernel(内核): `python -m ipykernel install --name kernelname`2.2.1 例一:为jupyter添加Python3.9的内核(3.9为默认版本)2.2.2 例二:为jupyter添加Python3.7的内核(3.7非默认版本)2.3 删除jupyter的某个kernel(
2021-05-17 16:54:15 713 1
原创 Python Anonymous/Lambda Function
Python Anonymous/Lambda Function1. What are lambda function in Python?2. How to use lambda Function in Python?2.1 Syntax of Lambda Function in Python2.2 Example of Lambda Funuction in Python3. Use of Lambda Function in Python3.1 Example with filter()3.2 E
2021-01-16 17:40:39 199 1
原创 Python Global, Local and Nonlocal variables
Python Global, Local and Nonlocal variables1. Global variables1.1 Definition1.2 Example of Usage1.3 global keyword(global关键字)2. Local variables2.1 Definition2.2 Global variable and Local variable with the same name3. Unlocal variables3.1 Definition3.2 Exam
2021-01-14 15:25:24 154
原创 Mac中管理不同的python版本
目录1. brew安装旧版本python2. brew在不同版本python之间切换(pip也随之切换)3. jupyter内核中的Python1. How to know which version of python is running in Jupyter notebook?2. 更换jupyter中使用的python的版本1. brew安装旧版本python# 查看 brew 可安装的所有python版本>>> brew search python@xxx# 安装 py
2021-01-10 00:38:34 413
原创 Decorator in Python
目录Python中的描述符Prerequisites for learning decoratorsEverything is objectPython ClousuresNonlocal variable in nested functionNonlocal variablesDefining a Closure FunctionWhen do we have closures?When to use closures?Getting back to DecoratorsDecorating Functi
2021-01-06 15:04:16 175
原创 python描述符
DefinitionDescriptor is how python’s property type implemented.A descriptor simply implements _get_, _set_, _delete_, and then is added to another class in it’s definition._get_(self, instance, owner):access the attribute. It return value of attribute
2021-01-05 23:28:08 79
原创 python线程
多线程和多进程是每个计算机爱好者必须掌握的知识。在我接触编程的时候,几乎没有见过多线程/进程开发的demo,这导致我在很长一段时间都掌握得模模糊糊。在本篇博客中,我们将用几个例子简单介绍多线程,并用几个图片加深大家对进程的理解。
2020-12-31 00:57:01 111
原创 C语言的内存管理
文章目录为什么需要在C语言中做内存管理C语言中内存分区***图片1***静态储存区栈储存区(stack)堆存储区(heap)三种储存的应用举例***图片2***参考博客为什么需要在C语言中做内存管理作为新手时,我经常别人谈到内存管理。但是在我用C编写了很多简单的代码段以后,我发现自己还是没有用到内存管理,以至于我怀疑起内存管理的重要性。为了解决大家的疑惑,接下来我们举一些例子,用于说明内存管理的重要性。假设有一个strdup()函数,用于给一个字符串分配地址,并return该地址。#include
2020-12-28 22:26:31 360
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人