【开发环境】:

Python 3.3   http://rj.baidu.com/soft/detail/25283.html   大小:20.2M   版本:3.3.5150  位数:64   更新日期:2014-03-14

在本机运行*.py文件: c:\Python33\python zz.py

Python 3.4.3  http://rj.baidu.com/soft/detail/25283.html   大小:23.7M   版本:3.4.16490   位数:64   更新日期:2015-07-24

PyCharm4.5.4  http://www.jetbrains.com/pycharm/download/     下载:(左侧完全版)

  在PyCharm里,永久显示行号办法:File --> Settings -->Editor -->General -->Appearance , 之后勾选Show Line Numbers。2017-3-23

  http://blog.csdn.net/pipisorry/article/details/39909057  pycharm快捷键、常用设置、配置管理  2017-4-6

Ctrl + D  复制当前行(复制选定的区域或行)

【第三方库】

http://www.crummy.com/software/BeautifulSoup/bs4/download/   Beautifulsoup4.4.1   2015-11-1

http://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/   Beautiful Soup 4.2.0 文档  2015-10-20

【手册】

http://docs.pythontab.com/   在线手册

【安装】

http://www.cnblogs.com/yuanzm/p/4089856.html   windows下面安装Python和pip终极教程  2015-10-30

  windows下添加python的路径:我的电脑 -> 属性 -> 点击高级系统设置 ->  高级 -> 点击“环境变量”,添加:
  变量填写: PATH
  变量值填写:C:\Python34
  PIP:
  https://pypi.python.org/pypi/pip#downloads  下载解包 pip-7.1.2.tar.gz  ,进入解压缩目录,输入:python setup.py install

  在windows中,再添加系统变量:
  变量填写: PATH
  变量值填写: C:\Python34;C:\Python34\Scripts;

  安装 beautifulsoup:

  打开cmd,进入目录:c:\beautifulsoup
  输入:python setup.py build
  输入:python setup.py install
  想知道安装了哪些包,可以用 pip list 查看

http://jingyan.baidu.com/article/a378c9608fbf7db3282830f6.html editplus配置python开发环境

http://blog.jobbole.com/72306/   python 开源框架

http://www.oschina.net/news/57468/best-python-ide-for-developers   IDE

http://www.oschina.net/news/43167/130-essential-vim-commands   VIM 命令

http://www.cnblogs.com/elaron/p/3213333.html   网络爬虫(需要再看)  2015-11-1

http://blog.92fenxiang.com/articles/1427366991   爬虫2

http://www.169it.com/article/10082287536227590022.html   python下xml解析库lxml最新版下载安装以及代码示例

http://blog.csdn.net/cnmilan/article/details/9142561   Python 的文件IO相关操作说明

http://www.1point3acres.com/bbs/thread-83337-1-1.html   手把手教你用python抓网页数据(还未试过)   2015-10-20

http://cuiqingcai.com/1319.html      Python爬虫入门八之Beautiful Soup的用法(未看 可参考)  2015-10-20

http://www.xprogrammer.com/1258.html   python编码问题总结

http://www.vaikan.com/improving-your-python-productivity/   Python高效编程技巧  2015-10-27

http://www.2cto.com/kf/201401/276088.html  时间(参考)

http://andrewliu.in/2015/11/14/Python%E5%A5%87%E6%8A%80%E6%B7%AB%E5%B7%A7/?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io   几个技巧

http://bigdatadigest.baijia.baidu.com/article/259542  抢票  2015-12-11

http://andrewliu.in/2015/11/14/Python奇技淫巧/?hmsr=toutiao.io   Python奇技淫巧

http://codingpy.com/article/getting-started-with-pycharm-video-tutorials/  PyCharm官方推出最新入门视频教程  2016-1-21

http://blog.csdn.net/xingjiarong/article/details/50651235  python编程常用模板总结(读文件、连接mysql、socket、多线程等)  2016-2-14

http://www.ruanyifeng.com/blog/2017/08/smart-shoes.html  你的鞋都比你聪明  2017-8-29

