
python
-缘故-
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python post上传文件
poster 下载 https://pypi.python.org/pypi/poster 安装 http://blog.163.com/yang_jianli/blog/static/161990006201162152724339/ python setup.py install#!/usr/bin/python # -*- coding: utf-8 -*-from poster.en原创 2017-09-05 13:00:25 · 6145 阅读 · 2 评论 -
python datetime 加密 笔记
datetime #!/usr/bin/python # -*- coding: utf-8 -*- from datetime import datetime#timestamp -> datetime print(datetime.fromtimestamp(123123123.1321)) #datetime -> timestamp print(datetime.now().timestam原创 2017-09-06 10:14:03 · 304 阅读 · 0 评论 -
python redis 操作
redis 操作 #!/usr/bin/env python # -*- coding: utf-8 -*- from redis import Redis rds = Redis('hostname', password='password') s = "test_data" rds.set('KEY', s) ---------- add set from redi...原创 2018-02-11 09:51:37 · 278 阅读 · 0 评论 -
python 读取json文件
读写文件 try: with open('/black.json') as filein: black_uids = json.loads(filein.read()) users = black_uids.get('uids', []) print 'black:', users except Exception as e: ...原创 2018-02-11 09:53:27 · 381 阅读 · 0 评论 -
python 发送http请求
http请求 import urllib import urllib2 req = urllib2.Request(url = req_url,data = '') resp2 = urllib2.urlopen(req).read()原创 2018-02-11 09:54:22 · 747 阅读 · 0 评论 -
python笔记 hostname, log库, globals,locals
hostname import socket hostname = socket.gethostname() print hostname # china-43sd6208c ip = socket.gethostbyname(hostname) print ip # 12.18.11.16 ipList = socket.gethostbyname_ex(hostname) pri...原创 2019-01-02 10:22:26 · 227 阅读 · 0 评论