[Zope] Python Question

Passin, Tom tpassin at mitretek.org
Fri May 21 12:36:12 EDT 2004


> From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On 
> Behalf Of Laura McCord
> 
> I want to modify my python code to append new required users 
> to my .htaccess file
> 
> So my logic is:
>  ... 
> -- This is what my code looks like --
> def createUser(username, basedir):
>  import os
>  dirpath = "/var/www/html/da/" + basedir + "/.htaccess"
>  dirpwd  = "/var/www/html/da/" + basedir + "/.htpasswd"
> ...

So what is your question?

I suggest using os.path functions to build up your paths rather than
directly coding them as you have done.  That way the paths port to other
operating systems.

Cheers,
Tom P



More information about the Zope mailing list