zoukankan      html  css  js  c++  java
  • 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日志。等下次更新一下,加入一些压缩 ,日志等功能

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    eclipse下jsp文件报错解决方法
    使用vscode搭建本地的websocket
    tomcat的首次登录配置
    tomcat配置报错解决方法 The jre_home environment variable is not defined correctly
    cento升级openssl依旧显示老版本
    Centos6安装mysql5.7最新版
    Neutron服务组件
    网络OSI 7层模型
    Kubernetes的核心技术概念和API对象
    Xen 虚拟化技术
  • 原文地址:https://www.cnblogs.com/liang2580/p/8467582.html
Copyright © 2011-2022 走看看