摘要:
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, 阅读全文
摘要:
镜像源设置 在C:\Users\Administrator\下建立pip文件夹,然后在里面创建了一个pip.ini 内容为: [global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple virtualenv安装 pip install v 阅读全文
摘要:
输出: 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 阅读全文
摘要:
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 说明一下,处理异... 阅读全文
摘要:
本来是回答问题的,到这里做个笔记 *&L是指针的引用,实参是个指针。所以L是实参指针的别名,对别名L的修改,等于对实参的修改。*L是传值,你无法改变传过来的实参指针变量的值程序代码: #include<iostream>using namespace std;void foo(int*p);int 阅读全文
摘要:
花了一天时间,终于是装好了。 这东西硬是把我从Python2掰弯成了Python3 本来用pip安装了一个pyqt,但是后来才发现,这是个x64版本的。 我不知道啊! 我以为是还要装qt5 所以我把qt5+vs2012一起安好了。 最后还是用pip3 install pyqt5弄好了,绕了一大圈,也 阅读全文
摘要:
http://www.jb51.net/article/63672.htm 推荐参考 记住几个常用的用法就行,其余的要有个印象! 阅读全文
摘要:
所以join的作用是保证当前线程执行完成后,再执行其它线程。join可以有timeout参数,表示阻塞其它线程timeout秒后,不再阻塞。详见官方文档。 阅读全文
摘要:
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... 阅读全文
摘要:
先看一个很简单的例子 如果需要一个无限长或者先进后出的队列 关于是否阻塞和timeout的问题 官方文档: Remove and return an item from the queue. If optional args block is true and timeout is None (th 阅读全文