上一页 1 ··· 168 169 170 171 172 173 174 175 176 ··· 178 下一页
  2018年11月6日
摘要: 源自:https://blog.csdn.net/petermsh/article/details/78458585 1. 调用包函数绘制圆形Circle和椭圆Ellipse 2.用圆的参数方程画圆 以下源自:https://blog.csdn.net/qq_35882901/article/det 阅读全文
posted @ 2018-11-06 16:26 一杯明月 阅读(43253) 评论(0) 推荐(0)
摘要: 用quit()。 阅读全文
posted @ 2018-11-06 11:45 一杯明月 阅读(4704) 评论(0) 推荐(0)
摘要: 1.利用msgbox(单词messagebox的缩写)给出一个提示信息: import easygui as g reply=g.msgbox('This is a basic message box.', 'Title Goes Here') print(reply) #http://easygu 阅读全文
posted @ 2018-11-06 11:16 一杯明月 阅读(6492) 评论(0) 推荐(2)
摘要: try/except与其他语言相同,在python中,try/except语句主要是用于throw程序正常执行过程中出现的异常,如语法错(python作为脚本语言没有编译的环节,在执行过程中对语法进行检测,出错后发出异常消息)、数据除零错误、从未定义的变量上取值等;而try/finally语句则 阅读全文
posted @ 2018-11-06 10:53 一杯明月 阅读(15395) 评论(0) 推荐(1)
摘要: os.path.abspath(path) #返回绝对路径(包含文件名的全路径) os.path.basename(path) —— 去掉目录路径获取(带后缀的)文件名 os.path.dirname(path) —— 去掉文件名获取目录 os.path.split(path) —— 将全路径分解为 阅读全文
posted @ 2018-11-06 10:21 一杯明月 阅读(6849) 评论(0) 推荐(0)
  2018年11月5日
摘要: re模块 re.match 尝试从字符串的起始位置匹配一个模式,如果不是其实位置匹配成功的话,match()就返回None.[从起始位置开始匹配,只进行一次匹配]re.search 扫描整个字符串并返回第一个成功的匹配。【从任何位置开始匹配,只进行一次匹配】re.compile 用于编译正则表达式, 阅读全文
posted @ 2018-11-05 21:27 一杯明月 阅读(393) 评论(0) 推荐(0)
摘要: a=[i for i in range(10) if i%2==0]print(a)a=[i if i%2==0 else 'qi' for i in range(10)]print(a) 结果:[0, 2, 4, 6, 8][0, 'qi', 2, 'qi', 4, 'qi', 6, 'qi', 阅读全文
posted @ 2018-11-05 18:16 一杯明月 阅读(16001) 评论(0) 推荐(0)
摘要: 结果是:(array([1, 5, 6], dtype=int64),) 就是说,np.where()可以返回同一个元素在不同位置的索引。 结果是:1 就是说,a.index()返回指定元素第一个位置的索引。 阅读全文
posted @ 2018-11-05 16:50 一杯明月 阅读(14926) 评论(0) 推荐(0)
  2018年11月4日
摘要: text()函数用来给图加上说明性文字。 格式: text(x,y,'txt'); text(x,y,z,'string')在三维图形空间中的指定位置(x,y,z)上显示字符串string(matlab text用法及属性设置_matlab的text()-CSDN博客) 也可以加上颜色和字体大小设置 阅读全文
posted @ 2018-11-04 17:18 一杯明月 阅读(52411) 评论(0) 推荐(0)
摘要: mean(A,1):沿着第一维(列,竖着求)求平均值; mean(A,2):沿着第二维(行,横着求)求平均值; 举例: Z=[1 2 3;4 5 6]; >> mean(Z,1) ans = 2.5000 3.5000 4.5000 >> mean(Z,2) ans = 2 5 阅读全文
posted @ 2018-11-04 11:03 一杯明月 阅读(9351) 评论(0) 推荐(0)
上一页 1 ··· 168 169 170 171 172 173 174 175 176 ··· 178 下一页