On 10/22/2014 10:58 PM, Larry Hudson wrote:
This give you a list not a string, but that's actually what you want
here. If you _really_ want a string, use join(): "".join(list(range(10)))
Interactive mode makes it really easy to test before posting.
>>> "".join(list(range(10)))
Traceback (m
Dennis Lee Bieber wrote:
>> x = [f(), g()] [cond]
>>
>>the latter evaluates both f() and g() instead of just one. Apart from
>>being inefficient, it can have unintended side-effects.
>
> Ah, but what would
>
> x = [f, g][cond]()
>
> produce?
headache
--
By ZeD
--
https://mail.python.org/m
Chris Angelico wrote:
I've seen much MUCH worse... where multiple conditional
expressions get combined arithmetically, and then the result used
somewhere...
In the days of old-school BASIC it was common to
exploit the fact that boolean expressions evaluated
to 0 or 1 (or -1, depending on your d
On Thursday, October 23, 2014 8:28:39 AM UTC+5:30, Larry Hudson wrote:
> -- Also, from another post: ---
> > Thanks a lot for all your suggestions. I haven't learned to use the
> > interpreter yet. I do plan on learning to use it.
> You are making yourself work several hundred times
On Wed, 22 Oct 2014 19:58:24 -0700, Larry Hudson
wrote:
>On 10/22/2014 05:02 PM, Seymore4Head wrote:
>> On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
>> wrote:
>
> (This is in reference to the line: if y in str(range(10)):)
>
>>> I suggest you try str(range(10)) from the interactive prompt
On 10/22/2014 05:02 PM, Seymore4Head wrote:
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
wrote:
(This is in reference to the line: if y in str(range(10)):)
I suggest you try str(range(10)) from the interactive prompt and see
exactly what you get, as it's nothing like what you expect
On Wed, 22 Oct 2014 21:35:19 -0400, Seymore4Head
wrote:
>On Thu, 23 Oct 2014 02:31:57 +0100, MRAB
>wrote:
>
>>On 2014-10-23 01:10, Seymore4Head wrote:
>>> On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano
>>> wrote:
>>>
Seymore4Head wrote:
> Those string errors were desperate att
On Thu, 23 Oct 2014 11:37:27 +1000, alex23 wrote:
>On 23/10/2014 10:02 AM, Seymore4Head wrote:
>> On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
>> wrote:
>> One more question.
>> if y in str(range(10)
>> Why doesn't that work.
>>> I suggest you try str(range(10)) from the interac
On 23/10/2014 10:02 AM, Seymore4Head wrote:
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
I suggest you try str(range(10)) from the interactive prompt and see
exactly what you get, as it's nothing like what you expect :
On Thu, 23 Oct 2014 02:31:57 +0100, MRAB
wrote:
>On 2014-10-23 01:10, Seymore4Head wrote:
>> On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano
>> wrote:
>>
>>>Seymore4Head wrote:
>>>
Those string errors were desperate attempts to fix the "append" error
I didn't understand.
>>>
>>>Ah,
On 2014-10-23 01:10, Seymore4Head wrote:
On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano
wrote:
Seymore4Head wrote:
Those string errors were desperate attempts to fix the "append" error
I didn't understand.
Ah, the good ol' "make random changes to the code until the error goes away"
te
On 2014-10-23 01:02, Seymore4Head wrote:
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
wrote:
On 23/10/2014 00:26, Seymore4Head wrote:
On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence
wrote:
On 22/10/2014 23:30, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wr
Michael Torrie wrote:
> On 10/22/2014 05:45 AM, Mark Lawrence wrote:
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
>>>
>>> Oh it's a trick !
>>> thx
>>
>> IMHO it's just dreadful. Why people insist on messing around like this
>> I really don't know
i loved the rant about how zope would have all these features, and then some
other python framework would come on with like 1 and act like its the bomb, and
zope was like we been doing that and more for X years
those who dont study zope are doomed to repeat it!!!
is zope scoffing at drupal? bot
On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano
wrote:
>Seymore4Head wrote:
>
>> Those string errors were desperate attempts to fix the "append" error
>> I didn't understand.
>
>Ah, the good ol' "make random changes to the code until the error goes away"
>technique. You know that it never wor
Seymore4Head wrote:
> Those string errors were desperate attempts to fix the "append" error
> I didn't understand.
Ah, the good ol' "make random changes to the code until the error goes away"
technique. You know that it never works, right?
Start by *reading the error message*, assuming you're ge
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
wrote:
>On 23/10/2014 00:26, Seymore4Head wrote:
>> On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence
>> wrote:
>>
>>> On 22/10/2014 23:30, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more
Seymore4Head writes:
> Those string errors were desperate attempts to fix the "append" error
> I didn't understand.
It's normal when learning to get one's code into a mess.
But, when trying to trouble-shoot, please adopt the habit of
*simplifying* the examples, to better understand them.
At th
On 23/10/2014 00:26, Seymore4Head wrote:
On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence
wrote:
On 22/10/2014 23:30, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
Invalid syntax, it should obvi
On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence
wrote:
>On 22/10/2014 23:30, Seymore4Head wrote:
>> On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
>> wrote:
>>
>> One more question.
>> if y in str(range(10)
>> Why doesn't that work.
>
>Invalid syntax, it should obviously be:-
>
>if y in str(
On Wed, 22 Oct 2014 22:43:14 + (UTC), Denis McMahon
wrote:
>On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head wrote:
>
>> def nametonumber(name):
>> lst=[""]
>> for x,y in enumerate (name):
>> lst=lst.append(y)
>> print (lst)
>> return (lst)
>> a=["1-800-getcharter"]
>>
On Tue, Oct 21, 2014 at 1:57 PM, Chris Angelico wrote:
> On Wed, Oct 22, 2014 at 5:53 AM, Cyd Haselton wrote:
> > I forgot to add...I also removed and/or commented out lines referencing
> > Modules/pwdmodule.o.
>
> Sounds like the normal sort of work involved in porting to a new
> platform. I've
On 2014-10-22 23:30, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
In what way doesn't it work?
If you want to know what it returns, print it out.
I commented it out and just did it "long hand"
d
On 22/10/2014 23:30, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
Invalid syntax, it should obviously be:-
if y in str(range(10)):
OTOH if you've simply mistyped above what did you expect to happe
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head wrote:
> def nametonumber(name):
> lst=[""]
> for x,y in enumerate (name):
> lst=lst.append(y)
> print (lst)
> return (lst)
> a=["1-800-getcharter"]
> print (nametonumber(a))#18004382427837
>
>
> The syntax for when
BTW I know I didn't check for Caps yet.
On Wed, 22 Oct 2014 18:30:17 -0400, Seymore4Head
wrote:
>On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
> wrote:
>
>One more question.
>if y in str(range(10)
>Why doesn't that work.
>I commented it out and just did it "long hand"
>
>def nametonumber(name
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
I commented it out and just did it "long hand"
def nametonumber(name):
lst=[]
nx=[]
for x in (name):
lst.append(x)
for y in (lst):
#if y in str(
On Wed, 22 Oct 2014 14:35:18 -0700 (PDT), sohcahto...@gmail.com wrote:
>On Wednesday, October 22, 2014 2:06:35 PM UTC-7, Seymore4Head wrote:
>> On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick
>> wrote:
>>
>> >On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head
>> > wrote:
>> >> def nametonumber(nam
On Wednesday, October 22, 2014 2:06:35 PM UTC-7, Seymore4Head wrote:
> On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick
> wrote:
>
> >On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head
> > wrote:
> >> def nametonumber(name):
> >> lst=[""]
> >> for x,y in enumerate (name):
> >> lst=ls
On 22/10/2014 21:57, Joel Goldstick wrote:
On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head
wrote:
def nametonumber(name):
lst=[""]
for x,y in enumerate (name):
lst=lst.append(y)
print (lst)
return (lst)
a=["1-800-getcharter"]
print (nametonumber(a))#18004382427837
T
On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick
wrote:
>On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head
> wrote:
>> def nametonumber(name):
>> lst=[""]
>> for x,y in enumerate (name):
>> lst=lst.append(y)
>> print (lst)
>> return (lst)
>> a=["1-800-getcharter"]
>> print (
On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head
wrote:
> def nametonumber(name):
> lst=[""]
> for x,y in enumerate (name):
> lst=lst.append(y)
> print (lst)
> return (lst)
> a=["1-800-getcharter"]
> print (nametonumber(a))#18004382427837
>
>
> The syntax for when to use a ()
def nametonumber(name):
lst=[""]
for x,y in enumerate (name):
lst=lst.append(y)
print (lst)
return (lst)
a=["1-800-getcharter"]
print (nametonumber(a))#18004382427837
The syntax for when to use a () and when to use [] still throws me a
curve.
For now, I am trying to
On 10/22/14 12:28 PM, Steven D'Aprano wrote:
Ned Batchelder wrote:
On 10/22/14 5:05 AM, busca...@gmail.com wrote:
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
Why on earth would you recommend this outdated hack, when there's a true
conditional operator?
j =
hello, would you know how to make data_files work in setuptools ?
i can't figure out how to put datas in the generated .tar.gz
$ find .
./hello
./hello/__init__.py
./share
./share/test_file.txt
./setup.py
$ cat ./hello/__init__.py
def hello():
print( 'hello' )
$ cat ./share/test_file.txt
thi
On Thu, Oct 23, 2014 at 5:27 AM, Matthew Ruffalo wrote:
> On 10/22/2014 12:40 PM, Chris Angelico wrote:
>> That's true when it's fundamentally arithmetic. But part of that
>> readability difference is the redundancy in the second one. What if it
>> weren't so redundant?
>>
>> 'Negative' if x < 0 e
On 10/22/2014 12:40 PM, Chris Angelico wrote:
> That's true when it's fundamentally arithmetic. But part of that
> readability difference is the redundancy in the second one. What if it
> weren't so redundant?
>
> 'Negative' if x < 0 else 'Low' if x < 10 else 'Mid' if x < 20 else 'High'
>
> You can
"Rustom Mody" wrote in message
news:7d2ea3c1-504e-4f5c-8338-501b1483d...@googlegroups.com...
On Wednesday, October 22, 2014 5:01:08 PM UTC+5:30, Ned Batchelder wrote:
On 10/22/14 5:05 AM, buscacio wrote:
> Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast
> escreveu:
>> Hello
>
On Thu, 23 Oct 2014 03:28:48 +1100, Steven D'Aprano wrote:
>> Why on earth would you recommend this outdated hack, when there's a
>> true conditional operator?
>>
>> j = 3 if j >= 10 else j+1
>
> I think that's a bit harsh. Especially since this appears to have been
> Buscacio's first post
On 10/22/2014 05:45 AM, Mark Lawrence wrote:
>>> without not:
>>> j = [j+1, 3][j>=10]
>>> with not:
>>> j = [3, j+1][not (j>=10)]
>>>
>>
>> Oh it's a trick !
>> thx
>
> IMHO it's just dreadful. Why people insist on messing around like this
> I really don't know, it just drives me nuts.
This act
On 10/22/2014 4:27 AM, ast wrote:
Hello
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
The answer depends on the implementation.
In fact i have (-1)**N with N an integer potentially big.
I do some tests that suggest that Pyth
Maybe ask on the project on github. Andreas is a good guy and will reply
asap.
On 22 Oct 2014, at 18:34, Juan Christian wrote:
Testing code:
CODE -
#!/usr/bin/env
import requests
from blitzdb import Document, FileBackend
API_URL = 'http://api.themoviedb.org/3'
API_KEY
On Thu, Oct 23, 2014 at 3:28 AM, Steven D'Aprano
wrote:
> It's also a technique easily extensible to more than two
> values:
>
> '01TX'[n % 4]
>
> is in my opinion more readable than:
>
> i = n % 4
> '0' if i == 0 else '1' if i == 1 else 'T' if i == 3 else 'X'
That's true when it's fu
Testing code:
CODE -
#!/usr/bin/env
import requests
from blitzdb import Document, FileBackend
API_URL = 'http://api.themoviedb.org/3'
API_KEY = 'ddf30289'
class Actor(Document):
pass
def get_actor(_id):
r = requests.get('{}/person/{}?api_key={}'.format(A
On Wed, 22 Oct 2014 12:38:02 +0200, Peter Otten wrote:
> Peter Pearson wrote:
[snip]
>> def callback(event):
>> global n, first
>> fig = plt.figure(2)
>> fig.clear()
>> plt.plot([0,1],[0,n])
>> n += 1 # (Pretending something changes from one plot to the next.)
>> if first:
Oh yes, and here is what the call to the API returns:
{"adult":false,"also_known_as":["George Walton Lucas Jr.
"],"biography":"Arguably the most important film innovator in the history
of the medium, George Lucas continually \"pushed the envelope\" of
filmmaking technology since his early days as
Ned Batchelder wrote:
> On 10/22/14 5:05 AM, busca...@gmail.com wrote:
>> without not:
>> j = [j+1, 3][j>=10]
>> with not:
>> j = [3, j+1][not (j>=10)]
>>
>
> Why on earth would you recommend this outdated hack, when there's a true
> conditional operator?
>
> j = 3 if j >= 10 else j+1
I t
On Wed, Oct 22, 2014 at 9:01 AM, Chris Angelico wrote:
> On Thu, Oct 23, 2014 at 2:49 AM, Steven D'Aprano
> wrote:
>> Chris Angelico wrote:
> I agree that the assert is preferable to the comment. But maybe my
> level of paranoia is just lower than most people's, as I wouldn't
> bother checking th
On Wed, Oct 22, 2014 at 2:05 AM, wrote:
> Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
>> Hello
>>
>>
>>
>> Is there in Python something like:
>>
>>
>>
>> j = (j >= 10) ? 3 : j+1;
>>
>>
>>
>> as in C language ?
>>
>>
>>
>> thx
>
> without not:
> j = [j+1, 3][j>=10]
> w
On Thu, Oct 23, 2014 at 2:49 AM, Steven D'Aprano
wrote:
> Chris Angelico wrote:
>
>> And at that point, the assertion is redundant, on par with:
>>
>> a = len(seq)
>> assert isinstance(a, int)
>>
>> because you shouldn't have to assert what's part of a function's
>> guarantee.
>
> That depends on
On 2014-10-17, Jean-Michel Pichavant wrote:
> - Original Message -
>> From: "Adam Funk"
>> To: python-list@python.org
>> Sent: Thursday, 16 October, 2014 9:29:46 PM
>> Subject: Permissions on files installed by pip?
>>
>> I've been using the python-nltk package on Ubuntu, but I need ntlk
Chris Angelico wrote:
> On Wed, Oct 22, 2014 at 12:44 PM, Steven D'Aprano
> wrote:
>> def do_something(instance_or_id):
>> instance = Model.get(instance_or_id)
>> assert isinstance(instance, Model)
>> # Code that assumes that instance is an object of type Model
>>
>>
>> That means tha
random...@fastmail.us:
> Yes, and 90% of the time, when someone says they want to "flush
> stdin", what they really want to do is go to the next line after
> they've sloppily read part of the line they're on (and the behavior
> they are seeing that they object to is that their next read function
>
On Thu, 23 Oct 2014 02:18:42 +1100, Chris Angelico wrote:
> On Thu, Oct 23, 2014 at 2:12 AM, alister
> wrote:
>>> Perhaps you're correct. Is there anything worse than looking at a
>>> dreadful piece of code that makes no sense at all and knowing that
>>> you'd written it six months earlier?
>>
>
On Thu, Oct 23, 2014 at 2:12 AM, alister
wrote:
>> Perhaps you're correct. Is there anything worse than looking at a
>> dreadful piece of code that makes no sense at all and knowing that you'd
>> written it six months earlier?
>
> looking a a dreadful piece of unreadable & unfathomable code & kno
On Wed, 22 Oct 2014 12:41:49 +0100, Mark Lawrence wrote:
> On 22/10/2014 10:27, Chris Angelico wrote:
>> On Wed, Oct 22, 2014 at 8:16 PM, Mark Lawrence
>> wrote:
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
>>> The death penalty should be rein
On 10/22/14 5:27 AM, ast wrote:
"Chris Angelico" a écrit dans le message de
news:mailman.15058.1413968065.18130.python-l...@python.org...
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever
On Tue, Oct 21, 2014, at 19:16, Dan Stromberg wrote:
> Actually, doesn't line buffering sometimes exist inside an OS kernel?
> stty/termios/termio/sgtty relate here, for *ix examples. Supporting
> code: http://stromberg.dnsalias.org/~strombrg/ttype/ It turns on
> character-at-a-time I/O in the tt
On Wed, Oct 22, 2014 at 4:43 AM, Tim Chase
wrote:
> On 2014-10-22 12:29, Peter Otten wrote:
>> That looks like log(a) while a parity check takes constant time:
>>
>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>> 1000 loops, best of 3: 0.124 usec per loop
>> $ python3 -m timeit -s 'a = 10**100
On Wed, Oct 22, 2014 at 5:02 AM, Peter Otten <__pete...@web.de> wrote:
> Michiel Overtoom wrote:
>
>>
>> On Oct 22, 2014, at 12:29, Peter Otten wrote:
>>
>>> That looks like log(a) while a parity check takes constant time:
>>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>>
>>
>> Do you mean 'parity
On Wednesday, October 22, 2014 5:01:08 PM UTC+5:30, Ned Batchelder wrote:
> On 10/22/14 5:05 AM, buscacio wrote:
> > Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
> >> Hello
> >> Is there in Python something like:
> >> j = (j >= 10) ? 3 : j+1;
> >> as in C language ?
> >>
On Wed, Oct 22, 2014 at 10:36 PM, wrote:
> Could anyone please help me to resolve 403 forbidden error while logging
> into an application.
That comes down tot he server you're talking to. Maybe your
username/password is wrong, or maybe you need to send back a cookie,
or something. If you do s
Hi all, i have a little problem. I have a simple automation to fill login form
fields. Actually, it passes good, but there's the problem. I need to see actual
output in my console after the script filled fields, like "Logged in
successfully" or "Username not found". I tried many stuff, but nothi
On 22/10/2014 10:14, ast wrote:
a écrit dans le message de
news:7839376e-fc27-4299-ae63-4ddf17ef9...@googlegroups.com...
Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
Hello
Is there in Python something like:
j = (j >= 10) ? 3 : j+1;
as in C language ?
th
Ned Batchelder :
> Why on earth would you recommend this outdated hack, when there's a
> true conditional operator? [...] if someone asks for a conditional
> operator, at least show them one!
No good deed goes unpunished.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On 22/10/2014 10:27, Chris Angelico wrote:
On Wed, Oct 22, 2014 at 8:16 PM, Mark Lawrence wrote:
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
The death penalty should be reintroduced into the UK for two crimes, writing
code like the above and using google groups.
No
Hai,
Could anyone please help me to resolve 403 forbidden error while logging into
an application.
Following is the error details:
Traceback (most recent call last):
File "./example6.py", line 18, in
response = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 126, in u
On 10/22/14 5:05 AM, busca...@gmail.com wrote:
Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
Hello
Is there in Python something like:
j = (j >= 10) ? 3 : j+1;
as in C language ?
thx
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
W
Michiel Overtoom wrote:
>
> On Oct 22, 2014, at 12:29, Peter Otten wrote:
>
>> That looks like log(a) while a parity check takes constant time:
>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>
>
> Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ?
> Because a parity bit deno
Dan Stromberg :
> On Mon, Oct 20, 2014 at 9:41 PM, Marko Rauhamaa wrote:
>> Terminal devices support line buffering on write.
> Yes, though that's not the only place it's useful.
>
>> Line buffering on read is an illusion created by higher-level libraries.
>> The low-level read function reads in
On 2014-10-22 12:29, Peter Otten wrote:
> That looks like log(a) while a parity check takes constant time:
>
> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
> 1000 loops, best of 3: 0.124 usec per loop
> $ python3 -m timeit -s 'a = 10**100' 'a & 1'
> 1000 loops, best of 3: 0.124 usec per loo
On Oct 22, 2014, at 12:29, Peter Otten wrote:
> That looks like log(a) while a parity check takes constant time:
> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ? Because a
parity bit denotes whether the *number* of '1' bits is
Peter Pearson wrote:
> I'm using Matplotlib to present a "control" window with clickable
> buttons, and to plot things in another window when you click buttons,
> in the style of the code below. I'm ashamed of the stinky way I
> use "first" to call plt.show the first time data are plotted but the
ast wrote:
>
> "Chris Angelico" a écrit dans le message de
> news:mailman.15058.1413968065.18130.python-l...@python.org...
>> On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
>>> If i am writing (-1)**1000 on a python program, will the
>>> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>>>
On Wed, Oct 22, 2014 at 8:16 PM, Mark Lawrence wrote:
>> without not:
>> j = [j+1, 3][j>=10]
>> with not:
>> j = [3, j+1][not (j>=10)]
>>
>
> The death penalty should be reintroduced into the UK for two crimes, writing
> code like the above and using google groups.
No no no. Code like that doesn'
"Chris Angelico" a écrit dans le message de
news:mailman.15058.1413968065.18130.python-l...@python.org...
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
In fact i have (-1)**N with
a écrit dans le message de
news:7839376e-fc27-4299-ae63-4ddf17ef9...@googlegroups.com...
Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
Hello
Is there in Python something like:
j = (j >= 10) ? 3 : j+1;
as in C language ?
thx
without not:
j = [j+1, 3][j>
On 22/10/2014 10:05, busca...@gmail.com wrote:
Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
Hello
Is there in Python something like:
j = (j >= 10) ? 3 : j+1;
as in C language ?
thx
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
T
On Wed, Oct 22, 2014 at 8:05 PM, wrote:
> Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
>> Hello
>>
>>
>>
>> Is there in Python something like:
>>
>>
>>
>> j = (j >= 10) ? 3 : j+1;
>>
>>
>>
>> as in C language ?
>>
>>
>>
>> thx
>
> without not:
> j = [j+1, 3][j>=10]
> w
ast wrote:
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> In fact i have (-1)**N with N an integer potentially big.
>
> I do some tests that suggest that Python is clever
Let's see:
$ python3
Python 3.4.0 (default, Apr 1
Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu:
> Hello
>
>
>
> Is there in Python something like:
>
>
>
> j = (j >= 10) ? 3 : j+1;
>
>
>
> as in C language ?
>
>
>
> thx
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
--
https://mail.pyt
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> In fact i have (-1)**N with N an integer potentially big.
Exponentiation is far more efficient than the naive implementation of
iter
- Original Message -
> From: "ast"
> To: python-list@python.org
> Sent: Wednesday, 22 October, 2014 10:27:34 AM
> Subject: (-1)**1000
>
> Hello
>
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> In fact i have (-1)*
- Original Message -
> From: "ast"
> To: python-list@python.org
> Sent: Wednesday, 22 October, 2014 10:29:43 AM
> Subject: (test) ? a:b
>
> Hello
>
> Is there in Python something like:
>
> j = (j >= 10) ? 3 : j+1;
>
> as in C language ?
>
> thx
j = 3 if j >=10 else j+1
Cheers
JM
Hello
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
In fact i have (-1)**N with N an integer potentially big.
I do some tests that suggest that Python is clever
thx
--
https://mail.python.org/mailman/listinfo/python-list
Hello
Is there in Python something like:
j = (j >= 10) ? 3 : j+1;
as in C language ?
thx
--
https://mail.python.org/mailman/listinfo/python-list
86 matches
Mail list logo