Eliot 0.5.0: Structured Logging as Storytelling

2014-10-22 Thread Itamar Turner-Trauring
Eliot provides a structured logging and tracing system for Python that generates log messages describing a forest of nested actions. Actions start and eventually finish, successfully or not. Log messages thus tell a story: what happened and what caused it. Eliot is released by ClusterHQ

Re: Flush stdin

2014-10-22 Thread Chris Angelico
On Wed, Oct 22, 2014 at 4:38 PM, Marko Rauhamaa ma...@pacujo.net wrote: Dan Stromberg drsali...@gmail.com: On Mon, Oct 20, 2014 at 9:41 PM, Marko Rauhamaa ma...@pacujo.net wrote: Nagle affects the communication between the peer OS kernels and isn't directly related to anything the application

(test) ? a:b

2014-10-22 Thread ast
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

(-1)**1000

2014-10-22 Thread ast
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

Re: (test) ? a:b

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com 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

Re: (-1)**1000

2014-10-22 Thread Jean-Michel Pichavant
- Original Message - From: ast nom...@invalid.com 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

Re: (-1)**1000

2014-10-22 Thread Chris Angelico
On Wed, Oct 22, 2014 at 7:27 PM, ast nom...@invalid.com 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

Re: (test) ? a:b

2014-10-22 Thread buscacio
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)] --

Re: (-1)**1000

2014-10-22 Thread Peter Otten
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 11

Re: (test) ? a:b

2014-10-22 Thread Chris Angelico
On Wed, Oct 22, 2014 at 8:05 PM, 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,

Re: (test) ? a:b

2014-10-22 Thread Mark Lawrence
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)] The

Re: (test) ? a:b

2014-10-22 Thread ast
busca...@gmail.com 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

Re: (-1)**1000

2014-10-22 Thread ast
Chris Angelico ros...@gmail.com 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 nom...@invalid.com wrote: If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or something

Re: (test) ? a:b

2014-10-22 Thread Chris Angelico
On Wed, Oct 22, 2014 at 8:16 PM, Mark Lawrence breamore...@yahoo.co.uk 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

Re: (-1)**1000

2014-10-22 Thread Peter Otten
ast wrote: Chris Angelico ros...@gmail.com 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 nom...@invalid.com wrote: If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or

Re: Matplotlib: getting a figure to show without plt.show()

2014-10-22 Thread Peter Otten
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 then to

Re: (-1)**1000

2014-10-22 Thread Michiel Overtoom
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

Re: (-1)**1000

2014-10-22 Thread Tim Chase
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 loop $

Re: Flush stdin

2014-10-22 Thread Marko Rauhamaa
Dan Stromberg drsali...@gmail.com: On Mon, Oct 20, 2014 at 9:41 PM, Marko Rauhamaa ma...@pacujo.net 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

Re: (-1)**1000

2014-10-22 Thread Peter Otten
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 denotes whether

Re: (test) ? a:b

2014-10-22 Thread Ned Batchelder
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)] Why

403 forbidden error

2014-10-22 Thread diyaraik
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 module response = urllib2.urlopen(req) File /usr/lib/python2.7/urllib2.py, line 126,

Re: (test) ? a:b

2014-10-22 Thread Mark Lawrence
On 22/10/2014 10:27, Chris Angelico wrote: On Wed, Oct 22, 2014 at 8:16 PM, Mark Lawrence breamore...@yahoo.co.uk 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

Re: (test) ? a:b

2014-10-22 Thread Marko Rauhamaa
Ned Batchelder n...@nedbatchelder.com: 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 --

Re: (test) ? a:b

2014-10-22 Thread Mark Lawrence
On 22/10/2014 10:14, ast wrote: busca...@gmail.com 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

Problems with selenium 2 and python 3.4.1

2014-10-22 Thread novozhiloffvadim
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 nothing

Re: 403 forbidden error

2014-10-22 Thread Chris Angelico
On Wed, Oct 22, 2014 at 10:36 PM, diyar...@gmail.com 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

