• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python批量同步web服务器代码核心程序

python批量同步web服务器代码核心程序

作者:mdxy-dxy 字体:[增加 减小] 来源:互联网

mdxy-dxy 通过本文主要向大家介绍了python web服务器,python实现web服务器,python搭建web服务器,python开发web服务器,python web框架等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
#!/usr/bin/env python 
#coding:utf8 
import os,sys import md5,tab from mysql_co.my_db import set_mysql from ssh_co.ssh_connect import sshd from ssh_co.cfg.config import ssh_message,item_path from file import findfile def my_mysql(): 
  db_file={} 
  my_connect=set_mysql() 
  f_file=findfile.main(item_path) 
  list_file=findfile.file_list(f_file) 
  see_file=my_connect.display_db() 
  for knumber,kname,ksgin,ksize,katime,kmtime in see_file: 
    db_file[kname]=[ksgin,ksize,katime,kmtime] 
  for fname,fsize,fatime,fmtime in list_file: 
      if fname in db_file.keys(): 
        if ("%f")%fmtime == ("%f")%db_file[fname][3]: 
          print "%s The same mtime pass"%fname 
          my_connect.set_file_attribute(10,fname,fmtime) 
          pass
        else: 
          print "%s different for mtime"%fname 
          my_connect.set_file_attribute(11,fname,fmtime) 
      else: 
        my_connect.add_db(fname,fsize,fatime,fmtime) 
        my_connect.set_file_attribute(11,fname,fmtime) 
        print "%s,is new file"%fname 
  new_file=my_connect.new_db() 
  my_connect.disconn_db() 
  return new_file def my_ssh(new_file): 
  pid_host = 1
  for host_attribute in ssh_message: 
    ssh_conn=sshd(host_attribute,pid_host) 
    for file_name in new_file: 
      if file_name: 
        a=ssh_conn.put_ssh_file(file_name[1]) 
        print a 
        print "ssh_connect memoryID: %s" %pid_host 
      else: 
        pid_host = id(host_attribute) 
        ssh_conn.disconn_ssh() def main(): 
  new_file=my_mysql() 
  my_ssh(new_file) 
 if __name__ == "__main__": 
  main()
</div> </div>

您可能想查找下面的文章:

  • Python部署web开发程序的几种方法
  • Python部署web开发程序的几种方法
  • Python 搭建Web站点之Web服务器网关接口
  • Python实现获取域名所用服务器的真实IP
  • Python实现获取域名所用服务器的真实IP
  • python实现web方式logview的方法
  • Python实现简单的代理服务器
  • 用Python实现web端用户登录和注册功能的教程
  • 用Python实现web端用户登录和注册功能的教程
  • Python获取服务器信息的最简单实现方法

相关文章

  • python操作ie登陆土豆网的方法
  • Python通过websocket与js客户端通信示例分析
  • python中将字典转换成其json字符串
  • python基础教程之基本数据类型和变量声明介绍
  • Python 操作MySQL详解及实例
  • Python实现简单字典树的方法
  • 详解Python中的__new__、__init__、__call__三个特殊方法
  • 介绍Python中的__future__模块
  • python基于隐马尔可夫模型实现中文拼音输入
  • python遍历目录的方法小结

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python实现的数据结构与算法之双端队列详解
    • Python中查看文件名和文件路径
    • 简单的抓取淘宝图片的Python爬虫
    • Python中对象迭代与反迭代的技巧总结
    • python实现矩阵乘法的方法
    • 利用Python实现简单的相似图片搜索的教程
    • python集合用法实例分析
    • Python sys.path详细介绍
    • python中的yield使用方法
    • python 使用smtp协议发送邮件:html文本邮件、图片邮件、文件附件邮件。附:常用邮件的smtp、pop3服务器地址

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有