• 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模拟登录12306的方法
  • Python内置的字符串处理函数详细整理(覆盖日常所用)
  • Python enumerate遍历数组示例应用
  • python实现计算资源图标crc值的方法
  • 详解python3百度指数抓取实例
  • 解析Mac OS下部署Pyhton的Django框架项目的过程
  • 从零学python系列之教你如何根据图片生成字符画
  • python编写简单爬虫资料汇总
  • python基于itchat实现微信群消息同步机器人
  • NumPy排序的实现

文章分类

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

最近更新的内容

    • Python中函数参数设置及使用的学习笔记
    • Python 中的 else详解
    • Python实现堆排序的方法详解
    • 详解Python的Django框架中的模版继承
    • python爬虫scrapy运行ImportError: No module named win32api错误
    • 让python同时兼容python2和python3的8个技巧分享
    • 使用Python将数组的元素导出到变量中(unpacking)
    • Python多线程编程(六):可重入锁RLock
    • bpython 功能强大的Python shell
    • python中循环语句while用法实例

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

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