摘要: import numpy as np np.linspace(1,10,10) array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]) np.arange(1,10,1) array([1, 2, 3, 4, 5, 6, 7, 8, 9]) np.linspace(1,10,10,endpoint=False) array([1. , 1.9, 2.8, 阅读全文
posted @ 2019-11-06 13:05 dreamfor 阅读(2171) 评论(0) 推荐(0) 编辑
摘要: 镜像源设置 在C:\Users\Administrator\下建立pip文件夹,然后在里面创建了一个pip.ini 内容为: [global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple virtualenv安装 pip install v 阅读全文
posted @ 2016-10-21 23:22 dreamfor 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 输出: 9 8 7 6 5 4 3 2 1 0 109 8 7 6 4 3 2 1 0 9 8 7 6 4 3 2 110 1 0 True 阅读全文
posted @ 2016-10-20 15:31 dreamfor 阅读(2117) 评论(1) 推荐(0) 编辑
摘要: 1 #coding=utf-8 2 from urllib2 import urlopen 3 from bs4 import BeautifulSoup 4 import urllib2 5 url="http://pythonscraping.com/pages/page1.html" 6 def getTitle(url): 7 """ 8 说明一下,处理异... 阅读全文
posted @ 2016-10-05 15:43 dreamfor 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 本来是回答问题的,到这里做个笔记 *&L是指针的引用,实参是个指针。所以L是实参指针的别名,对别名L的修改,等于对实参的修改。*L是传值,你无法改变传过来的实参指针变量的值程序代码: #include<iostream>using namespace std;void foo(int*p);int 阅读全文
posted @ 2016-10-04 18:22 dreamfor 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 花了一天时间,终于是装好了。 这东西硬是把我从Python2掰弯成了Python3 本来用pip安装了一个pyqt,但是后来才发现,这是个x64版本的。 我不知道啊! 我以为是还要装qt5 所以我把qt5+vs2012一起安好了。 最后还是用pip3 install pyqt5弄好了,绕了一大圈,也 阅读全文
posted @ 2016-10-03 15:45 dreamfor 阅读(413) 评论(0) 推荐(0) 编辑
摘要: http://www.jb51.net/article/63672.htm 推荐参考 记住几个常用的用法就行,其余的要有个印象! 阅读全文
posted @ 2016-04-25 13:39 dreamfor 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 所以join的作用是保证当前线程执行完成后,再执行其它线程。join可以有timeout参数,表示阻塞其它线程timeout秒后,不再阻塞。详见官方文档。 阅读全文
posted @ 2016-04-21 22:10 dreamfor 阅读(9247) 评论(1) 推荐(1) 编辑
摘要: 1 import threading 2 import time 3 num=0 4 def Mylock(lock): 5 global num 6 lock.acquire() 7 num=num+1 8 time.sleep(1) 9 print num, 10 lock.release() 11 lock=threadin... 阅读全文
posted @ 2016-04-21 21:57 dreamfor 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 先看一个很简单的例子 如果需要一个无限长或者先进后出的队列 关于是否阻塞和timeout的问题 官方文档: Remove and return an item from the queue. If optional args block is true and timeout is None (th 阅读全文
posted @ 2016-04-21 17:17 dreamfor 阅读(3835) 评论(0) 推荐(1) 编辑