[Zope] Basic Python Question

Laura McCord Laura.McCord at doucet-austin.com
Wed May 19 09:18:37 EDT 2004

I am writing a .htaccess file like below:

basedir = "12345678"
username = "joe"
dirpwd = "./htpasswd"
dirpath = "/var/www/html/test/" + basedir + "/.htpasswd"
filename=open(dirpath, 'w')
filename.write("AuthType Basic")
filename.write("AuthName Password Required")
filename.write("AuthUserFile" + dirpwd)
filename.write("Require user " + username)

My question is how do I make each of my statements on a separate line.
Once the file is created it should look like this when the .htaccess is

AuthType Basic
AuthName "Password Required"
AuthUserFile /var/www/html/test/12345678/.htpasswd
Require user joe

Plus, filename.write("AuthName Password Required") how do I make
Password Required have quotes around it when written to the file?


More information about the Zope mailing list