2014年2月12日

python备份mysql数据库

摘要: 介绍使用python结合mysqldump对mysql数据库进行备份import osimport sysimport configparserimport timedef test_file_path(fp): if not os.path.exists(fp): raise RuntimeError('file {} not found'.format(fp))def backup_mysqldb(backup_param): test_file_path(backup_param['mysql']['dump']) test_file_pa 阅读全文

posted @ 2014-02-12 22:26 FlowingCloud 阅读(626) 评论(0) 推荐(0) 编辑

python解析ini文件

摘要: python解析ini文件使用configparser — Configuration file parsersections() add_section(section) has_section(section)操作sectionoptions(section) has_option(section, option) 操作itemsread(filenames, encoding=None) read_file(f, source=None) read_string(string, source='') read_dict(dictionary, source='&# 阅读全文

posted @ 2014-02-12 22:15 FlowingCloud 阅读(602) 评论(0) 推荐(0) 编辑

导航