Ömer Ücel

July 28, 2007

Python - Bir Dosyanın Boyutunu Öğrenme

Filed under: Uncategorized — Tags: — Ömer Ücel @ 1:28 pm

İnternet üzerindeki bir dosyanın boyutunu aşağıdaki şekilde öğrenebilirsiniz.

import urllib2

f = urllib2.urlopen('http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi')

print f.info().items().__getitem__(0)[1]

>>>
9688576

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress