需求:快速进行ftp上传 ,下载,查询文件 原来直接在shell下操作: 需要[连接,输用户名,输密码,单文件操作,存在超时限制] 太过于繁琐,容易操作失败 脚本改进: 一句命令,搞定多文件上传,下载,查询,列表等操作 后期可以加入更强大的功能 直接上脚本: #!/usr/bin/python #ftp.py #this script is used to make some ftp operations more convenient #add upload and download oper…
python for循环 格式: for iterating_var in sequence: statements(s) ######################################## 可多层嵌套 for iterating_var in sequence: for iterating_var in sequence: statements(s) for iterating_var in sequence: ... statements(s) for循环可以遍历任何序列的项目…
◆ os.listdir(path) Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory. ◆ os.getcwd() method…