上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 56 下一页

2018年4月18日

MAC下是用brew安装Redis

摘要: 安装brew 在命令行里运行下面的命令,需要等待一段时间。 安装Redis 安装完成后可以是用下面的命令来查看是否安装成功 安装完成后就可以来安装redis了 运行 其他 运行后自动在后台运行,关闭后也会继续运行。可以使用端口检测命令来查看。 阅读全文

posted @ 2018-04-18 20:52 星河赵 阅读(426) 评论(0) 推荐(0) 编辑

python用zipfile模块打包文件或是目录、解压zip文件实例

摘要: #!/usr/bin/env python # -*- coding: utf-8 -*- from zipfile import * import zipfile #解压zip文件 def unzip(): source_zip="c:\\update\\SW_Servers_20120815.zip" target_dir="c:\\update\\" ... 阅读全文

posted @ 2018-04-18 12:37 星河赵 阅读(3054) 评论(0) 推荐(0) 编辑

2018年4月17日

python 发送邮件 带附件

摘要: # coding:utf-8 # __author__ = 'Mark sinoberg' # __date__ = '2016/5/26' # __Desc__ = 实现发送带有各种附件类型的邮件 import urllib, urllib2 import smtplib from email.mime.multipart import MIMEMultipart fro... 阅读全文

posted @ 2018-04-17 18:57 星河赵 阅读(288) 评论(0) 推荐(0) 编辑

2018年4月11日

python 类的继承

摘要: XNginxLog.py 注意:Python2 父类 XNginxLog(object) 必须要加object XAdNginxLog.py 使用 log_obj = XAdNginxLog(p_line=line) 阅读全文

posted @ 2018-04-11 19:38 星河赵 阅读(159) 评论(0) 推荐(0) 编辑

OSX系统添加定时任务 Linux crontab命令 定时执行py 文件 任务

摘要: #输出日志 # cpd_$(date +"\%Y-\%m-\%d_\%H").log 按照日期输出日志 OS X是苹果Mac的操作系统。今天遇到了一个想向系统里添加定时任务的问题。比如我想在12点运行一个脚本,而这个时间我又要出去吃饭。这个时候就可以通过增加定时任务的办法来解决。 这里主要提供两种方 阅读全文

posted @ 2018-04-11 19:06 星河赵 阅读(291) 评论(0) 推荐(0) 编辑

2018年4月10日

python 创建txt并且写入做追加

摘要: import os def create_str_to_txt(self,date,str_data): """ 创建txt,并且写入 """ path_file_name = './report/action_{}.txt'.format(date) if not os.path.exists(path_file_name): with ... 阅读全文

posted @ 2018-04-10 16:42 星河赵 阅读(15152) 评论(0) 推荐(1) 编辑

2018年4月8日

git 常用命令以及解决问题方法

摘要: 1. 创建分支: git branch test 2.切换分支: git checkout test 或切换为主分支 git checkout master 3.查看当前分支 git branch -va 4. 如:当前分支为test 要合并dev分支 git merge dev 后确保没问题 切换 阅读全文

posted @ 2018-04-08 18:18 星河赵 阅读(292) 评论(0) 推荐(0) 编辑

替换python字典中的key值

摘要: 阅读全文

posted @ 2018-04-08 11:49 星河赵 阅读(2526) 评论(0) 推荐(0) 编辑

2018年4月4日

python匹配两个字符串中间的字符串

摘要: 问题:使用python正则如何匹配两字符串中间的字符串解决:使用re模块的findall,注意,re.match是只能从开头匹配的方法: 这样就可以匹配到script标签中的代码了 阅读全文

posted @ 2018-04-04 19:28 星河赵 阅读(3840) 评论(0) 推荐(0) 编辑

2018年4月3日

Python 部署 flask 用uwsgi和nginx

摘要: 安装uwsgi nginx 具体方法请百度 1.在项目目录下建立.ini文件 xad_uwsgi.ini 2配置nginx文件 在此路径下建立对应文件如果没有请自行创建 xadconf.test.com为二级域名 /etc/nginx/sites-enabled/xadconf.test.com 3 阅读全文

posted @ 2018-04-03 19:11 星河赵 阅读(424) 评论(0) 推荐(0) 编辑

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 56 下一页

导航