Re: (test) ? a:b

2014-10-22 Thread Rustom Mody
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 ? thx without

Re: (-1)**1000

2014-10-22 Thread Ian Kelly
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' as in

Re: (-1)**1000

2014-10-22 Thread Ian Kelly
On Wed, Oct 22, 2014 at 4:43 AM, Tim Chase python.l...@tim.thechases.com 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

Re: Flush stdin

2014-10-22 Thread random832
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 tty

Re: (-1)**1000

2014-10-22 Thread Ned Batchelder
On 10/22/14 5:27 AM, ast wrote: Chris Angelico ros...@gmail.com 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 nom...@invalid.com wrote: If i am writing (-1)**1000 on a python program, will the interpreter do

Re: (test) ? a:b

2014-10-22 Thread alister
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 breamore...@yahoo.co.uk wrote: without not: j = [j+1, 3][j=10] with not: j = [3, j+1][not (j=10)] The death penalty should be reintroduced

Re: (test) ? a:b

2014-10-22 Thread Chris Angelico
On Thu, Oct 23, 2014 at 2:12 AM, alister alister.nospam.w...@ntlworld.com 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

Re: (test) ? a:b

2014-10-22 Thread alister
On Thu, 23 Oct 2014 02:18:42 +1100, Chris Angelico wrote: On Thu, Oct 23, 2014 at 2:12 AM, alister alister.nospam.w...@ntlworld.com 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

Re: Flush stdin

2014-10-22 Thread Marko Rauhamaa
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 reads

Re: When to use assert

2014-10-22 Thread Steven D'Aprano
Chris Angelico wrote: On Wed, Oct 22, 2014 at 12:44 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: Permissions on files installed by pip?

2014-10-22 Thread Adam Funk
On 2014-10-17, Jean-Michel Pichavant wrote: - Original Message - From: Adam Funk a24...@ducksburg.com 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

Re: When to use assert

2014-10-22 Thread Chris Angelico
On Thu, Oct 23, 2014 at 2:49 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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.

Re: (test) ? a:b

2014-10-22 Thread Dan Stromberg
On Wed, Oct 22, 2014 at 2: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,

Re: When to use assert

2014-10-22 Thread Dan Stromberg
On Wed, Oct 22, 2014 at 9:01 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 23, 2014 at 2:49 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Chris Angelico wrote: I agree that the assert is preferable to the comment. But maybe my level of paranoia is just lower than

Re: (test) ? a:b

2014-10-22 Thread Steven D'Aprano
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 think that's a bit

Re: Python 3.4.1 and blitzdb issue

2014-10-22 Thread Juan Christian
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 a student

Re: Matplotlib: getting a figure to show without plt.show()

2014-10-22 Thread Peter Pearson
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: first

Python 3.4.1 and blitzdb issue

2014-10-22 Thread Juan Christian
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 =

Re: (test) ? a:b

2014-10-22 Thread Chris Angelico
On Thu, Oct 23, 2014 at 3:28 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: Python 3.4.1 and blitzdb issue

2014-10-22 Thread Stéphane Wirtel
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'

Re: (-1)**1000

2014-10-22 Thread Terry Reedy
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

Re: (test) ? a:b

2014-10-22 Thread Michael Torrie
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 actually was the standard

Re: (test) ? a:b

2014-10-22 Thread alister
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 here.

Re: (test) ? a:b

2014-10-22 Thread BartC
Rustom Mody rustompm...@gmail.com 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

Re: (test) ? a:b

2014-10-22 Thread Matthew Ruffalo
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't easily

Re: (test) ? a:b

2014-10-22 Thread Chris Angelico
On Thu, Oct 23, 2014 at 5:27 AM, Matthew Ruffalo mm...@case.edu 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

setuptools + data_files = 2

2014-10-22 Thread luc2
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

Re: (test) ? a:b

2014-10-22 Thread Ned Batchelder
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 = 3

