python
jing16337305
DGHJ
展开
-
Python建立多线程任务并获取每个线程返回值
Python建立多线程任务并获取每个线程返回值转载自:https://www.cnblogs.com/bethansy/p/7965820.html1.进程和线程 (1)进程是一个执行中的程序。每个进程都拥有自己的地址空间、内存、数据栈以及其他用于跟踪执行的辅助数据。进程也可以派生新的进程来执行其他任务,不过每个新进程都拥有自己的内存和数据栈,所以只能采用进程间通信(IPC)的方式共享信息。...转载 2018-04-13 16:30:20 · 4306 阅读 · 0 评论 -
用Python计划实现的目标
使用Python进行爬虫,爬取火车车次,发车时间等信息。开发一个能够获取车次,时间,始发地,终点站,经过站点。各种座位以及对应价格的app。原创 2018-03-05 21:57:57 · 879 阅读 · 0 评论 -
Python官网的发现和收获
Python官网是:https://www.python.org/ 官网首页介绍了关于Python的一些信息,下载,文档,社区,成功的故事,新闻和活动。 Python被广泛使用。Python为Web的发展提供了许多选择,其标准库支持许多Internet协议。除此之外,Python还被广泛用于科学计算和数字计算,而且Python还是一门用于教学的优秀的高级语言。Python经常被开发人员...原创 2018-03-05 21:49:01 · 602 阅读 · 0 评论 -
python第11周作业
1.Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈ Rn×m and B ∈ Rm×m,for n = 200, m = 500.import numpy as np import timeimport scipyimport scipy.linalgnp.random....原创 2018-05-20 22:57:08 · 311 阅读 · 0 评论 -
python中的json对象字符串转化
转自 https://www.cnblogs.com/qq78292959/p/3467937.html 什么是json:JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScript Programming Language, Standard ECMA-262 3rd Edition - De...转载 2018-05-08 11:02:59 · 1592 阅读 · 0 评论 -
python的字符串与json的字符串互相转化
python的字符串转化为json的字符串:tests = "adv"s = json.dumps(tests)print(type(s))print(s)结果:<class 'str'>"adv"json字符串格式转化为python的字符串tests = '"adv"'s = json.loads(tests)print(type(s))print(s)结果:<class 's...原创 2018-05-08 11:23:23 · 4837 阅读 · 0 评论 -
pyhton第13周作业
Exercise 10.1: Least squaresGenerate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm.Now find x = arg minx kAx − bk2.Print the norm of the residual.import numpy as np A = np.random.r...原创 2018-06-02 19:35:16 · 258 阅读 · 0 评论 -
通过编写聊天程序来熟悉python中多线程及socket的用法
转载自:https://www.cnblogs.com/mingjiatang/p/4905395.html通过编写聊天程序来熟悉python中多线程及socket的用法1、引言Python中提供了丰富的开源库,方便开发者快速就搭建好自己所需要的应用程序。本文通过编写基于tcp/ip协议的通信程序来熟悉python中socket以及多线程的使用。2、python中的多线程以及socket的使用在编...转载 2018-06-03 11:51:29 · 337 阅读 · 0 评论 -
python第12周作业
Exercise 11.1: Plotting a functionPlot the functionf(x) = sin2(x − 2)e−x2over the interval [0, 2]. Add proper axis labels, a title, etc.import numpy as np import matplotlib.pyplot as pltx = np.lins...原创 2018-05-27 15:32:05 · 323 阅读 · 0 评论 -
python第十四周作业
Part 1¶For each of the four datasets...Compute the mean and variance of both x and yCompute the correlation coefficient between x and yCompute the linear regression line: y=β 0 +β 1 x+ϵ y=β0+β1x+ϵ (hi...原创 2018-06-11 17:10:24 · 270 阅读 · 0 评论 -
python第15周作业
代码from sklearn import metricsfrom sklearn import datasetsfrom sklearn import cross_validationfrom sklearn.naive_bayes import GaussianNBfrom sklearn.svm import SVCfrom sklearn.ensemble import Rand...原创 2018-06-19 22:09:33 · 276 阅读 · 0 评论 -
Python作业2.1-2.10 3月8日
2.1msg = "Hello!"print(msg)2.2msg = "Hello!"print(msg)msg = "You"print(msg)2.3name = "Eric"print("Hello, " + name + "would you like to learn some Python today?")2.4name = "Eric"pr原创 2018-03-08 16:57:44 · 169 阅读 · 0 评论 -
第二周第一次作业Python3.1-3.11
#3.1names = ["John","Joe","Janes"]for name in names: print(name)#3.2names = ["John","Joe","Janes"]for name in names: print(name + ", Hello!")#3.3tools = ["bike"原创 2018-03-12 21:53:33 · 197 阅读 · 0 评论 -
Python第六周第一次作业
#11.1#11.21.2.#11.3#10.11原创 2018-04-09 21:18:39 · 260 阅读 · 0 评论 -
Python 获取当前所在目录的方法详解
Python 获取当前所在目录的方法详解转载 2017-08-02 作者:RustFisher 我要评论 本文给大家讲解的是使用python获取当前所在目录的方法以及相关示例,非常的清晰简单,有需要的小伙伴可以参考下sys.path模块搜索路径的字符串列表。由环境变量PYTHONPATH初始化得到。sys.path[0]是调用Python解释器的当前脚本所在的目录。sys.argv一...转载 2018-04-08 16:45:00 · 5855 阅读 · 0 评论 -
Python第五周第二次作业
原创 2018-04-04 22:12:24 · 180 阅读 · 0 评论 -
Python第五周第一次作业
原创 2018-04-02 23:04:04 · 210 阅读 · 0 评论 -
Python第四周第二次作业
原创 2018-03-27 23:21:10 · 166 阅读 · 0 评论 -
Python第四周第一次作业
原创 2018-03-25 20:23:37 · 277 阅读 · 0 评论 -
Python第三周第二次作业
#6.1name = {"first_name":"Ha", "last_name":"HE", "age":20, "city":"Guangdong"}for key, value in name.items(): print(key + " " + str(value))#6.2fnum = {"Huang&quo原创 2018-03-21 21:55:55 · 352 阅读 · 0 评论 -
第三周PYthon 第一次作业
#5.1car = 'subaru'print("Is car == 'subaru'? I predict True.")print(car == 'subaru')print("\nIs car == 'audi'? I predict False.")print(car == 'audi')car = 'car'print("Is car == 'car'? I predic...原创 2018-03-19 21:08:30 · 338 阅读 · 0 评论 -
win10下Python3.6安装、配置以及pip安装包教程
转载自:https://www.cnblogs.com/PyLearn/p/7615424.html 0.目录1.前言2.安装python3.使用pip下载、安装包3.1 安装Scrapy3.2 安装PyQt3.3 同时安装多个包3.4 pip的常用命令1.前言之前在电脑上安装了python3.6.2(目前是最新版),可以看到,是2017-07-17才出的。因此,我发现有三个重要的包:Scrapy...转载 2018-03-17 15:38:00 · 16229 阅读 · 0 评论 -
第二周第二次作业Python4.1-4.15
#4.1p = ["A", "B","C"]for pp in p: print("I like "+ pp + " pizza!")print(p[1]+" is good!" +p[2]+" is good!"+p[0]+" is good!")print("I love pizza!")#4.2an =原创 2018-03-15 17:09:31 · 197 阅读 · 0 评论