script filename and autorun

Lexy Zhitenev zhitenev at
Tue Mar 18 15:50:15 CET 2003

"Simon Dahlbacka" wrote in message news:3e77229a$1 at
> Hi,
Hi, also.

> 1) how do I get the filename of the current script running? (I want to
> detect location at runtime)
As I have solved this problem, the result that works anyhow this script is
executed is

import sys, os
print os.path.abspath(sys.argv[0])

> 2) is it enough with just a key "python
> c:\whateverthepathistomyprogram\" in ...\Run or do I also need full
> path to python?

It is enough on WinNT, 2000 and XP, but it won't work on Win9x branch. You
will have to write full path to interpreter. Of course it has to be


More information about the Python-list mailing list