I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
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

Re: I am out of trial and error again Lists

2014-10-22 Thread Joel Goldstick
On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head Seymore4Head@hotmail.invalid 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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick joel.goldst...@gmail.com wrote: On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head Seymore4Head@hotmail.invalid wrote: def nametonumber(name): lst=[] for x,y in enumerate (name): lst=lst.append(y) print (lst) return (lst)

Re: I am out of trial and error again Lists

2014-10-22 Thread Mark Lawrence
On 22/10/2014 21:57, Joel Goldstick wrote: On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head Seymore4Head@hotmail.invalid wrote: def nametonumber(name): lst=[] for x,y in enumerate (name): lst=lst.append(y) print (lst) return (lst) a=[1-800-getcharter] print

Re: I am out of trial and error again Lists

2014-10-22 Thread sohcahtoa82
On Wednesday, October 22, 2014 2:06:35 PM UTC-7, Seymore4Head wrote: On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick joel.goldst...@gmail.com wrote: On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head Seymore4Head@hotmail.invalid wrote: def nametonumber(name): lst=[] for x,y in

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
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 joel.goldst...@gmail.com wrote: On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid 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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
BTW I know I didn't check for Caps yet. On Wed, 22 Oct 2014 18:30:17 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: One more question. if y in str(range(10) Why doesn't that work. I commented it out

Re: I am out of trial and error again Lists

2014-10-22 Thread Denis McMahon
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 to use a ()

Re: I am out of trial and error again Lists

2014-10-22 Thread Mark Lawrence
On 22/10/2014 23:30, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid 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

Re: I am out of trial and error again Lists

2014-10-22 Thread MRAB
On 2014-10-22 23:30, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid 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

Re: Problem with Android Build [SOLVED]

