1.第一步准备工作: 新建一个任意命名的文件夹’han’,用来存放库文件夹’PDESolverByDeepLearning’、权限文件’LICENSE’、上传库时需要用的’setup.py’文件和’README.txt’文件。如下图:
其中,’LICENSE’文件内容为:
MIT License
Copyright (c) 2018 lichanghong
Permission is hereby granted, free of charge, to any person obtaining
本文实例讲述了Python实现FTP上传文件或文件夹实例。分享给大家供大家参考。具体如下:
import sys
import os
import json
from ftplib import FTP
_XFER_FILE = 'FILE'
_XFER_DIR = 'DIR'
class Xfer(object):
'''''
note: upload local file or dirs recursively to ftp server
'''
def __init