Re: executor.map() TypeError: zip argument #2 must support iteration

2013-04-01 Thread Steven D'Aprano
On Sun, 31 Mar 2013 21:45:21 -0700, iMath wrote: > executor.map()TypeError: zip argument #2 must support iteration > > when I run it ,just generated TypeError: zip argument #2 must support > iteration. can anyone help me fix this problem ? Yes. Read the error message, and inspect the line th

Is there a simple stand alone python app I can use on my Kindle fire?

2013-04-01 Thread ah
(it was recommended that I post this query here (originally posted on the tutor page)). Hello, I'm enjoying learning python, and would like to be able to study and practice on the go, using my kindle fire reader. (wifi enabled). Amazon does have an app, Qpython lite, but requires a  liv

Re: Performance of int/long in Python 3

2013-04-01 Thread Steven D'Aprano
On Sun, 31 Mar 2013 22:33:45 -0700, rusi wrote: > On Mar 31, 5:55 pm, Mark Lawrence wrote: > > > >> I'm feeling very sorry for this horse, it's been flogged so often it's >> down to bare bones. > > While I am now joining the camp of those fed up with jmf's whining, I do > wonder if we are sho

How to do this?

2013-04-01 Thread Ana Dionísio
So I have this script: " from numpy import array vt=[0]*20 vt = array(vt, dtype=dict) for t in range(20): if t == 4: vt[t]=1 else: vt[t]=0 " And have this output: [0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] What I need is when t == 4 I need to put 1 in that position and

Re: How to do this?

2013-04-01 Thread Vincent Vande Vyvre
Le 01/04/13 12:14, Ana Dionísio a écrit : > for t in range(20): > if t == 4: > vt[t]=1 Sets only the needed values: for t in range(4, 8): vt[t]=1 -- Vincent V.V. Oqapy . Qarte . PaQager

Re: How to do this?

2013-04-01 Thread Ana Dionísio
Nice! Thank you! And if I need something like this? [0 0 0 0 0.17 0.17 0.17 0.17 0 0 0 0.17 0.17 0.17 0 0 0 0 0 0 0] How can I do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do this?

2013-04-01 Thread Peter Otten
Ana Dionísio wrote: > Nice! Thank you! > > And if I need something like this? > > [0 0 0 0 0.17 0.17 0.17 0.17 0 0 0 0.17 0.17 0.17 0 0 0 0 0 0 0] > > How can I do this? With vanilla Python: >>> vt = [0] * 20 >>> for i, v in enumerate(vt): ... if 4 <= i < 8 or 13 <= i < 16: ...

Re: Creating a dictionary from a .txt file

2013-04-01 Thread Neil Cerutti
On 2013-03-31, Roy Smith wrote: > And, this is a good excuse to explore some of the interesting > third-party modules. For example, mwclient ("pip install > mwclient") gives you a neat Python interface to wikipedia. And > there's a whole landscape of string matching packages to > explore. > > We

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-04-01 Thread Roy Smith
In article <51590a2b$0$3$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Concrete examples of transitive relations: greater than, equal to, less > than and equal to. Will Python 4 implement "less than and equal to"? :-) [Warning: topic creep] Well, they are transitive over

Re: How to do this?

2013-04-01 Thread Dave Angel
On 04/01/2013 07:08 AM, Ana Dionísio wrote: [0 0 0 0 0.17 0.17 0.17 0.17 0 0 0 0.17 0.17 0.17 0 0 0 0 0 0 0] I'd do res = "[0 0 0 0 0.17 0.17 0.17 0.17 0 0 0 0.17 0.17 0.17 0 0 0 0 0 0 0]" Unless there's a pattern you're trying to accomplish (like maybe next time you want to do "it" for a li

Re: Performance of int/long in Python 3

2013-04-01 Thread Roy Smith
In article <515941d8$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > [...] > >> OK, that leads to the next question. Is there anyway I can (in Python > >> 2.7) detect when a string is not entirely in the BMP? If I could find > >> all the non-BMP characters, I could replac

Re: How to do this?

2013-04-01 Thread Mark Lawrence
On 01/04/2013 11:14, Ana Dionísio wrote: So I have this script: " from numpy import array Are you aware that this overrides the Python builtin array? It's usually but not always better to do this import numpy as np vt = np.array(vt, dtype=dict) vt=[0]*20 vt = array(vt, dtype=dict) for

Re: Performance of int/long in Python 3

2013-04-01 Thread rusi
On Apr 1, 5:15 pm, Roy Smith wrote: > In article <515941d8$0$29967$c3e8da3$54964...@news.astraweb.com>, >  Steven D'Aprano wrote: > > > [...] > > >> OK, that leads to the next question.  Is there anyway I can (in Python > > >> 2.7) detect when a string is not entirely in the BMP?  If I could find

Error in working with Dict

2013-04-01 Thread inshu chauhan
I have this program which is working with 2 dictionaries segments, class_counts.. but I am getting an error mentioned below the programme. import cv from itertools import * from math import floor, sqrt, ceil from numpy import array, dot, subtract, add, outer, argmax, linalg as lin def Computeseg

Re: Error in working with Dict

2013-04-01 Thread Vincent Vande Vyvre
Le 01/04/13 15:50, inshu chauhan a écrit : > I have this program which is working with 2 dictionaries segments, > class_counts.. but I am getting an error mentioned below the programme. > > import cv > from itertools import * > from math import floor, sqrt, ceil > from numpy import array, dot, sub

PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Pierre O'Dee
PSF [Beaverton, OR] 1 April 2013 -- At a news conference held earlier today, Guido van Rossum announced that he is quitting Python to develop a new language. "Python just makes programming too damn easy and too bug-free," Guido said as part of his remarks in a brief, prepared statement. He added,

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 2:30 AM, Pierre O'Dee wrote: > One insider > shared unconfirmed rumors that Mr. Johnson will be attempting to > revive and steer the now defunct Python language It's about time his untiring contributions to this list and the language were recognized. I fully support this m

A Healthy Alternative to Takeaway Regret

2013-04-01 Thread 23alagmy
A Healthy Alternative to Takeaway Regret http://natigtas7ab.blogspot.com/2013/03/a-healthy-alternative-to-takeaway-regret.html -- http://mail.python.org/mailman/listinfo/python-list

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Grant Edwards
On 2013-04-01, Pierre O'Dee wrote: [...] It took me an embarassingly long time to 'get' Mr. O'Dee's name. -- Grant Edwards grant.b.edwardsYow! I put aside my copy at of "BOWLING WORLD" and gmail

Re: Performance of int/long in Python 3

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 06:11:50 -0700, rusi wrote: > On Apr 1, 5:15 pm, Roy Smith wrote: >> The import job isn't done yet, but so far we've processed 116 million >> records and had to clean up four of them.  I can live with that. >> Sometimes practicality trumps correctness. > > That works out to

Re: Performance of int/long in Python 3

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 08:15:53 -0400, Roy Smith wrote: > In article <515941d8$0$29967$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> [...] >> >> OK, that leads to the next question. Is there anyway I can (in >> >> Python 2.7) detect when a string is not entirely in the BMP?

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 3:18 AM, Grant Edwards wrote: > On 2013-04-01, Pierre O'Dee wrote: > > [...] > > It took me an embarassingly long time to 'get' Mr. O'Dee's name. I only just did now, after you pointed it out. Must be an accent thing, that's not really how I pronounce the word. ChrisA --

Re: Performance of int/long in Python 3

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 4:07 AM, Steven D'Aprano wrote: > On Mon, 01 Apr 2013 08:15:53 -0400, Roy Smith wrote: >> It turns out, the problem is that the version of MySQL we're using > > Well there you go. Why don't you use a real database? > > http://www.postgresql.org/docs/9.2/static/multibyte.html

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Emanuel Woiski
On 2013-04-01, Pierre O'Dee wrote: Guido went on to say that he's now working on a new language called Giddy-up-and-Go which will take the worst features of C++, Java, and French combined with elements of both PHP and Klingon syntax. [...] We are all eagerly waitin' for the new GuG (or GuGO?) lang

Re: Error in working with Dict

2013-04-01 Thread Dave Angel
On 04/01/2013 09:50 AM, inshu chauhan wrote: I have this program which is working with 2 dictionaries segments, class_counts.. but I am getting an error mentioned below the programme. import cv from itertools import * from math import floor, sqrt, ceil from numpy import array, dot, subtract, add

Re: Performance of int/long in Python 3

