摘要: 1 import random 2 3 4 print(random.random()) # 随机从0-1之间的随机数 5 6 print(random.randint(1,10)) # 随机从0-1之间的随机数 7 8 print(random.choice('hello')) # 随机其中一个字 阅读全文
posted @ 2020-05-14 14:24 yangzhuxian 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1 import time 2 import datetime 3 4 print(datetime.datetime.now()) # 2020-04-23 13:47:14.056681 5 6 # time.sleep(3) # 程序停止 单位秒 7 8 # 时间戳 从UNUX到今天一共的秒数 阅读全文
posted @ 2020-05-14 14:22 yangzhuxian 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1.变量 ${...} <div th:text="${name}"> </div> 1.2.选择表达式(星号语法) 我们不仅可以将变量表达式写为$ {...},还可以作为* {...}。这两种⽅式有⼀个重要的区别:星号语法计算所选对象⽽不是整个上下⽂的表达式。 也就是说,只要没有选定的对象,$和* 阅读全文
posted @ 2020-04-27 17:01 yangzhuxian 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 环境:spring-boot 作用之一:jsp有jstl标签库。html就可以用thymeleaf完成数据显示,以及交互。 使用 1.添加依赖 <properties> <!-- thymeleaf2 layout1--> <thymeleaf-layout-dialect.version>2.4. 阅读全文
posted @ 2020-04-27 16:42 yangzhuxian 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 1.输出 print('hello world') 2.定义变量 variable=5 variable2='hello' 3.用户输入 user_input=input('提示内容') 4.逻辑运算符 and #两个都为true则为true or #一个条件为true则为true not #取反 阅读全文
posted @ 2020-04-08 11:04 yangzhuxian 阅读(344) 评论(0) 推荐(0) 编辑