Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread Stebanoid
On 7, 10:39, dmitrey <[EMAIL PROTECTED]> wrote: > Hi all, > I guess this question was asked many times before, but I don't know > keywords for web search. > > Thank you in advance, D. import sys file_name = sys.argv[0] this? -- http://mail.python.org/mailman/listinfo/python-lis

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread [EMAIL PROTECTED]
dmitrey wrote: > Hi all, > I guess this question was asked many times before, but I don't know > keywords for web search. > > Thank you in advance, D. In the future, please ask your question in the body of your message (not just in the subject line). This question has no answer in general. There

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread Gerard Flanagan
On Jun 8, 1:01 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > Gerard Flanagan wrote: > > On Jun 7, 8:39 am, dmitrey <[EMAIL PROTECTED]> wrote: > >> Hi all, > >> I guess this question was asked many times before, but I don't know > >> keywords for web search. > > >> Thank you in advance, D. > > > imp

Re: howto obtain directory where current (running) py-file is placed?

2007-06-07 Thread Stef Mientki
Gerard Flanagan wrote: > On Jun 7, 8:39 am, dmitrey <[EMAIL PROTECTED]> wrote: >> Hi all, >> I guess this question was asked many times before, but I don't know >> keywords for web search. >> >> Thank you in advance, D. > > import os > > d1 = os.path.dirname(__file__) here I get an error "__file_

Re: howto obtain directory where current (running) py-file is placed?

2007-06-07 Thread Gerard Flanagan
On Jun 7, 1:19 pm, dmitrey <[EMAIL PROTECTED]> wrote: > On Jun 7, 10:18 am, Gerard Flanagan <[EMAIL PROTECTED]> wrote:> On Jun 7, > 8:39 am, dmitrey <[EMAIL PROTECTED]> wrote: > > Thank you. > And what is the simplest way (without split/join, if exist) to obtain > name of directory parent to direc

Re: howto obtain directory where current (running) py-file is placed?

2007-06-07 Thread dmitrey
On Jun 7, 10:18 am, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > On Jun 7, 8:39 am, dmitrey <[EMAIL PROTECTED]> wrote: Thank you. And what is the simplest way (without split/join, if exist) to obtain name of directory parent to directory my_directory_name? Thx, D. > > > Hi all, > > I guess this q

Re: howto obtain directory where current (running) py-file is placed?

2007-06-07 Thread Gerard Flanagan
On Jun 7, 8:39 am, dmitrey <[EMAIL PROTECTED]> wrote: > Hi all, > I guess this question was asked many times before, but I don't know > keywords for web search. > > Thank you in advance, D. import os d1 = os.path.dirname(__file__) d2 = os.path.dirname(os.__file__) print d1 print d2 -- http://m

howto obtain directory where current (running) py-file is placed?

2007-06-06 Thread dmitrey
Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list