npm的默认源一般都比较慢,为了能够提升npm安装依赖的速度,我们可以将源设置为国内的。
临时设置淘宝源
npm --registry https://registry.npm.taobao.org i express
永久设置淘宝源
npm conf set registry...
5年前 (2021-01-10)
喜欢
npm的默认源一般都比较慢,为了能够提升npm安装依赖的速度,我们可以将源设置为国内的。
临时设置淘宝源
npm --registry https://registry.npm.taobao.org i express
永久设置淘宝源
npm conf set registr...
5年前 (2021-01-10)
喜欢
Electron
Electron允许web程序员用Javascript、HTML、CSS来编写运行于Windows、macOS、Linux跨平台的桌面应用
环境安装Node.js
node.js下载最新稳定版本
安装Electron
npm install -g electro...
5年前 (2021-01-09)
喜欢
var num = -10;
var num2 = Math.abs(num);
...
5年前 (2021-01-08)
喜欢
moment('2019-11-21').diff(moment('2019-08-01'), 'days')
...
5年前 (2021-01-08)
喜欢
var now = moment().locale('zh-cn').format('YYYY-MM-DD HH:mm:ss');
...
5年前 (2021-01-08)
喜欢
原始类型
目标类型
函数
举例
列表
集合
set
New_set=set([1,2,3,4,5])
列表
元组
tuple
New_tuple=tuple([1,2,3,4])
元组
集合
set
new_set=set((1,2,3,4))
元组
列...
5年前 (2021-01-07)
喜欢
self是类函数中必传的参数,必须放在第一个参数位置
self是一个对象,他代表实例化变量自身
self可以直接通过点来定义一个类变量
self中的变量与含有self参数的函数可以在类中农的任何一个函数内随意调用
非拿书内定义的便利朗在定义的时候不能用self
...
5年前 (2021-01-07)
喜欢
return
def add(a, b):
c = a + b
return c
print(add(1, 2))
结果
3
...
5年前 (2021-01-07)
喜欢
def
def say_hello():
print('hello word')
say_hello()
...
5年前 (2021-01-07)
喜欢