A few python questions

Rod Haper Rod.Haper at sage.nelesautomation.com
Tue Jun 20 14:07:24 EDT 2000


Suchandra Thapa wrote:
> 
>     The first problem I've encountered is trying to determine
> the size of a file.  The file type doesn't seem to have any
> function that returns the length of a file.  I've been seeking
> to the end of the file and then using tell.  However this seems
> kind of inelegant, is there a way to get the file size of a file
> without doing this or using the stat function from the os module?


os.stat(path) returns a stat tuple.  The seventh element is the file
size in bytes.



>     Finally, is there some documentation for the python interface
> to postgresql?  The rpm package that comes with redhat 6.2 doesn't
> have any documentation.


The PyGreSQL package ftp://ftp.druid.net/pub/distrib/PyGreSQL.tgz
(Latest released version) has a tutorial directory.


-- 
+----------------------------------------------------------------------+
| Rod Haper, Senior Systems Analyst      |  Neles Automation           |
| Phone: 713-346-0652 - direct           |  SCADA Solutions, Inc.      |
|        713-939-0393 - fax              |  7000 Hollister             |
| Rod.Haper at sage.nelesautomation.com     |  Houston, Texas 77040, USA  |
+----------------------------------------------------------------------+



More information about the Python-list mailing list