2014-10-22 Thread Cyd Haselton
On Tue, Oct 21, 2014 at 1:57 PM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 22, 2014 at 5:53 AM, Cyd Haselton chasel...@gmail.com 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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 22:43:14 + (UTC), Denis McMahon denismfmcma...@gmail.com 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)

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2014 23:30, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: One more question. if y in str(range(10) Why doesn't that work. Invalid syntax, it

Re: I am out of trial and error again Lists

2014-10-22 Thread Mark Lawrence
On 23/10/2014 00:26, Seymore4Head wrote: On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2014 23:30, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: One more question. if y in str(range(10) Why

The “trials” in “trial and error” should be as simple as possible (was: I am out of trial and error again Lists)

2014-10-22 Thread Ben Finney
Seymore4Head Seymore4Head@Hotmail.invalid 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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 23/10/2014 00:26, Seymore4Head wrote: On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2014 23:30, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head

Re: I am out of trial and error again Lists

2014-10-22 Thread Steven D'Aprano
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 getting

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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.

the ressurection of ZOPE for web domination? bluebream and caveman the answer?

2014-10-22 Thread johannes falcone
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?

Re: (test) ? a:b

2014-10-22 Thread Steven D'Aprano
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, it just drives me nuts. This

Re: I am out of trial and error again Lists

2014-10-22 Thread MRAB
On 2014-10-23 01:02, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 23/10/2014 00:26, Seymore4Head wrote: On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2014 23:30, Seymore4Head wrote: On

Re: I am out of trial and error again Lists

2014-10-22 Thread MRAB
On 2014-10-23 01:10, Seymore4Head wrote: On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: I am out of trial and error again Lists

2014-10-22 Thread alex23
On 23/10/2014 10:02 AM, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk 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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Thu, 23 Oct 2014 02:31:57 +0100, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-10-23 01:10, Seymore4Head wrote: On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Seymore4Head wrote: Those string errors were desperate attempts to fix the

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Thu, 23 Oct 2014 11:37:27 +1000, alex23 wuwe...@gmail.com wrote: On 23/10/2014 10:02 AM, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: One more question. if y in str(range(10) Why doesn't that work. I suggest you try str(range(10))

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 21:35:19 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: On Thu, 23 Oct 2014 02:31:57 +0100, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-10-23 01:10, Seymore4Head wrote: On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info

Re: I am out of trial and error again Lists

2014-10-22 Thread Larry Hudson
On 10/22/2014 05:02 PM, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: snip (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

Re: I am out of trial and error again Lists

2014-10-22 Thread Seymore4Head
On Wed, 22 Oct 2014 19:58:24 -0700, Larry Hudson org...@yahoo.com wrote: On 10/22/2014 05:02 PM, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: snip (This is in reference to the line: if y in str(range(10)):) I suggest you try

Re: I am out of trial and error again Lists

2014-10-22 Thread Rustom Mody
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

Re: (test) ? a:b

2014-10-22 Thread Gregory Ewing
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

Re: (test) ? a:b

2014-10-22 Thread Vito De Tullio
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 --

[issue22692] Problems with Python's help()

2014-10-22 Thread James
New submission from James: Hello, I really think that Microsoft’s last release of Quick Basic 4.5 really had the ultimate of all help files. Here’s why, you could cut and copy the code to the program you were working on, and then alter it to your program. It was one of the nicer things

[issue22694] The help file issue I'm having.

2014-10-22 Thread James
New submission from James: Hello, Now, I really want you to think about the hunt and pick method of programming and learning how to program. Being self taught, isn’t something that can happen unless, the authors of the software want people to learn how to use it. Help files, are not

[issue6818] remove/delete method for zipfile/tarfile objects

2014-10-22 Thread Yuval Greenfield
Yuval Greenfield added the comment: Ping. Has this been postponed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6818 ___ ___ Python-bugs-list

[issue6818] remove/delete method for zipfile/tarfile objects

2014-10-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +serhiy.storchaka versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6818 ___

[issue22678] An OSError subclass for no space left on device would be nice

2014-10-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +barry, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22678 ___ ___ Python-bugs-list

[issue22695] open() declared deprecated in python 3 docs

2014-10-22 Thread Василий Макаров
New submission from Василий Макаров: Python 3 open() documentation ( https://docs.python.org/3/library/functions.html#open ) is probably broken. Here is what one can see at the end of open() description: ... Deprecated since version 3.4, will be removed in version 4.0. The 'U' mode. Reader

[issue22695] open() declared deprecated in python 3 docs

2014-10-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset a2ecc284eaa7 by Victor Stinner in branch '3.4': Issue #22695: Fix syntax of open() doc https://hg.python.org/cpython/rev/a2ecc284eaa7 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue22695] open() declared deprecated in python 3 docs

2014-10-22 Thread STINNER Victor
STINNER Victor added the comment: Reader may assume the open() function is what will be removed, which is wrong AFAIK It looks like an issue with the reST syntax in the documentation. Wait until the doc is regenerated (in a few hours) and then check again the doc please, to confirm that

[issue22695] open() declared deprecated in python 3 docs

2014-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other deprecated-removed instructions without following empty line in the docs. Should they be changed? However the deprecated instruction works without following empty line. It looks as there is a bug in the implementation of the

[issue22695] open() declared deprecated in python 3 docs

2014-10-22 Thread STINNER Victor
STINNER Victor added the comment: However the deprecated instruction works without following empty line. It looks as there is a bug in the implementation of the deprecated-removed instruction. Agreed, we can maybe enhance that. At least emit a warning? --

[issue22637] avoid using a shell in uuid: replce os.popen with subprocess.Popen

2014-10-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22637 ___

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2014-10-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22636 ___ ___

[issue22599] traceback: errors in the linecache module at exit

2014-10-22 Thread STINNER Victor
STINNER Victor added the comment: traceback_at_exit-2.patch: Updated patch to remove import builtins from tokenize.py, it's no more needed. Antoine, Serhiy: What do you think about this patch? IMO the bug is very simple and fixes a common bug. --

  1   2   >