摘要: 1234 """ 阅读全文
posted @ 2018-12-06 08:28 疯狂的骆驼 阅读(350) 评论(0) 推荐(0) 编辑
摘要: import numpy as np ret = np.arange(3) print(ret) """ 运行结果 [0 1 2] """ import numpy as npret = np.array([1,2,3,4])print(ret)"""运行结果[1 2 3 4]""" import numpy as npret = np.ones(5)print(ret)ret2 = np.z... 阅读全文
posted @ 2018-12-06 07:20 疯狂的骆驼 阅读(252) 评论(0) 推荐(0) 编辑
摘要: import numpy as np # 定义一个数组 test_array = np.array([[1 ,2 ,3] ,[3 ,4 ,5]]) ###数组简单的加减乘除法 # 加法 print(test_arra y +1) # 返回[[2 3 4][4 5 6]] # 减法 print(test_arra y -11) # 返回[[-10 -9 -8][ -8 -7 -6]] ... 阅读全文
posted @ 2018-12-06 06:56 疯狂的骆驼 阅读(647) 评论(0) 推荐(0) 编辑
摘要: # 多个列表组合成一个列表 d = [['10', '22', '34', '46'],['11', '23', '35', '47'],['18', '23', '42', '06']]print(sum(d,[]))"""['10', '22', '34', '46', '11', ' 阅读全文
posted @ 2018-12-06 05:38 疯狂的骆驼 阅读(147) 评论(0) 推荐(0) 编辑
摘要: python中itertools里的product和permutation 平时经常碰到全排列或者在n个数组中每个数组选一个值组成的所有序列等等问题,可以用permutation和product解决,很方便,所以在此mark一下吧 直接上代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ... 阅读全文
posted @ 2018-12-06 05:34 疯狂的骆驼 阅读(1570) 评论(0) 推荐(0) 编辑
摘要: (1)abs(), 绝对值或复数的模 (2)all() 接受一个迭代器,如果迭代器的所有元素都为真,那么返回True,否则返回False (3)any() 接受一个迭代器,如果迭代器里有一个元素为真,那么返回True,否则返回False (4)ascii() 调用对象的__repr__()方法,获得 阅读全文
posted @ 2018-12-02 04:31 疯狂的骆驼 阅读(236) 评论(0) 推荐(0) 编辑
摘要: def Right_click(self,pos): row_num = -1 for i in self.tableWidget.selectionModel().selection().indexes(): row_num = i.row() # if row_num <2: menu = ... 阅读全文
posted @ 2018-11-22 22:08 疯狂的骆驼 阅读(140) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class DialogDemo(QMainWindow): def __init__(self, parent=None): ... 阅读全文
posted @ 2018-11-22 22:07 疯狂的骆驼 阅读(243) 评论(0) 推荐(0) 编辑
摘要: self.box = QMessageBox(QMessageBox.Information, "温馨提示", "%s"% txt)qyes = self.box.addButton(self.tr("确定"), QMessageBox.YesRole).animateClick(1*1000)#1 阅读全文
posted @ 2018-11-15 03:48 疯狂的骆驼 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1.创建窗口1 打开pycharm,打开Qt Designer,创建窗口 修改主窗口大小和名字等 使用容器布局,在添加一个button控件 2.创建窗口2 继续创建一个窗口 3.将两个.ui转换成.py 4.分别运行一下这两个文件能不能生成在qt里面的ui 分别添加代码如下并运行: 5.从主窗口来调 阅读全文
posted @ 2018-11-15 02:57 疯狂的骆驼 阅读(258) 评论(0) 推荐(0) 编辑