Python ftplib: Show FTP upload progress

☆樱花仙子☆ 提交于 2019-11-30 07:23:31

There are three non-hacky ways I can think of. All of then shift the "ownwership" of the variable:

  1. have the value passed in and return the result (basically means its stored in the caller)
  2. have the value be global, and initialize it to 0 and the top of your file. (read up on the global keyword)
  3. have this function as a member function of a class to handle upload tracking. Then make sizeWritten a instance variable of that class.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!