Re: OS path in python

2008-09-23 Thread bruno desthuilliers
On 23 sep, 02:42, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > import os > > os.environ['SERVER_NAME'] > > > See how that goes. > > I get: > KeyError: 'SERVER_NAME' > > So i'm assuming we aren't You mean you don't know which web development solution you're using ??? --~--~-~--~~--

Re: OS path in python

2008-09-23 Thread Bobby Roberts
I wasn't aware of that group. Thanks for posting the info. On Sep 23, 5:08 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 23 sep, 02:01, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > > On Sep 22, 6:11 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > > > > Shouldn't that be os.path.abspath(os.

Re: OS path in python

2008-09-23 Thread bruno desthuilliers
On 23 sep, 02:01, Bobby Roberts <[EMAIL PROTECTED]> wrote: > On Sep 22, 6:11 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > > > Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead > > just in case the .py file is executed with a relative path? > > > And Bobby, I would instead use th

Re: OS path in python

2008-09-22 Thread Bobby Roberts
> import os > os.environ['SERVER_NAME'] > > See how that goes. I get: KeyError: 'SERVER_NAME' So i'm assuming we aren't --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: OS path in python

2008-09-22 Thread gaz
On Sep 23, 10:01 am, Bobby Roberts <[EMAIL PROTECTED]> wrote: > I need to find the x part of the path which is the domain name > (whatever.com, ie).  I'm thinking that the only way to do this is to > get the current URL being viewed but I can't figure that out. Assuming you are using Python C

Re: OS path in python

2008-09-22 Thread Bobby Roberts
On Sep 22, 6:11 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead   > just in case the .py file is executed with a relative path? > > And Bobby, I would instead use the Sites framework to compute the URL   > of the site, not rely on

Re: OS path in python

2008-09-22 Thread Erik Allik
Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead just in case the .py file is executed with a relative path? And Bobby, I would instead use the Sites framework to compute the URL of the site, not rely on a local folder name. Erik On 23.09.2008, at 0:51, Plamen Dragozov w

Re: OS path in python

2008-09-22 Thread Plamen Dragozov
From inside a python module: os.path.dirname(__file__) Best, Plamen Dragozov Bobby Roberts wrote: > > On Sep 22, 5:05 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > >> os.path.dirname() >> > > > Thanks. The main problem is that i have to dynamically get the url > i'm at so i can pass to

Re: OS path in python

2008-09-22 Thread Bobby Roberts
On Sep 22, 5:05 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > os.path.dirname() Thanks. The main problem is that i have to dynamically get the url i'm at so i can pass to that function ( Python returns that i'm missing 1 argument and I don't know how to dynamically pass that in.) --~--~---

Re: OS path in python

2008-09-22 Thread Jarek Zgoda
os.path.dirname() Wiadomość napisana w dniu 2008-09-22, o godz. 22:51, przez Bobby Roberts: > > i've got a setup like most people where i have directory structure > such as: > > home/sites/xxx/whatever > > > where xxx is the domain name > > If I have a file sitting in the "whatever" directory,

OS path in python

2008-09-22 Thread Bobby Roberts
i've got a setup like most people where i have directory structure such as: home/sites/xxx/whatever where xxx is the domain name If I have a file sitting in the "whatever" directory, how can i find the domain name under which the file resides? Thanks for helping a noob. --~--~-~--~-