MRAB wrote:
If you're not limited to ASCII then there's '←' (U+2190, 'LEFTWARDS
ARROW'). It's a little too late now, though.
Well, if you are old enough, that was the ASCII graphic for the
character now printed as '_' (ASCII), and SAIL used it for assignment
statements, causing much consternatio
Antoon Pardon wrote:
On 2009-04-24, Steven D'Aprano wrote:
On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
Hello,
I'm trying to do a if statement with a function inside it. I want to use
that variable inside that if loop , without defining it.
def Test():
return 'Vla'
I searching
Rhodri James wrote:
On Mon, 04 May 2009 15:25:44 +0100, Antoon Pardon
wrote:
On 2009-04-24, Steven D'Aprano
wrote:
On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
Hello,
I'm trying to do a if statement with a function inside it. I want to
use
that variable inside that if loop , w
On Mon, 04 May 2009 15:25:44 +0100, Antoon Pardon
wrote:
On 2009-04-24, Steven D'Aprano
wrote:
On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
Hello,
I'm trying to do a if statement with a function inside it. I want to
use
that variable inside that if loop , without defining it
On 2009-04-24, Steven D'Aprano wrote:
> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
>
>> Hello,
>>
>> I'm trying to do a if statement with a function inside it. I want to use
>> that variable inside that if loop , without defining it.
>>
>> def Test():
>> return 'Vla'
>>
>> I sear
In message , GC-Martijn wrote:
> Nothing is wrong with it , but it cost more lines (= more scrolling)
> When possible I want to keep my code small.
Maybe you'd be better off with Perl than Python.
--
http://mail.python.org/mailman/listinfo/python-list
> Steven D'Aprano (SD) wrote:
>SD> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
>>> -- The long way
>>> t = Test()
>>> if (t == 'Vla':
>>> print t # must contain Vla
>SD> What's wrong with that?
Missing ')' or better spurious '(' :=)
--
Pi
On Apr 24, 5:00 am, GC-Martijn wrote:
> Hello,
>
> I'm trying to do a if statement with a function inside it.
> I want to use that variable inside that if loop , without defining it.
>
> def Test():
> return 'Vla'
>
> I searching something like this:
>
> if (t = Test()) == 'Vla':
> print t
Ulrich Eckhardt wrote:
t = Test()
if (t == 'Vla':
print t # must contain Vla
What's wrong with that?
It unnecessarily injects the name 't' into the scope.
Since there is no concept in Python of a scope local to block
statements, I don't understant what you would like to happen instead
GC-Martijn wrote:
On 24 apr, 12:15, Chris Rebert wrote:
On Fri, Apr 24, 2009 at 3:00 AM, GC-Martijn wrote:
Hello,
I'm trying to do a if statement with a function inside it.
I want to use that variable inside that if loop , without defining it.
def Test():
return 'Vla'
I searching something
Steven D'Aprano wrote:
> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
>> t = Test()
>> if (t == 'Vla':
>> print t # must contain Vla
>
>
> What's wrong with that?
It unnecessarily injects the name 't' into the scope.
Uli
--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amts
Chris Rebert writes:
> Python forces you to do it the "long way" (the Right Way(tm) if you
> ask most Python partisans).
>
> If you could explain your situation and the context of your question
> in greater detail, someone might be able to suggest an alternate
> structure for your code which obvi
On 24 apr, 12:15, Chris Rebert wrote:
> On Fri, Apr 24, 2009 at 3:00 AM, GC-Martijn wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it.
> > I want to use that variable inside that if loop , without defining it.
>
> > def Test():
> > return 'Vla'
>
> > I searching
On 24 apr, 12:11, Steven D'Aprano wrote:
> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
> > Hello,
>
> > I'm trying to do a if statement with a function inside it. I want to use
> > that variable inside that if loop , without defining it.
>
> > def Test():
> > return 'Vla'
>
> > I sea
On Fri, Apr 24, 2009 at 3:00 AM, GC-Martijn wrote:
> Hello,
>
> I'm trying to do a if statement with a function inside it.
> I want to use that variable inside that if loop , without defining it.
>
> def Test():
> return 'Vla'
>
> I searching something like this:
>
> if (t = Test()) == 'Vla':
>
On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote:
> Hello,
>
> I'm trying to do a if statement with a function inside it. I want to use
> that variable inside that if loop , without defining it.
>
> def Test():
> return 'Vla'
>
> I searching something like this:
>
> if (t = Test()) ==
Hello,
I'm trying to do a if statement with a function inside it.
I want to use that variable inside that if loop , without defining it.
def Test():
return 'Vla'
I searching something like this:
if (t = Test()) == 'Vla':
print t # Vla
or
if (t = Test()):
print t # Vla
---
17 matches
Mail list logo