A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/077384.html below:

how to calculate the size of sys.stdin?

how to calculate the size of sys.stdin? how to calculate the size of sys.stdin?Donn Cave donn at u.washington.edu
Wed Apr 11 19:37:50 EDT 2001
Quoth Graham Guttocks <graham_guttocks at yahoo.co.nz>:

| Is there a way to calculate the size (in bytes) of sys.stdin?  I tried
| to use the "stat" module to accomplish this, but os.stat() seems to
| only accept the name of a file.  (i.e, the following doesn't work):
|
| import os,stat
| size = os.stat(sys.stdin.read())[stat.ST_SIZE]

os.fstat(sys.stdin.fileno())

This makes sense only when stdin happens to be a disk file, of course.

I don't understand why you would try sys.stdin.read() in the above
example, so I don't know if this helps or not, but you'll know if
you try it.

	Donn Cave, donn at u.washington.edu

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4