![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
文章平均质量分 54
yeyu_xing
╔══╗ ♪
║██║ ♫
║ ( ● ) ♫
╚══╝♪ ♪
展开
-
flask+sqlalchemy+echarts动态显示数据
一、创建测试数据SET NAMES utf8mb4;SET FOREIGN_KEY_CHECKS = 0;-- ------------------------------ Table structure for user-- ----------------------------DROP TABLE IF EXISTS `user`;CREATE TABLE `user` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `name` var原创 2021-03-30 10:34:42 · 916 阅读 · 2 评论 -
UnboundLocalError: local variable x referenced before assignment
(一):多数情况a = 1def test(): a += 1test()解决办法:(1):将全局变量作为参数传入a = 1def test(a): a += 1 print(a)test(a)(2):在方法中定义局部变量a = 1def test(): a = 1 a += 1 print(a)test()(3):使用global关键字a = 1def test(): global a a += 1原创 2020-05-18 20:57:10 · 1338 阅读 · 0 评论 -
Python中matplotlib库的基本使用
一、绘制简单折线图import matplotlib.pyplot as pltimport random"""matplotlib入门(绘制折线图)"""x = range(0, 24, 2)print(list(x))y = [random.randint(23, 34) for num in range(0, 12)]plt.plot(x, y) # 绘制图形plt.show()二、绘制折线图并设置刻度import matplotlib.pyplot as plti原创 2021-03-10 10:15:41 · 514 阅读 · 1 评论