How do I 'stat' online files?

2007-07-24 Thread DB Daniel Brown
I am working on a program that needs to stat files (gif, swf, xml, dirs, etc) from the web. I know how to stat a local file... import os tplStat = os.stat(path) but I can't figure out how to stat a file that resides on a web server. I am not sure if it makes a difference, but most (maybe all)

Re: running commands with sudo & python

2006-09-29 Thread db
Hi there, I think you can do that with pexpect http://pexpect.sourceforge.net/ good luck On Thu, 28 Sep 2006 14:18:14 -0700, coldsoul4e wrote: > Hi! > I must execute a command with os.command(), but with root permissions. > Is there anyway to do that with python? > Thanks -- http://mail.p

Re: Javadoc style python manual?

2006-09-08 Thread db
On Fri, 08 Sep 2006 01:11:06 -0700, xiong.xu.cn wrote: > Hi there, > > I'm new to python and I'm from the java world. > Though I love to learn python, I'm not very comfortable with the python > documentation. > Because when i read jdk doc, i can see the class hierachy, class > member, class metho

Re: Inheritance problem ?

2005-08-24 Thread db
On Wed, 24 Aug 2005 03:34:36 -0700, tooper wrote: > Hello all, > > I'm trying to implement a common behavior for some object that can be > read from a DB or (when out of network) from an XML extract of this DB. > I've then wrote 2 classes, one reading from XML &

Re: Newbie: Help Figger Out My Problem

2005-06-28 Thread db
On Tue, 28 Jun 2005 00:23:30 -0700, ChuckDubya wrote: > ##Coin Flip: randomly flips 100 "coins" and prints results > ##Original draft: june 27, 2005 > ##Chuck > > import random > heads = 0 > tails = 0 > flips = 0 > while flips < 99: > coin = random.randrange(0, 2) > if coin == 0:

Re: regarding cgi

2005-06-14 Thread db
I think you should give another header: Content-type: text/html regards Arjen On Tue, 14 Jun 2005 07:00:09 +0100, praba kar wrote: > Dear All, > > I have doubt regarding headers in cgi > programming. If I gives "Content-Type:text/plain" > then I try to print html contents. Is righ

write html-headers (utf-8)

2005-05-30 Thread db
Hello all, I hope this is the correct newsgroup for this question. Does anybody know how I can write a html-header with python(cgi)? The problem is, I have a few html templates in which I have a header e.g: http://www.w3.org/TR/html4/strict.dtd";> In this template I write a few Mysql variab