上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 37 下一页

2017年12月16日

摘要: #coding=utf-8"""def funA(arg): print 'A' a = arg() @funA def funB(): print 'B'"""'''python类里会出现这三个单词,self和cls都可以用别的单词代替,类的方法有三种, 一是通过def定义的 普通的一般的,需要至 阅读全文
posted @ 2017-12-16 12:56 sunny_2016 阅读(141) 评论(0) 推荐(0)

2017年12月6日

摘要: #coding=utf-8import timefrom selenium import webdriverdr = webdriver.Chrome()# dr = webdriver.Ie()dr.maximize_window()dr.implicitly_wait(3)dr.get("htt 阅读全文
posted @ 2017-12-06 13:55 sunny_2016 阅读(432) 评论(0) 推荐(0)

2017年11月30日

摘要: #os模块import oscurDir = os.getcwd()print(curDir) os.mkdir("新建") import timetime.sleep(2)os.rename("新建","文件")time.sleep(2)os.rmdir("文件") #多行打印 print(''' 阅读全文
posted @ 2017-11-30 13:43 sunny_2016 阅读(138) 评论(0) 推荐(0)
摘要: #sys模块import sys sys.stderr.write('This is stderr text\n')# 因为从定向有缓冲区,所以需要以下这行代码sys.stderr.flush()sys.stdout.write('This is stdout text\n') # 获取命令行参数, 阅读全文
posted @ 2017-11-30 13:41 sunny_2016 阅读(145) 评论(0) 推荐(0)
摘要: # 正则表达式 ''''' 正则表达式是有一些特殊字符组成,能够帮你找到一些符合一定规则的字符串 先来了解几个符号所代表的意思 \d 匹配所有的数字 \D 匹配所有,但是数字除外 \s 空格 \S 匹配所有但是空格除外 \w 匹配所有的字母 \W 匹配所有但是字母除外 . 任意除换行符 \n \. 阅读全文
posted @ 2017-11-30 13:40 sunny_2016 阅读(137) 评论(0) 推荐(0)
摘要: from cx_Freeze import setup, Executable setup(name='test to exe', version = '0.1', description='test from py file to exe file', executables = [Executa 阅读全文
posted @ 2017-11-30 13:39 sunny_2016 阅读(105) 评论(0) 推荐(0)
摘要: import threading def exampleFun(): #打印当前激活的线程数量 print(threading.active_count) #查看上面激活的线程是哪几个 print(threading.enumerate()) exampleFun() #创建线程 def examp 阅读全文
posted @ 2017-11-30 13:37 sunny_2016 阅读(154) 评论(0) 推荐(0)
摘要: # 可以设置颜色,g代表green, r代表red,y代表yellow,b代表blue# linewidth = 5,设置线条粗细 # label 设置线条名称 ##plt.plot(x,y,'b',linewidth=5,label='Line One')##plt.plot(x1,y1,'r', 阅读全文
posted @ 2017-11-30 13:36 sunny_2016 阅读(247) 评论(0) 推荐(0)

2017年11月29日

摘要: #coding=utf-8#python2.7实现 from selenium import webdriver import re dr = webdriver.Chrome() dr.maximize_window() dr.implicitly_wait(6) dr.get("http://h 阅读全文
posted @ 2017-11-29 13:10 sunny_2016 阅读(154) 评论(0) 推荐(0)

2017年11月25日

摘要: #比较大小#name:maxNumber.py#比较两个数大小#C:\Users\Anthony\AppData\Local\Programs\Python\Python36-32\Lib\site-packagesdef maxTwo(x,y): if x > y: print(x) else: 阅读全文
posted @ 2017-11-25 13:41 sunny_2016 阅读(137) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 37 下一页

导航