Victor Subervi wrote:
Inelegant. This will be elegant:
ourFile = string.split(__file__, "/")
p = ourFile[len(ourFile) - 1]
p = p[: - 3]
site = ourFile[4][:-10]
if site != '':
site = site[:-1]
from this import that(site)
Now it's automated.
V
Amazing. When trying to split a path string
On Sun, Dec 20, 2009 at 3:26 PM, Stephen Hansen wrote:
> On Sun, Dec 20, 2009 at 11:01 AM, Victor Subervi
> wrote:
>
>> If you want a piece of code to have a variable number of differing
>>> behaviors, that's something you can handle in many elegant ways. That's
>>> something inheritance is good
Victor Subervi wrote:
On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote:
Of course, I can pass the page name as a parameter, but that's not
elegant.
That is precisely what it is in fact-- elegant; it is non-elegant to have
magical behavior where what 'imports' something somehow changes or
On Sun, Dec 20, 2009 at 11:01 AM, Victor Subervi wrote:
> If you want a piece of code to have a variable number of differing
>> behaviors, that's something you can handle in many elegant ways. That's
>> something inheritance is good for, with a core default behavior represented
>> in one class and
On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote:
> On Sun, Dec 20, 2009 at 3:05 AM, Victor Subervi
> wrote:
>
>> Of course, I can pass the page name as a parameter, but that's not
>> elegant.
>>
>
> That is precisely what it is in fact-- elegant; it is non-elegant to have
> magical behavior
On Sun, Dec 20, 2009 at 3:05 AM, Victor Subervi wrote:
> Of course, I can pass the page name as a parameter, but that's not elegant.
>
That is precisely what it is in fact-- elegant; it is non-elegant to have
magical behavior where what 'imports' something somehow changes or
determines how that s
Victor Subervi wrote:
Hi; I'm looking for something like os.environ['HTTP_REFERER'] but for
python scripts. That is, if I have a script that is imported by
another script, how can I have the script that is being imported
determine which script imported it?
I don't know whe
On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert wrote:
> On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi
> wrote:
> > Hi;
> > I'm looking for something like os.environ['HTTP_REFERER'] but for python
> > scripts. That is, if I have a script that is imported
On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi wrote:
> Hi;
> I'm looking for something like os.environ['HTTP_REFERER'] but for python
> scripts. That is, if I have a script that is imported by another script, how
> can I have the script that is being imported dete
Hi;
I'm looking for something like os.environ['HTTP_REFERER'] but for python
scripts. That is, if I have a script that is imported by another script, how
can I have the script that is being imported determine which script imported
it?
TIA,
Victor
--
http://mail.python.org/mailman/
10 matches
Mail list logo