摘要: 1.安装以及基本使用 yarn add react-router-dom 基本结构: import React from "react"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import 阅读全文
posted @ 2019-12-29 22:51 老郭蜀黍 阅读(117) 评论(0) 推荐(0)
摘要: 代码部分理解 import React, { Component, Fragment } from "react"; import XiaojiejieItem from "./XiaojiejieItem"; //引入组件 class Xiaojiejie extends Component { 阅读全文
posted @ 2019-12-29 20:58 老郭蜀黍 阅读(137) 评论(0) 推荐(0)
摘要: 1.简易迭代器样板 1 function makeIterator(arr) { 2 let nextIndex = 0; 3 return { 4 next: () => { 5 if (nextIndex < arr.length) { 6 return { value: arr[nextInd 阅读全文
posted @ 2019-12-22 23:32 老郭蜀黍 阅读(312) 评论(0) 推荐(0)
摘要: 1.原始形式的回调 1 fs.readFile("./package.json", (err, data) => { 2 if (err) { 3 console.error(err); 4 } 5 console.log(JSON.parse(data)); 6 }); 2.具有Promise封装 阅读全文
posted @ 2019-12-22 22:38 老郭蜀黍 阅读(224) 评论(0) 推荐(0)
摘要: #单行操作import json import time #json dumps操作,将python对象转换为json对象 d = { '谦谦': { 'sex': '男', 'addr': '北京', 'age': 34 }, '千千': { 'sex': '女', 'addr': '北... 阅读全文
posted @ 2019-05-21 22:38 老郭蜀黍 阅读(92) 评论(0) 推荐(0)
摘要: import random import time def v_code(): while True: code_1 = random.randint(0, 9) code_2 = random.randint(0, 9) code_3 = random.randint(0, 9) code_4 = random.ran... 阅读全文
posted @ 2019-05-21 16:56 老郭蜀黍 阅读(129) 评论(0) 推荐(0)
摘要: 1 In [1]: import time 2 3 In [2]: time.time() 4 Out[2]: 1558424064.7592645 5 6 In [3]: time.strftime('%Y/%m/%d %X',time.localtime()) 7 Out[3]: '2019/05/21 15:36:33' 8 9 In [4]: time.strft... 阅读全文
posted @ 2019-05-21 15:49 老郭蜀黍 阅读(109) 评论(0) 推荐(0)
摘要: # 形参,位置参数 def calc(x, y): "形参是x和y" res = x**y return res c = calc(5, 10) #5和10是实参,同时也可以考虑为位置参数 print(c) #关键字参数 def calc2(x, y): res = x**y return res x = calc2(y=8, x=10) ... 阅读全文
posted @ 2019-05-15 17:01 老郭蜀黍 阅读(147) 评论(0) 推荐(0)
摘要: 实现一个简单的登陆验证小模块,三次重试的机会 该种实现方式只能输入三次,第四次会跳出程序,仅仅作为初学的实验参考 阅读全文
posted @ 2019-05-13 02:21 老郭蜀黍 阅读(76) 评论(0) 推荐(0)