• python day8 FTP 作业


    python day8 FTP 作业

    目录如下: (python3 程序)

     github地址如下:   https://github.com/liang2580/FTP2

    [root@iZwz9i5qxdafjn4npsy1a3Z ~]# tree FTP2/
    FTP2/ ├── FTPClient │   ├── 123 │   ├── ftp_client.py ###客户端程序 启动程序 │   ├── __init__.py │   ├── liang │   └── te ├── FTPServer │   ├── bin │   │   ├── ftp_server.py #### server端的入口程序, │   │   └── __init__.py │   ├── conf │   │   ├── accounts.cfg #这个是用户配置文件 │   │   ├── da.py │   │   ├── __init__.py │   │   ├── __pycache__ │   │   │   ├── __init__.cpython-36.pyc │   │   │   ├── __init__.cpython-37.pyc │   │   │   ├── settings.cpython-36.pyc │   │   │   └── settings.cpython-37.pyc │   │   └── settings.py ###这个是系统配置文件 │   ├── core │   │   ├── ftp_server.py # 主逻辑代码 │   │   ├── main.py # 核心入口 │   │   └── __pycache__ │   │   ├── ftp_server.cpython-36.pyc │   │   ├── ftp_server.cpython-37.pyc │   │   ├── main.cpython-36.pyc │   │   └── main.cpython-37.pyc │   └── home │   ├── __init__.py │   └── liang # 用户加目录 │   ├── 12 │   ├── 123 │   ├── 2 │   ├── 4 │   ├── 456 │   ├── 55 │   ├── 66 │   │   └── aa │   ├── liang │   ├── liang2580 │   └── token ├── __init__.py └── README.md
    README.md 介绍

    #这是一个python 的FTP的一个小玩意

    运行的话。

    Server 端的方式是这样的  默认端口是9999 

    [root@salt_client FTP]#  python3 FTPServer/bin/ftp_server.py start

    start 是启动的方式

    客户端连接的话

    [root@salt_client FTP]# python3 FTPClient/ftp_client.py -s 127.0.0.1 -P9999 -uliang -pabc123

    默认的账户密码 liang abc123 参数解释一下 -s 代表服务器IP地址 -P 端口 -u 用户名 -p 密码

    具有上传 下载 不行就进去help [liang]$:help ['help']

        get filename    #get file from FTP server
        put filename    #upload file to FTP server
        ls              #list files in current dir on FTP server
        pwd             #check current path on server
        cd path         #change directory , same usage as linux cd command
        touch           # touch file 
        rm              # rm file  rm director
        mkdir           # mkdir direcotr 
    

    [liang]$:

    支持用户认证 、 文件上传、 文件下载、 文件建立、 文件夹建立、 删除、 这些功能。没有写log日志。等下次更新一下,加入一些压缩 ,日志等功能

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    Jaxb2 实现JavaBean与xml互转
    标准输入与标准输出
    linux 一行一行的读取文件
    linux $* 和$@ if [ ](字符串比较)
    scala 学习(三)——Array和ArrayBuffer
    Shell编程(六)awk工具
    Shell编程(五)脚本语法
    Shell编程(四)Shell变量
    Shell编程(三)Shell特性
    Shell编程(一)概览
  • 原文地址:https://www.cnblogs.com/liang2580/p/8467582.html
Copyright © 2020-2023  润新知