![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 64
theArcticOcean
Website: https://www.weiy.city
Wechat Subscription Account: 胡桃小院
展开
-
python的初级训练
读了一点《A Byte Of Python》,对python有了初步的认识,但是没有动手练练总是不行的。所以在zoj上找了几道简单题用python写一写:zoj 1001 A+B Problem题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1001大意就是输出两个数的和。import sys原创 2015-07-23 15:01:07 · 601 阅读 · 0 评论 -
waf 编译入门小练习
原始工程源码在:https://github.com/theArcticOcean/CLib/tree/master/myLocker目录结构为Make编译工具对应的Makefile:DEPEND = pthTextCode.o main.o public.o pthTextRW.o pthLocker.oLIB = -lpthreadCFLAGS = -gdwa...原创 2018-06-16 18:09:13 · 2188 阅读 · 0 评论 -
python与正则表达式
正则表达式推荐一本书:《Sams Teach Yourself Regular Expressions in 10 Minutes》。 下面列举常用的regex元字符……原创 2017-11-25 20:45:54 · 434 阅读 · 0 评论 -
python 更换windows壁纸(简单)
本文定期更换windows壁纸的python程序,很简单,属于自己写着玩的那种,不提供完美的壁纸切换解决方案。原创 2017-10-15 13:03:47 · 3538 阅读 · 3 评论 -
C++、Qt内嵌python
C++内嵌pythonpython重要的路径:/usr/local/include/python3.6m/usr/local/bin/python3-config/usr/local/bin/python3.6/usr/local/bin/python3/usr/local/bin/python3.6-config/usr/local/bin/python3.6m/usr/local/b原创 2017-09-25 08:09:26 · 1470 阅读 · 0 评论 -
python自动发送短信
Twilio是一个SMS (Short Message Service)网关服务,可以通过程序发送短信。 首先,注册Twilio服务,网址:https://www.twilio.com/。 完成后,会得到Account SID,Auth Token以及一个Twilio Phone Number。这都是是我们需要的。pip3 安装第三方库twiliopip 工具 从 Python 软件基金会的网站原创 2017-07-02 16:58:21 · 2377 阅读 · 0 评论 -
python之各种二分查找
很多时候,我们需要在一堆数字查找的不仅仅是目标值,还可能是比它大的,比它小的,大于等于它的,小于等于它的临近值。现在,老师正在验收作业,我无聊的等待。。。写写python,总结一下这些二分。array=[4,2,6,1,45,23,27,12,89,5]# for key:find '==' valuedef midfind(key): length=len(array)原创 2015-12-26 15:35:12 · 1288 阅读 · 0 评论 -
python数据结构及部分语法笔记
python data structure List(列表)、Tuple(元组)、Dictionary(字典)、Set(集合)和Sequences(序列)list无固定长度,可变。 list的部分截取:animals = "catdogfrog"cat = animals[:3] # The first three characters of animalsdog = animals[原创 2016-06-18 19:16:58 · 715 阅读 · 0 评论 -
爬虫应用——寻找乔丹相关10条URL
直接百度乔丹的URL是这样的: root-url: http://baike.baidu.com/link?url=Htp0lISd4ld46oenEs4HvYh13u8iTht9YxBpUY8e3QECSsxXYQRg_yr7R_wvRos3kWflwekkcn_5VuZsgEhFPY_oQAKj8xla3F6MXbCoDnirERpJEyVuHZ3uGGvpmfwVz_rsdygPH5wir原创 2016-06-25 11:19:56 · 1022 阅读 · 0 评论 -
爬虫初步
爬虫是什么?一段自动抓取互联网信息的程序爬虫的价值:获取想要的互联网数据简单爬虫架构:爬虫调度端(监视爬虫的运行情况) URL管理器 (管理没有爬取的URl, 已经爬取的URl) 网页下载器(如urllib2) 网页解析器(如BeautifulSoup,提取出有价值的信息)URL管理器有内存、关系数据库、缓存数据库三种途径实现管理网页下载器urllib2(官方基础模块)、requests(原创 2016-06-25 10:15:28 · 1055 阅读 · 0 评论 -
python module
《A Byte Of Python》学习笔记:一个关键的概念:every python program is also a module.可以用库调用模块(modules)。 sys module is a bulit-in module of python. the sys.argv variable is a list of strings. the name of the scr原创 2015-11-29 20:25:47 · 676 阅读 · 0 评论 -
python的参数
在python的方法中,默认参数通常放在非默认参数的后面:def out(massege,times=1): print massege*timesout('hello ')out('hello ',5)>>> hello hello hello hello hello hello >>> 位置参数:参数的值由对应的位置决定关键字参数:参数的值由关键字信息决定原创 2015-11-18 17:00:35 · 569 阅读 · 0 评论 -
python练习:逆波兰,冒泡排序,快速排序
上实验,老师讲得太无聊,电脑上只有python还能玩玩,于是我悄悄地敲代码。。python 删除序列里多余的元素:>>> a=[1,2,2,2,3,4,5,5,5]>>> b=set(a)>>> print(b)set([1, 2, 3, 4, 5])>>> b=list(b)>>> print(b)output: [1, 2, 3, 4, 5]冒泡排序:原创 2015-10-30 14:55:10 · 737 阅读 · 1 评论 -
python的循环,pass和DocString
先来说说最简单的while循环和for循环:while循环和C的相似性更高:while 1>0: guess=int(input('enter a number: ')) if guess==23: print 'guess right!' break elif guess>23: print 'higher'原创 2015-11-20 10:25:50 · 778 阅读 · 0 评论 -
learn vtk by Python script on mac
之前写过一篇文章:learn vtk by Tcl script on mac本文介绍vtk的Python学习环境的创建。j基础环境:VTK-8.1.1macOS Mojave 10.14Python 2.7.10build vtk,CMake一下:cmake ./ -G "Unix Makefiles" \-DVTK_USE_QVTK:BOOL=ON \-DCMAKE_IN...原创 2018-10-20 10:02:00 · 743 阅读 · 0 评论