2013-04-01 Thread MRAB
On 01/04/2013 18:07, Steven D'Aprano wrote: On Mon, 01 Apr 2013 08:15:53 -0400, Roy Smith wrote: In article <515941d8$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: [...] >> OK, that leads to the next question. Is there anyway I can (in >> Python 2.7) detect when a str

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Mark Lawrence
On 01/04/2013 16:30, Pierre O'Dee wrote: Some features have already been hinted at for the new language. No Unicode -- BAUDOT is expected to be the new character encoding. --Pierre O'Dee, self-appointed spokesman for the PSF This is excellent news, no unicode means no chance of any performan

Re: Help with python code!

2013-04-01 Thread Alister
On Sun, 31 Mar 2013 14:32:21 -0700, gerrymcgovern wrote: > On Sunday, March 31, 2013 5:27:06 PM UTC-4, Roy Smith wrote: >> In article <4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com>, >> >> jojo wrote: >> >> >> >> > Thanks for your replies. Just to be clear this is for a interview and

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Ethan Furman
On 04/01/2013 10:21 AM, Emanuel Woiski wrote: On 2013-04-01, Pierre O'Dee wrote: Guido went on to say that he's now working on a new language called Giddy-up-and-Go which will take the worst features of C++, Java, and French combined with elements of both PHP and Klingon syntax. [...] We are all

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Steve Simmons
It's in recognition of the gap between English and French - it helps you to bridge it. Mark Lawrence wrote: >On 01/04/2013 16:30, Pierre O'Dee wrote: >> >> Some features have already been hinted at for the new language. >> No Unicode -- BAUDOT is expected to be the new character >> encoding. >

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread John Ladasky
On Monday, April 1, 2013 8:30:56 AM UTC-7, Pierre O'Dee wrote: > Guido went on to say that he's now working on a new language > called Giddy-up-and-Go which will take the worst features of C++, > Java, and French combined with elements of both PHP and Klingon > syntax. He said that this new endeav

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread llanitedave
Another detail about the new language: the Btrees used in Python's persistent object data structures have been replaced by... A SHRUBBERY! -- http://mail.python.org/mailman/listinfo/python-list

Curl and python httplib?

2013-04-01 Thread ??????PHP
Guys, I take a project that need send request to Hadoop by curl. But now, the curl and pycurl can't satisfy my project. So i need use the powerful httplib. But failed. my curl request: curl -i -X PUT "http://localhost:50070/webhdfs/v1/levi/7?op=CREATE"; my return: HTTP/1.1 307 TEMPORARY_REDIR

Re: round off to two decimal & return float

2013-04-01 Thread ஆமாச்சு
On Saturday 30 March 2013 03:14 PM, Peter Otten wrote: > style = xlwt.XFStyle() > style.num_format_str = "0.00" Yes. That was really helpful & what I expected. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

ISO deprecates ASCII Horizontal Tab control character

2013-04-01 Thread fsb
The subcommittee of ISO Joint Technical Committee 1 that is responsible for coded character sets has deprecated the Horizontal Tab control character in an approved revision of ISO/IEC 646 to be published in the next few months. "The days of HT's usefulness in printer control are long gone," said

Re: Performance of int/long in Python 3

