91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9.92KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-30
  • 語言: Python
  • 標簽: python??FTP??

資源簡介

Python 自定義FTP功能 實例源碼

資源截圖

代碼片段和文件信息

#!/usr/bin/env?python
#?-*-?coding:utf-8?-*-
“Program?for?ftp?server“
from?socketserver?import?*
from?time?import?*
import?os
import?loginauth
import?traceback
import?subprocess
import?codecs
import?logging



def?GetParentPath(strPath):??
????if?not?strPath:??
????????return?None;??
????lsPath?=?os.path.split(strPath);??
????if?lsPath[1]:??
????????return?lsPath[0];??
????lsPath?=?os.path.split(lsPath[0]);??
????return?lsPath[0];

def?ReadFile(filePathencoding=“utf-8“):
????????with?codecs.open(filePath“r“encoding)?as?f:
????????????return?f.read()

?
class?MyFtp(StreamRequestHandler):
?????????????????
??def?handle(self):
????????logger?=?logging.getLogger(“FTP“)
????????logger.setLevel(logging.DEBUG)
????????#?create?file?handler?which?logs?even?debug

評論

共有 條評論