python 计算上载时间

14 views
Skip to first unread message

prairie99

unread,
Aug 1, 2009, 5:57:47 AM8/1/09
to gdal+python+GIS+geosings论坛
在用 python 和 wxpython作一个应用小程序 ,被这一步绊住。请问怎样用python计算一个文 件的 (如 10M) 上载时间?

linux23...@gmail.com

unread,
Aug 2, 2009, 11:06:36 AM8/2/09
to gdal+python+GIS+geosings论坛
用什么上载?wx?socket?

prairie99

unread,
Aug 2, 2009, 5:28:52 PM8/2/09
to gdal+python+GIS+geosings论坛
我用 ftplib 来上载文件。 最好能够用 wx progressdialog 显示剩余时间。

linux23...@gmail.com

unread,
Aug 3, 2009, 1:04:05 AM8/3/09
to gdal+python+GIS+geosings论坛
FTP.storbinary(command, file[, blocksize, callback])

Store a file in binary transfer mode. command should be an appropriate
STOR command: "STOR filename". file is an open file object which is
read until EOF using its read() method in blocks of size blocksize to
provide the data to be stored. The blocksize argument defaults to
8192. callback is an optional single parameter callable that is called
on each block of data after it is sent.

Changed in version 2.1: default for blocksize added.

Changed in version 2.6: callback parameter added.

blocksize可以计算上传了几个block。然后在callback中就可以计算进度条了。
Reply all
Reply to author
Forward
0 new messages