path to executing .py file

tiefeng wu icebergwtf at gmail.com
Tue Apr 14 04:53:05 CEST 2009


Hello everybody!
I'm working on my code repository (svn) auto-backup script which get hotcopy
of svn repository
directory to a directory named by date in same location where script file
is, it executed by a timer
program every 00:00 clock. Everything works fine when I'm testing by double
click it. But when
auto execute it, I got unexpected behavior. The backup directory will be
created under
"C:\Documents and settings\username". I create backup directory by this way:

os.mkdir(os.getcwd() + arch_dir)

is there some way to get path to my executing script, so I can replaced
"os.getcwd()" in above
line?

And I have another question, I've tried remove a copy of svn repository by
calling

shutil.rmtree(svn_repos_copy_dir)

I got error "Access denied!" Is that mean my script has no power to delete
it? Is there some way to
give the right to do that?

thanks

tiefeng wu
2009-04-14
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090414/f18a5387/attachment.html>


More information about the Python-list mailing list