http://blog.csdn.net/lixingshi/article/details/54928086  Python语言在人工智能(AI)中的优势(库:numpy 、NLTK、sk-learn、pandas 、 PyTorch)  2017-8-29


练习用的代码段

中文:

# -*- coding: utf-8 -*-
#coding=utf-8

存为utf-8格式的文件:

# -*- coding: utf-8 -*-
import codecs;
f = codecs.open('d:/test111.txt', 'w', 'utf-8');
f.write('存为utf-8格式的文件..............')
f.close();

保存文件:

#保存文件
string = 'ssssssss'
#string = input('please input string:')
with open('d:/test223.txt', 'a') as file:
file.write(string)
file.close()

输出多行文本:2015-12-31

print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''
# 结果是两行文字

输入两个数字,排序:

#输入两个数字,排序
x = int(input('please input x:'))
y = int(input('please input y:'))
if x > y :
x, y = y, x
print(x,y)

循环:

#循环
for i in range(2,10):
if i%2==0:
print ("偶数",i)
else:
print ("奇数",i)

int与string之间的转化:

int('12')       #10进制string --> int
int('ff', 16) #16进制string --> int
str(18) #int --> 10进制string
hex(18) #int --> 16进制string

当前时间:

import time
now=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(int(time.time())-24*60*60))
print(now)

时间戳转换为指定日期:

# -*- coding: utf-8 -*-
#时间戳转换为指定格式日期:
import time
#timeStamp = 1381419600
timeStamp = int(time.time()) #当前时间戳
timeArray = time.localtime(timeStamp) #本地时间
formatTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
print(formatTime) import datetime
#获得当前时间
now = datetime.datetime.now() #这是时间数组格式
formatTime = now.strftime("%Y-%m-%d %H:%M:%S")
print(formatTime)

将字符串的时间转为时间戳

#将字符串的时间转换为时间戳
import time
now = "2015-11-1 23:30:00"
timeArray = time.strptime(now, "%Y-%m-%d %H:%M:%S")
timeStamp = int(time.mktime(timeArray))
print(timeStamp) #字符串格式更改: 如now = "2015-11-01 23:30:00",想改为 now = "2015年11月01日 23:40:00"
#方法:先转换为时间数组,然后转换为其他格式
import time
now = "2015-11-01 23:30:00"
timeArray = time.strptime(now,"%Y-%m-%d %H:%M:%S")
formatTime = time.strftime("%Y/%m/%d %H:%M:%S", timeArray)
print(formatTime)

计算3天以前:

#计算3天以前
import time
import datetime
threeDayAgo = (datetime.datetime.now() - datetime.timedelta(days = 3))
timeStamp = int(time.mktime(threeDayAgo.timetuple()))
formatTime = threeDayAgo.strftime("%Y-%m-%d %H:%M:%S")
print(formatTime)

扒取页面并保存:

#扒取页面并保存
import urllib.request as request
url = "http://www.163.com/"
doc = request.urlopen(url).read()
with open('d:/test.txt','wb') as file:
file.write(doc)
file.close()

存成utf-8文件:

# -*- coding: utf-8 -*-
import codecs
for i in range(2,5):
iii=str(i) #数字转字符串
doc = ('数值是: '+iii)
if i%2==0:
doc += (" 偶数")
else:
doc += (" 奇数")
f = codecs.open('d:/test'+iii+'.txt', 'w', 'utf-8');
f.write(doc)
f.close()

..

http://download.csdn.net/album/detail/3117/2  Python学习教程集(全免费)  2016-6-6

