上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 60 下一页

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 星河赵 阅读(301) 评论(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 星河赵 阅读(165) 评论(0) 推荐(0)

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

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

posted @ 2018-04-11 19:06 星河赵 阅读(308) 评论(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 星河赵 阅读(15173) 评论(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 星河赵 阅读(299) 评论(0) 推荐(0)

替换python字典中的key值

摘要: 阅读全文

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

2018年4月4日

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

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

posted @ 2018-04-04 19:28 星河赵 阅读(3860) 评论(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 星河赵 阅读(438) 评论(0) 推荐(0)

[Python] 利用commands模块执行Linux shell命令

摘要: 用Python写运维脚本时,经常需要执行linux shell的命令,Python中的commands模块专门用于调用Linux shell命令,并返回状态和结果,下面是commands模块的3个主要函数: 1. commands.getoutput('shell command') 执行shell 阅读全文

posted @ 2018-04-03 11:48 星河赵 阅读(5161) 评论(0) 推荐(0)

Mac Terminal菜鸟篇之使用unrar解压rar文件

摘要: 在Mac上的归档工具不能够解压rar文件,这时可以使用终端中的unrar来解决问题。 步骤如下: 1.使用Homebrew安装unrar(有关Homebrew的安装和使用见Homebrew) [plain] view plain copy $ brew install unrar ==> Downl 阅读全文

posted @ 2018-04-03 09:52 星河赵 阅读(472) 评论(0) 推荐(0)

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 60 下一页

导航