2013-04-01 Thread jmfauth
- I'm not whining or and I'm not complaining (and never did). I always exposed facts. I'm not especially interested in Python, I'm interested in Unicode. Usualy when I posted examples, there are confirmed. What I see is this (std "download-abled" Python's on Windows 7 (and other Windo

os.system() with imbeded quotes on centos

2013-04-01 Thread cevyne
I get the example os.system('ls -al') no problem. i'm trying to create a variable with my command built in it but needs to include quotes. Portion of code is as follows: someip = '192.168.01.01' var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > junk' print

Re: Performance of int/long in Python 3

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 6:15 AM, jmfauth wrote: > Py32 import timeit timeit.repeat("'a' * 1000 + 'ẞ'") > [0.7005365263669056, 0.6810694766790423, 0.6811978680727229] timeit.repeat("'a' * 1000 + 'z'") > [0.7105829560031083, 0.6904999426964764, 0.6938637184431968] > > Py33 > import tim

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Tim Daneliuk
On 04/01/2013 10:30 AM, Pierre O'Dee wrote: PSF [Beaverton, OR] 1 April 2013 -- At a news conference held Amazing that this should show up when it did. Just today, we had Board Meeting at the intergalactic HQ of TundraWare Inc. and finally decided to move forward with this project we'd announc

Re: Curl and python httplib?

2013-04-01 Thread Mark Lawrence
On 30/03/2013 05:08, Сѧ԰PHP wrote: Guys, I take a project that need send request to Hadoop by curl. But now, the curl and pycurl can't satisfy my project. So i need use the powerful httplib. But failed. *my curl request:* curl -i -X PUT "http://localhost:50070/webhdfs/v1/levi/7?op=CREATE"; *my

Re: os.system() with imbeded quotes on centos

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 6:22 AM, wrote: > var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > > junk' > lynx -dump 'http://192.168.01.01/cgi-bin/.log&.submit=+++Go%21+++ > junk' The problem is the &, which splits the command. Note how your manual execution puts

Re: Performance of int/long in Python 3

2013-04-01 Thread Mark Lawrence
On 01/04/2013 20:15, jmfauth wrote: - I'm not whining or and I'm not complaining (and never did). I always exposed facts. The only fact I'm aware of is an edge case that is being addressed on the Python bug tracker, sorry I'm too lazy to look up the number again. I'm not especial

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Tim Daneliuk
On 04/01/2013 01:32 PM, llanitedave wrote: Another detail about the new language: the Btrees used in Python's persistent object data structures have been replaced by... A SHRUBBERY! I believe you mean "A 'oly shrubbery", do you not? -- ---

Re: ISO deprecates ASCII Horizontal Tab control character

2013-04-01 Thread David Robinow
If only On Mon, Apr 1, 2013 at 3:10 PM, wrote: > The subcommittee of ISO Joint Technical Committee 1 that is responsible > for coded character sets has deprecated the Horizontal Tab control > character in an approved revision of ISO/IEC 646 to be published in the > next few months. > > "The day

youtube-dl, a YouTube downloader in Python

2013-04-01 Thread vasudevram
Folks may find this of interest, both from a programming and from an end-user point of view: youtube-dl, a YouTube downloader in Python: http://jugad2.blogspot.in/2013/03/youtube-dl-yourube-downloader-in-python.html I tried it out and it worked well. Downloaded a few videos using it. (The "ru

Switching from Apche to LiteSpeed

2013-04-01 Thread Νίκος Γκρ33κ
Just today i changed from HostGator to EZPZ, which means from Apache Web Server to LiteSpeed. Does anyone know why iam seeing what iam seeing at http://superhost.gr I see weird encoding although inside my python script i have: #!/usr/bin/python # -*- coding=utf-8 -* Also dod you advise me to s

Re: os.system() with imbeded quotes on centos

2013-04-01 Thread John Gordon
In <0c9717ca-52dd-49ce-8102-e14328838...@googlegroups.com> cev...@gmail.com writes: > someip = '192.168.01.01' > var1 = 'lynx -dump http://' + someip + '/cgi-bin/.log&.submit=+++Go%21+++ > > junk' '&' is a special character in shell commands. You'll need to quote or escape it. Try this:

Re: Performance of int/long in Python 3

2013-04-01 Thread jmfauth
On 1 avr, 21:28, Chris Angelico wrote: > On Tue, Apr 2, 2013 at 6:15 AM, jmfauth wrote: > > Py32 > import timeit > timeit.repeat("'a' * 1000 + 'ẞ'") > > [0.7005365263669056, 0.6810694766790423, 0.6811978680727229] > timeit.repeat("'a' * 1000 + 'z'") > > [0.7105829560031083, 0.69049

Re: Switching from Apche to LiteSpeed

2013-04-01 Thread John Gordon
In <9a35850a-7fcb-4585-84ae-5e13cef91...@googlegroups.com> =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?= writes: > Just today i changed from HostGator to EZPZ, which means from Apache Web > Server to LiteSpeed. > Does anyone know why iam seeing what iam seeing at http://superhost.gr > I see weird encodin

Re: Performance of int/long in Python 3

2013-04-01 Thread Roy Smith
In article <5159beb6$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >> The import job isn't done yet, but so far we've processed 116 million >> records and had to clean up four of them. I can live with that. >> Sometimes practicality trumps correctness. > >Well, true. It has

Re: Switching from Apche to LiteSpeed

2013-04-01 Thread Mark Lawrence
On 01/04/2013 21:09, Νίκος Γκρ33κ wrote: Just today i changed from HostGator to EZPZ, which means from Apache Web Server to LiteSpeed. Does anyone know why iam seeing what iam seeing at http://superhost.gr I see weird encoding although inside my python script i have: #!/usr/bin/python # -*- c

Re: Performance of int/long in Python 3

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 7:28 AM, jmfauth wrote: > Of course this is an example, as many I gave. Examples you may find in > apps. > Show me an *entire app* that suffers. Show me one. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread llanitedave
On Monday, April 1, 2013 12:59:04 PM UTC-7, Tim Daneliuk wrote: > On 04/01/2013 01:32 PM, llanitedave wrote: > > > Another detail about the new language: the Btrees used in Python's > > persistent object data structures have been replaced by... > > > > > > A SHRUBBERY! > > > > > > > I belie

Re: Performance of int/long in Python 3

2013-04-01 Thread Mark Lawrence
On 01/04/2013 21:35, Chris Angelico wrote: On Tue, Apr 2, 2013 at 7:28 AM, jmfauth wrote: Of course this is an example, as many I gave. Examples you may find in apps. Show me an *entire app* that suffers. Show me one. ChrisA Please don't hold your breath. -- If you're using GoogleCrap™

Re: Performance of int/long in Python 3

2013-04-01 Thread Mark Lawrence
On 01/04/2013 21:28, jmfauth wrote: On 1 avr, 21:28, Chris Angelico wrote: On Tue, Apr 2, 2013 at 6:15 AM, jmfauth wrote: Py32 import timeit timeit.repeat("'a' * 1000 + 'ẞ'") [0.7005365263669056, 0.6810694766790423, 0.6811978680727229] timeit.repeat("'a' * 1000 + 'z'") [0.7105829560031083

Re: Help

2013-04-01 Thread khaosyt
Self-bump -- http://mail.python.org/mailman/listinfo/python-list

Re: Help

2013-04-01 Thread khaosyt
Self-bump -- http://mail.python.org/mailman/listinfo/python-list

Re: Help

2013-04-01 Thread Mark Lawrence
On 01/04/2013 22:42, khao...@gmail.com wrote: Self-bump It's considered polite to wait for at least 24 hours before bumping a question. You might have got more answers if you'd given a decent subject line rather than "Help". As it happens all you need do is loop around the string that is

Re: Curl and python httplib?

2013-04-01 Thread vasudevram
On Tuesday, April 2, 2013 1:03:58 AM UTC+5:30, Mark Lawrence wrote: > On 30/03/2013 05:08, Сѧ԰PHP wrote: > > > Guys, > > > > > > I take a project that need send request to Hadoop by curl. > > > But now, the curl and pycurl can't satisfy my project. So i need use the > > > powerful httplib. >

Re: Help

2013-04-01 Thread khaosyt
On Monday, April 1, 2013 6:09:04 PM UTC-4, Mark Lawrence wrote: > On 01/04/2013 22:42, khao...@gmail.com wrote: > > > Self-bump > > > > > > > It's considered polite to wait for at least 24 hours before bumping a > > question. You might have got more answers if you'd given a decent > > sub

Re: Help

2013-04-01 Thread John Gordon
In khao...@gmail.com writes: > If I wanted to get the sum of some numbers (for example: 1 + 2 + 3 + 4 > + 5 = 15) from the attached program what do I do? Keep in mind that the > print statement prints the integers individually. It's not clear what you're asking for. The attached program doesn

Re: Help

2013-04-01 Thread khaosyt
On Monday, April 1, 2013 6:12:43 PM UTC-4, John Gordon wrote: > In khao...@gmail.com > writes: > > > > > If I wanted to get the sum of some numbers (for example: 1 + 2 + 3 + 4 > > > + 5 = 15) from the attached program what do I do? Keep in mind that the > > > print statement prints the integ

Re: Help

2013-04-01 Thread Dave Angel
On 04/01/2013 05:42 PM, khao...@gmail.com wrote: Self-bump Normally, bumping a message/thread means replying to it. You're leaving a NEW message with no context, no reply, and a different uninformative subject line. And you're leaving it from googlegroups, with two copies. If you want to

Re: Help

2013-04-01 Thread Mark Lawrence
On 01/04/2013 23:12, khao...@gmail.com wrote: On Monday, April 1, 2013 6:09:04 PM UTC-4, Mark Lawrence wrote: On 01/04/2013 22:42, khao...@gmail.com wrote: Self-bump It's considered polite to wait for at least 24 hours before bumping a question. You might have got more answers if you

Re: Help

2013-04-01 Thread John Gordon
In <118e161a-4981-4696-8bdb-780bf8248...@googlegroups.com> khao...@gmail.com writes: > > It's not clear what you're asking for. The attached program doesn't > > (appear to) work with sums at all; why would you want to use it? > > Writing a new program from scratch would seem to be a better choic

Re: Get multiprocessing.Queue to do priorities

2013-04-01 Thread madeleine . udell
Was this issue ever resolved? What is the current best practice for those wishing to use a priority queue with multiprocessing? On Sunday, May 10, 2009 6:35:03 AM UTC-7, Jesse Noller wrote: > On Sat, May 9, 2009 at 6:11 PM, uuid wrote: > > The Queue module, apparently, is thread safe, but *not*

Re: Help

2013-04-01 Thread khaosyt
On Monday, April 1, 2013 6:33:08 PM UTC-4, John Gordon wrote: > In <118e161a-4981-4696-8bdb-780bf8248...@googlegroups.com> khao...@gmail.com > writes: > > > > > > It's not clear what you're asking for. The attached program doesn't > > > > (appear to) work with sums at all; why would you want

Re: Help

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 23:09:04 +0100, Mark Lawrence wrote: > On 01/04/2013 22:42, khao...@gmail.com wrote: >> Self-bump >> >> > It's considered polite to wait for at least 24 hours before bumping a > question. Yes, but the assignment is due in an hour. Therefore it's critical that we reply instant

Re: Help

2013-04-01 Thread Roy Smith
In article <515a1b7c$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Mon, 01 Apr 2013 23:09:04 +0100, Mark Lawrence wrote: > > > On 01/04/2013 22:42, khao...@gmail.com wrote: > >> Self-bump > >> > >> > > It's considered polite to wait for at least 24 hours before bumpin

Re: Performance of int/long in Python 3

2013-04-01 Thread Neil Hodgson
Mark Lawrence: You've given many examples of the same type of micro benchmark, not many examples of different types of benchmark. Trying to work out what jmfauth is on about I found what appears to be a performance regression with '<' string comparisons on Windows 64-bit. Its around 30% s

Re: Creating a dictionary from a .txt file

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 11:41:03 +, Neil Cerutti wrote: > I tried searching for Frost*, an interesting artist I recently learned > about. "Interesting artist" -- is that another term for "wanker"? *wink* > His name, in combination with a similarly named rap artist, > breaks most search tools

Re: Help

2013-04-01 Thread khaosyt
On Monday, April 1, 2013 7:47:51 PM UTC-4, Roy Smith wrote: > In article <515a1b7c$0$29967$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > > > On Mon, 01 Apr 2013 23:09:04 +0100, Mark Lawrence wrote: > > > > > > > On 01/04/2013 22:42, khao...@gmail.com wrote: > > > >

Re: Creating a dictionary from a .txt file

2013-04-01 Thread C.T.
Thanks for all the help everyone! After I manually edited the txt file, this is what I came up with: car_dict = {} car_file = open('cars.txt', 'r') for line in car_file: temp = line.strip().split(None, 2) temp2 = line.strip().split('\t') if len(temp)==3: year,

Re: Help

2013-04-01 Thread Walter Hurry
On Mon, 01 Apr 2013 15:12:20 -0700, khaosyt wrote: Sigh. Another one for the bozo bin. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 14:44:45 -0700, khaosyt wrote: > If I wanted to get the sum of some numbers (for example: 1 + 2 + 3 + 4 + > 5 = 15) from the attached program what do I do? Keep in mind that the > print statement prints the integers individually. Yes, we know what the print statement does. So

Re: Help please

2013-04-01 Thread Steven D'Aprano
On Sun, 31 Mar 2013 22:41:32 -0700, khaosyt wrote: > On Monday, April 1, 2013 1:24:52 AM UTC-4, Chris Angelico wrote: >> On Mon, Apr 1, 2013 at 4:15 PM, wrote: >> >> > integer = input("Enter a positive integer: ") >> >> > again = raw_input("Again? (Y/N): ") >> >> >> >> Okay, the fir

Re: Creating a dictionary from a .txt file

2013-04-01 Thread Dave Angel
On 04/01/2013 07:53 PM, C.T. wrote: Thanks for all the help everyone! After I manually edited the txt file, this is what I came up with: car_dict = {} car_file = open('cars.txt', 'r') for line in car_file: temp = line.strip().split(None, 2) temp2 = line.strip().split('\t') i

Re: Creating a dictionary from a .txt file

2013-04-01 Thread Walter Hurry
On Mon, 01 Apr 2013 23:53:40 +, Steven D'Aprano wrote: > As far as I'm concerned, anyone in the 21st century who names themselves > or their work (a movie, book, programming language, etc.) something > which breaks search tools is just *begging* for obscurity, and we ought > to respect their w

Re: Help

2013-04-01 Thread khaosyt
On Monday, April 1, 2013 8:00:30 PM UTC-4, Steven D'Aprano wrote: > On Mon, 01 Apr 2013 14:44:45 -0700, khaosyt wrote: > > > > > If I wanted to get the sum of some numbers (for example: 1 + 2 + 3 + 4 + > > > 5 = 15) from the attached program what do I do? Keep in mind that the > > > print stat

Re: Help

2013-04-01 Thread Mark Lawrence
On 02/04/2013 00:56, Walter Hurry wrote: On Mon, 01 Apr 2013 15:12:20 -0700, khaosyt wrote: Sigh. Another one for the bozo bin. I say old chap you're setting yourself up for attacks from the Python Mailing List Police for using the word bozo, so expect a visit from Vicar Sergeant or Detec

python mock Requests and the response

2013-04-01 Thread usmani . kashif9957
I am a beginner to using mock in python and trying to use http://www.voidspace.org.uk/python/mock. Please tell me the basic calls to get me working in below scenario. I am using python's Requests module (http://docs.python-requests.org/en/latest/) . In my views.py, I have a function that makes

Re: Python install Win 7 Problem

2013-04-01 Thread rusi
On Apr 2, 6:02 am, Joe Hill wrote: > Python install Win 7 Problem > > This is some of what others have experienced attempting to install Python > in Win 7  - I'm attempting to do the same with hopefully fewer detours. > > http://www.andrewsturges.com/2012/05/installing-numpy-for-python-3-in... > I

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-04-01 Thread Tim Roberts
morphex wrote: > >While we're on the subject, wouldn't it be nice to have some cap there so >that it isn't possible to more or less block the system with large >exponentiation? There IS a cap. It's called the "MemoryError" exception. But, seriously, what would you have it do instead? -- Tim R

Re: Is there a simple stand alone python app I can use on my Kindle fire?

2013-04-01 Thread Tim Roberts
ah wrote: > >I'm enjoying learning python, and would like to be able to study and practice >on the go, using my kindle fire reader. (wifi enabled). > >Amazon does have an app, Qpython lite, but requires a  live wifi connection >to the internet to run. I'm looking for a simple python app, stand al

Re: PSF News: Guido van Rossum quitting Python to develop new, more difficult to learn, language.

2013-04-01 Thread Tim Roberts
Pierre O'Dee wrote: > >Guido went on to say that he's now working on a new language >called Giddy-up-and-Go which will take the worst features of C++, >Java, and French combined with elements of both PHP and Klingon >syntax. This would seem like the ideal programming language in which to implemen

Re: Switching from Apche to LiteSpeed

2013-04-01 Thread nagia . retsina
Τη Δευτέρα, 1 Απριλίου 2013 11:29:47 μ.μ. UTC+3, ο χρήστης John Gordon έγραψε: > In <9a35850a-7fcb-4585-84ae-5e13cef91...@googlegroups.com> > =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?= writes: > > > > > Just today i changed from HostGator to EZPZ, which means from Apache Web > > Server to LiteSpeed. >

Re: Why does 1**2**3**4**5 raise a MemoryError?

2013-04-01 Thread Chris Angelico
On Tue, Apr 2, 2013 at 3:45 PM, Tim Roberts wrote: > morphex wrote: >> >>While we're on the subject, wouldn't it be nice to have some cap there so >>that it isn't possible to more or less block the system with large >>exponentiation? > > There IS a cap. It's called the "MemoryError" exception. >

Re: Switching from Apche to LiteSpeed

2013-04-01 Thread Steven D'Aprano
On Mon, 01 Apr 2013 20:29:47 +, John Gordon wrote: > In <9a35850a-7fcb-4585-84ae-5e13cef91...@googlegroups.com> > =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?= writes: > >> Just today i changed from HostGator to EZPZ, which means from Apache >> Web Server to LiteSpeed. > >> Does anyone know why iam see