笔记:python (2015)的更多相关文章

  1. 阅读OReilly.Web.Scraping.with.Python.2015.6笔记---Crawl

    阅读OReilly.Web.Scraping.with.Python.2015.6笔记---Crawl 1.函数调用它自身,这样就形成了一个循环,一环套一环: from urllib.request ...

  2. 阅读OReilly.Web.Scraping.with.Python.2015.6笔记---找出网页中所有的href

    阅读OReilly.Web.Scraping.with.Python.2015.6笔记---找出网页中所有的href 1.查找以<a>开头的所有文本,然后判断href是否在<a> ...

  3. 阅读OReilly.Web.Scraping.with.Python.2015.6笔记---BeautifulSoup---findAll

    阅读OReilly.Web.Scraping.with.Python.2015.6笔记---BeautifulSoup---findAll 1..BeautifulSoup库的使用 Beautiful ...

  4. 笔记-python操作mysql

    笔记-python操作mysql 1.      开始 1.1.    环境准备-mysql create database db_python; use db_python; create tabl ...

  5. 笔记-python异常信息输出

    笔记-python异常信息输出 1.      异常信息输出 python异常捕获使用try-except-else-finally语句: 在except 语句中可以使用except as e,然后通 ...

  6. 笔记-python -asynio

    笔记-python -asynio 1.      简介 asyncio是做什么的? asyncio is a library to write concurrent code using the a ...

  7. 笔记-python lib-pymongo

    笔记-python lib-pymongo 1.      开始 pymongo是python版的连接库,最新版为3.7.2. 文档地址:https://pypi.org/project/pymong ...

  8. 笔记-python tutorial-9.classes

    笔记-python tutorial-9.classes 1.      Classes 1.1.    scopes and namespaces namespace: A namespace is ...

  9. MongoDB学习笔记:Python 操作MongoDB

    MongoDB学习笔记:Python 操作MongoDB   Pymongo 安装 安装pymongopip install pymongoPyMongo是驱动程序,使python程序能够使用Mong ...

随机推荐

  1. 2、AngularJs 过滤器($filter)

    1.内置过滤器: currency ({{123|currency}}) date (medium\short\fullDate\longDate\mediumDate\shortDate\mediu ...

  2. secondPage

    写的第二个页面,参照着别人的代码,网上找寻自己需要的标签,每个小地方都得试许多次才能明白标签的正确使用方法,自己动手写出来一个页面虽然超级粗糙,但是挺有收获的. <!DOCTYPE html&g ...

  3. Unity3d外部加载音频,视频,图片等资源 及根据路径获取制定格式的文件

    1.根据路径获取制定文件类型的文件: 这里写一个类,调用了打开路径的方法:using UnityEngine;using System;using System.Collections.Generic ...

  4. python的安装和配置

    第一步,我们先来安装Python,博主选择的版本是最新的3.4.2版本.windows下面的Python安装一般是通过软件安装包安装而不是命令行,所以我们首先要在Python的官方主页上面下载最新的P ...

  5. java基础学习之接口

    接口可以说是一个特殊的抽象类,接口里的方法都是抽象方法, 接口的特点: 1.一个类可以实现多个接口,也可以在继承一个类后继续实现多个接口(多实现间接支持了类的多继承) 2.接口可以继承另一个接口,并且 ...

  6. Element分页组件prev-text和next-text属性无效?

    前情提要 /(ㄒoㄒ)/~~ 作为刚刚接触 Element 组件的人来说,看文档是第一步,但是当我想要修改分页组件里面的按钮时却遇到了问题. 文档中写到是需要给 prev-text 和 next-te ...

  7. OpenCV实现彩色图像轮廓 换背景颜色

    转摘请注明:https://i.cnblogs.com/EditPosts.aspx?opt=1 有时候我们需要不一样颜色的证件照,下面就用OpenCV来实现证件照的蓝底.红底等换颜色: 代码如下: ...

  8. SQL-记录-005

    对于记录的操作涉及的知识比较多,分多篇文章进行梳理. 记录创建篇:记录删除篇:记录修改篇:记录查询篇:

  9. hive入门学习线路指导

    hive被大多数企业使用,学习它,利于自己掌握企业所使用的技术,这里从安装使用到概念.原理及如何使用遇到的问题,来讲解hive,希望对大家有所帮助.此篇内容较多:看完之后需要达到的目标1.hive是什 ...

  10. rabbitmq management advance lesson

    rabbitmq management advance management install rabbitmq-plugins enable rabbitmq_management visit : h ...