欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python批量同步web服務(wù)器代碼核心程序

 更新時(shí)間:2014年09月01日 17:58:14   投稿:mdxy-dxy  
這篇文章主要介紹了python批量同步web服務(wù)器代碼核心程序,需要的朋友可以參考下
#!/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()

相關(guān)文章

  • python實(shí)現(xiàn)人機(jī)五子棋

    python實(shí)現(xiàn)人機(jī)五子棋

    這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)人機(jī)五子棋,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-03-03
  • python字典翻轉(zhuǎn)的實(shí)現(xiàn)

    python字典翻轉(zhuǎn)的實(shí)現(xiàn)

    本文主要介紹了python字典翻轉(zhuǎn)的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-05-05
  • pytest實(shí)現(xiàn)多種調(diào)用方式

    pytest實(shí)現(xiàn)多種調(diào)用方式

    pytest是一個(gè)非常成熟的全功能的Python測試框架,本文主要介紹了pytest多種調(diào)用方式,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-12-12
  • python繪制立方體的方法

    python繪制立方體的方法

    這篇文章主要為大家詳細(xì)介紹了python繪制立方體的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • YOLOv5改進(jìn)系列之增加小目標(biāo)檢測層

    YOLOv5改進(jìn)系列之增加小目標(biāo)檢測層

    yolov5出來已經(jīng)很長時(shí)間了,所以有關(guān)yolov5的一些詳細(xì)介紹在這里就不一一介紹了,下面這篇文章主要給大家介紹了關(guān)于YOLOv5改進(jìn)系列之增加小目標(biāo)檢測層的相關(guān)資料,需要的朋友可以參考下
    2022-09-09
  • Tensorflow 模型轉(zhuǎn)換 .pb convert to .lite實(shí)例

    Tensorflow 模型轉(zhuǎn)換 .pb convert to .lite實(shí)例

    今天小編就為大家分享一篇Tensorflow 模型轉(zhuǎn)換 .pb convert to .lite實(shí)例,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-02-02
  • 瘋狂上漲的Python 開發(fā)者應(yīng)從2.x還是3.x著手?

    瘋狂上漲的Python 開發(fā)者應(yīng)從2.x還是3.x著手?

    熱度瘋漲的 Python,開發(fā)者應(yīng)從 2.x 還是 3.x 著手?這篇文章就為大家分析一下了Python開發(fā)者應(yīng)從2.x還是3.x學(xué)起,感興趣的小伙伴們可以參考一下
    2017-11-11
  • Python max內(nèi)置函數(shù)詳細(xì)介紹

    Python max內(nèi)置函數(shù)詳細(xì)介紹

    這篇文章主要介紹了Python MAX內(nèi)置函數(shù)詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下
    2016-11-11
  • python中字典dict排序sorted的實(shí)現(xiàn)

    python中字典dict排序sorted的實(shí)現(xiàn)

    本文主要介紹了python中字典dict排序sorted的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-05-05
  • 關(guān)于命令行執(zhí)行Python腳本的傳參方式

    關(guān)于命令行執(zhí)行Python腳本的傳參方式

    這篇文章主要介紹了關(guān)于命令行執(zhí)行Python腳本的傳參方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-09-09

最新評論