Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Chris (and Michael), On 06/12/13 15:51, Chris Angelico wrote: On Fri, Dec 6, 2013 at 4:16 PM, Michael Torrie wrote: On 12/05/2013 07:34 PM, Garthy wrote: - My fallback if I can't do this is to implement each instance in a dedicated *process* rather than per-thread. However, there is a sig

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Gregory, On 06/12/13 17:28, Gregory Ewing wrote: > Garthy wrote: >> I am running into problems when using multiple interpreters [1] and I >> am presently trying to track down these issues. Can anyone familiar >> with the process of embedding multiple interpreters have a skim of the >> details

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi all, A small update here: On 06/12/13 13:04, Garthy wrote: > [1] It presently crashes in Py_EndInterpreter() after running through a > series of tests during the shutdown of the 32nd interpreter I create. I > don't know if this is significant, but the tests pass for the first 31 > interpreter

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Chris (and Michael), On 06/12/13 15:46, Michael Torrie wrote: > On 12/05/2013 07:34 PM, Garthy wrote: >> - My fallback if I can't do this is to implement each instance in a >> dedicated *process* rather than per-thread. However, there is a >> significant cost to doing this that I would rather

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi all, A small update here: On 06/12/13 13:04, Garthy wrote: > [1] It presently crashes in Py_EndInterpreter() after running through a > series of tests during the shutdown of the 32nd interpreter I create. I > don't know if this is significant, but the tests pass for the first 31 > interprete

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Gregory, On 06/12/13 17:28, Gregory Ewing wrote: > Garthy wrote: >> I am running into problems when using multiple interpreters [1] and I >> am presently trying to track down these issues. Can anyone familiar >> with the process of embedding multiple interpreters have a skim of the >> details

Re: Embedding multiple interpreters

2013-12-06 Thread Chris Angelico
On Fri, Dec 6, 2013 at 6:59 PM, Garthy wrote: > Hi Chris (and Michael), Hehe. People often say that to me IRL, addressing me and my brother. But he isn't on python-list, so you clearly mean Michael Torrie, yet my brain still automatically thought you were addressing Michael Angelico :) > To allo

squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Hi, I try to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST The code will be used to continuously analyze sonar sensor data. I set this up to calculate all coordinates in a sonar cone without heavy use of trigonometry (assuming that this way is f

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Mark Lawrence
On 06/12/2013 06:23, iMath wrote: Dearest iMath, wouldst thou be kind enough to partake of obtaining some type of email client that dost not sendeth double spaced data into this most illustrious of mailing lists/newsgroups. Thanking thee for thine participation in my most humble of requests.

Re: Embedding multiple interpreters

2013-12-06 Thread Chris Angelico
On Fri, Dec 6, 2013 at 7:21 PM, Garthy wrote: > PS. Apologies if any of these messages come through more than once. Most > lists that I've posted to set reply-to meaning a normal reply can be used, > but python-list does not seem to. The replies I have sent manually to > python-list@python.org ins

Re: squeeze out some performance

2013-12-06 Thread Jeremy Sanders
Robert Voigtländer wrote: > I try to squeeze out some performance of the code pasted on the link > below. http://pastebin.com/gMnqprST > > The code will be used to continuously analyze sonar sensor data. I set > this up to calculate all coordinates in a sonar cone without heavy use of > trigonome

ANN: eGenix PyRun - One file Python Runtime 1.3.1

2013-12-06 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 1.3.1 An easy-to-use single file relocatable Python run-time - available for Linux, Mac OS X and U

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Chris, On 06/12/13 19:03, Chris Angelico wrote: > On Fri, Dec 6, 2013 at 6:59 PM, Garthy > wrote: >> Hi Chris (and Michael), > > Hehe. People often say that to me IRL, addressing me and my brother. > But he isn't on python-list, so you clearly mean Michael Torrie, yet > my brain still autom

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Chris, On 06/12/13 19:57, Chris Angelico wrote: > On Fri, Dec 6, 2013 at 7:21 PM, Garthy > wrote: >> PS. Apologies if any of these messages come through more than once. Most >> lists that I've posted to set reply-to meaning a normal reply can be used, >> but python-list does not seem to.

Re: Embedding multiple interpreters

2013-12-06 Thread Tim Golden
On 06/12/2013 09:27, Chris Angelico wrote: > On Fri, Dec 6, 2013 at 7:21 PM, Garthy > wrote: >> PS. Apologies if any of these messages come through more than once. Most >> lists that I've posted to set reply-to meaning a normal reply can be used, >> but python-list does not seem to. The replies I

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Ned Batchelder
On 12/6/13 4:23 AM, Mark Lawrence wrote: On 06/12/2013 06:23, iMath wrote: Dearest iMath, wouldst thou be kind enough to partake of obtaining some type of email client that dost not sendeth double spaced data into this most illustrious of mailing lists/newsgroups. Thanking thee for thine partic

Re: Embedding multiple interpreters

2013-12-06 Thread Chris Angelico
On Fri, Dec 6, 2013 at 8:35 PM, Garthy wrote: > I think the ideal is completely sandboxed, but it's something that I > understand I may need to make compromises on. The bare minimum would be > protection against inadvertent interaction. Better yet would be a setup that > made such interaction anno

Re: squeeze out some performance

2013-12-06 Thread Chris Angelico
On Fri, Dec 6, 2013 at 8:46 PM, Jeremy Sanders wrote: > This sort of code is probably harder to make faster in pure python. You > could try profiling it to see where the hot spots are. Perhaps the choice of > arrays or sets might have some speed impact. I'd make this recommendation MUCH stronger.

[newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean Dubois
I'm trying out Tkinter with the (non object oriented) code fragment below: It works partially as I expected, but I thought that pressing "1" would cause the program to quit, however I get this message: TypeError: quit() takes no arguments (1 given), I tried changing quit to quit() but that makes th

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean-Michel Pichavant
- Original Message - > I'm trying out Tkinter with the (non object oriented) code fragment > below: > It works partially as I expected, but I thought that pressing "1" > would > cause the program to quit, however I get this message: > TypeError: quit() takes no arguments (1 given), I tried

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Daniel Watkins
Hi Jean, On Fri, Dec 06, 2013 at 04:24:59AM -0800, Jean Dubois wrote: > I'm trying out Tkinter with the (non object oriented) code fragment below: > It works partially as I expected, but I thought that pressing "1" would > cause the program to quit, however I get this message: > TypeError: quit()

Re: Managing Google Groups headaches

2013-12-06 Thread rusi
On Friday, December 6, 2013 1:06:30 PM UTC+5:30, Roy Smith wrote: > Rusi wrote: > > On Thursday, December 5, 2013 6:28:54 AM UTC+5:30, Roy Smith wrote: > > > The real problem with web forums is they conflate transport and > > > presentation into a single opaque blob, and are pretty much univer

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean Dubois
Op vrijdag 6 december 2013 13:30:53 UTC+1 schreef Daniel Watkins: > Hi Jean, > > > > On Fri, Dec 06, 2013 at 04:24:59AM -0800, Jean Dubois wrote: > > > I'm trying out Tkinter with the (non object oriented) code fragment below: > > > It works partially as I expected, but I thought that pressing

Re: Managing Google Groups headaches

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 12:03 AM, rusi wrote: > SQL databases (assuming thats the mediawiki backend) is another -- ok for > data-structuring bad for presentation. No, SQL databases don't store structured text. MediaWiki just stores a single blob (not in the database sense of that word) of text. C

Re: Managing Google Groups headaches

2013-12-06 Thread rusi
On Friday, December 6, 2013 6:49:04 PM UTC+5:30, Chris Angelico wrote: > On Sat, Dec 7, 2013 at 12:03 AM, rusi wrote: > > SQL databases (assuming thats the mediawiki backend) is another -- ok for > > data-structuring bad for presentation. > No, SQL databases don't store structured text. MediaWiki

Re: Managing Google Groups headaches

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 12:32 AM, rusi wrote: > I guess we are using 'structured' in different ways. All I am saying > is that mediawiki which seems to present as html, actually stores its > stuff as SQL -- nothing more or less structured than the schemas here: > http://www.mediawiki.org/wiki/Manu

Re: Sharing Python installation between architectures

2013-12-06 Thread Albert van der Horst
In article , Paul Smith wrote: >One thing I always liked about Perl was the way you can create a single >installation directory which can be shared between archictures. Say >what you will about the language: the Porters have an enormous amount of >experience and expertise producing portable and

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Chris, On 06/12/13 22:27, Chris Angelico wrote: > On Fri, Dec 6, 2013 at 8:35 PM, Garthy > wrote: >> I think the ideal is completely sandboxed, but it's something that I >> understand I may need to make compromises on. The bare minimum would be >> protection against inadvertent interaction.

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean-Michel Pichavant
> I tried out your suggestions and discovered that I had the line > import sys to the program. So you can see below what I came up with. > It works but it's not all clear to me. Can you tell me what > "label.bind("<1>", quit)" is standing for? What's the <1> meaning? > > > > #!/usr/bin/env pytho

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Tim, On 06/12/13 20:47, Tim Golden wrote: On 06/12/2013 09:27, Chris Angelico wrote: On Fri, Dec 6, 2013 at 7:21 PM, Garthy wrote: PS. Apologies if any of these messages come through more than once. Most lists that I've posted to set reply-to meaning a normal reply can be used, but pytho

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-06 Thread Neil Cerutti
On 2013-12-04, Piotr Dobrogost wrote: > On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti > wrote: >> not something to do commonly. Your proposed syntax leaves the >> distinction between valid and invalid identifiers a problem >> the programmer has to deal with. It doesn't unify acces

Re: Managing Google Groups headaches

2013-12-06 Thread rusi
On Friday, December 6, 2013 7:18:19 PM UTC+5:30, Chris Angelico wrote: > On Sat, Dec 7, 2013 at 12:32 AM, rusi wrote: > > I guess we are using 'structured' in different ways. All I am saying > > is that mediawiki which seems to present as html, actually stores its > > stuff as SQL -- nothing more

Re: Managing Google Groups headaches

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 1:11 AM, rusi wrote: > Aha! There you are! Its 'page editor' here and not the html which > 'display source' (control-u) which a browser would show. And wikimedia > is the software that mediates. > > The usual direction (seen by users of wikipedia) is that wikimedia > takes t

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread iMath
在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道: > On 06/12/2013 06:23, iMath wrote: > > > > Dearest iMath, wouldst thou be kind enough to partake of obtaining some > > type of email client that dost not sendeth double spaced data into this > > most illustrious of mailing lists/newsgroups. T

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread iMath
在 2013年12月4日星期三UTC+8下午6时51分49秒,Chris Angelico写道: > On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger > wrote: > > > "fp" is a file object, but subprocess expects a list of strings as > > > its first argument. > > > > More fundamentally: The subprocess's arguments must include the *name* >

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 1:54 AM, iMath wrote: > fp=tempfile.NamedTemporaryFile(delete=False) > fp.write(("file '"+fileName1+"'\n").encode('utf-8')) > fp.write(("file '"+fileName2+"'\n").encode('utf-8')) > > > subprocess.call(['ffmpeg', '-f', 'concat','-i',fp.name, '-c', 'copy', >

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Mark Lawrence
On 06/12/2013 14:52, iMath wrote: 在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道: On 06/12/2013 06:23, iMath wrote: Dearest iMath, wouldst thou be kind enough to partake of obtaining some type of email client that dost not sendeth double spaced data into this most illustrious of mailing lis

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread rusi
On Friday, December 6, 2013 8:22:48 PM UTC+5:30, iMath wrote: > 在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道: > > On 06/12/2013 06:23, iMath wrote: > > Dearest iMath, wouldst thou be kind enough to partake of obtaining some > > type of email client that dost not sendeth double spaced data into t

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread rusi
On Friday, December 6, 2013 8:42:02 PM UTC+5:30, Mark Lawrence wrote: > The English I used was archaic, please ignore it :) "Archaic" is almost archaic "Old" is ever-young :D -- https://mail.python.org/mailman/listinfo/python-list

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Steven D'Aprano
On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote: > yes ,I am a native Chinese speaker.I always post question by Google > Group not through email ,is there something wrong with it ? your > english is a little strange to me . Mark is writing in fake old-English style, the way people think English

Re: Packaging a proprietary Python library for multiple OSs

2013-12-06 Thread Kevin Walzer
On 12/5/13, 10:50 AM, Michael Herrmann wrote: On Thursday, December 5, 2013 4:26:40 PM UTC+1, Kevin Walzer wrote: On 12/5/13, 5:14 AM, Michael Herrmann wrote: If your library and their dependencies are simply .pyc files, then I don't see why a zip collated via py2exe wouldn't work on other platf

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Mark Lawrence
On 06/12/2013 15:34, Steven D'Aprano wrote: (if I remember correctly) I think Mark also sometimes posts a link to managing Google Groups. You do, and here it is https://wiki.python.org/moin/GoogleGroupsPython -- My fellow Pythonistas, ask not what our language can do for you, ask what you ca

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread rusi
On Friday, December 6, 2013 9:23:47 PM UTC+5:30, Mark Lawrence wrote: > On 06/12/2013 15:34, Steven D'Aprano wrote: > > (if I remember correctly) I think Mark also > > > sometimes posts a link to managing Google Groups. > > > > > You do, and here it is https://wiki.python.org/moin/GoogleGroupsP

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Mark Lawrence
On 06/12/2013 16:19, rusi wrote: On Friday, December 6, 2013 9:23:47 PM UTC+5:30, Mark Lawrence wrote: On 06/12/2013 15:34, Steven D'Aprano wrote: (if I remember correctly) I think Mark also sometimes posts a link to managing Google Groups. You do, and here it is https://wiki.python.org

Re: squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Thanks for your replies. I already did some basic profiling and optimized a lot. Especially with help of a goof python performance tips list I found. I think I'll follow the cython path. The geometry approach also sound good. But it's way above my math/geometry knowledge. Thanks for your input

Re: squeeze out some performance

2013-12-06 Thread Mark Lawrence
On 06/12/2013 16:29, Robert Voigtländer wrote: Thanks for your replies. I already did some basic profiling and optimized a lot. Especially > with help of a goof python performance tips list I found. Wonderful typo -^ :) I think I'll follow the cython path. The geometry approach also s

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread MRAB
On 06/12/2013 15:34, Steven D'Aprano wrote: On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote: yes ,I am a native Chinese speaker.I always post question by Google Group not through email ,is there something wrong with it ? your english is a little strange to me . Mark is writing in fake old-En

Re: squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Am Freitag, 6. Dezember 2013 17:36:03 UTC+1 schrieb Mark Lawrence: > > I already did some basic profiling and optimized a lot. Especially > with > > help of a goof python performance tips list I found. > > Wonderful typo -^ :) > Oh well :-) ... it was a good one. Just had a quick look at

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread rusi
On Friday, December 6, 2013 9:55:54 PM UTC+5:30, Mark Lawrence wrote: > On 06/12/2013 16:19, rusi wrote: > > So someone please update that page! > This is a community so why don't you? Ok done (at least a first draft) I was under the impression that anyone could not edit -- https://mail.python.

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-06 Thread Piotr Dobrogost
On Friday, December 6, 2013 3:07:51 PM UTC+1, Neil Cerutti wrote: > On 2013-12-04, Piotr Dobrogost > > wrote: > > > On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti > > wrote: > > >> not something to do commonly. Your proposed syntax leaves the > >> distinction between valid and i

Re: squeeze out some performance

2013-12-06 Thread John Ladasky
On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: > I try to squeeze out some performance of the code pasted on the link below. > http://pastebin.com/gMnqprST Several comments: 1) I find this program to be very difficult to read, largely because there's a whole LOT of du

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread rusi
On Friday, December 6, 2013 10:11:04 PM UTC+5:30, MRAB wrote: > On 06/12/2013 15:34, Steven D'Aprano wrote: > > On Fri, 06 Dec 2013 06:52:48 -0800, iMath wrote: > >> yes ,I am a native Chinese speaker.I always post question by Google > >> Group not through email ,is there something wrong with it ?

interactive help on the base object

2013-12-06 Thread Mark Lawrence
Is it just me, or is this basically useless? >>> help(object) Help on class object in module builtins: class object | The most base type >>> Surely a few more words, or a pointer to this http://docs.python.org/3/library/functions.html#object, would be better? -- My fellow Pythonistas, ask

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Christian Gollwitzer
Am 06.12.13 14:12, schrieb Jean Dubois: It works but it's not all clear to me. Can you tell me what "label.bind("<1>", quit)" is standing for? What's the <1> meaning? "bind" connects events sent to the label with a handler. The <1> is the event description; in this case, it means a click with

Does Python optimize low-power functions?

2013-12-06 Thread John Ladasky
The following two functions return the same result: x**2 x*x But they may be computed in different ways. The first choice can accommodate non-integer powers and so it would logically proceed by taking a logarithm, multiplying by the power (in this case, 2), and then taking the anti-log

Re: Does Python optimize low-power functions?

2013-12-06 Thread Jean-Michel Pichavant
- Original Message - > The following two functions return the same result: > > x**2 > x*x > > But they may be computed in different ways. The first choice can > accommodate non-integer powers and so it would logically proceed by > taking a logarithm, multiplying by the power (in

Re: Does Python optimize low-power functions?

2013-12-06 Thread Neil Cerutti
On 2013-12-06, John Ladasky wrote: > The following two functions return the same result: > > x**2 > x*x > > But they may be computed in different ways. The first choice > can accommodate non-integer powers and so it would logically > proceed by taking a logarithm, multiplying by the power

ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread Steven D'Aprano
On Fri, 06 Dec 2013 05:03:57 -0800, rusi wrote: > Evidently (and completely inadvertently) this exchange has just > illustrated one of the inadmissable assumptions: > > "unicode as a medium is universal in the same way that ASCII used to be" Ironically, your post was not Unicode. Seriously. I a

Re: Does Python optimize low-power functions?

2013-12-06 Thread Robert Kern
On 2013-12-06 19:01, Neil Cerutti wrote: On 2013-12-06, John Ladasky wrote: The following two functions return the same result: x**2 x*x But they may be computed in different ways. The first choice can accommodate non-integer powers and so it would logically proceed by taking a log

RE: Does Python optimize low-power functions?

2013-12-06 Thread Nick Cash
>My question is, what do Python interpreters do with power operators where the >power is a small constant, like 2? Do they know to take the shortcut? Nope: Python 3.3.0 (default, Sep 25 2013, 19:28:08) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

Re: ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread Gene Heskett
On Friday 06 December 2013 14:30:06 Steven D'Aprano did opine: > On Fri, 06 Dec 2013 05:03:57 -0800, rusi wrote: > > Evidently (and completely inadvertently) this exchange has just > > illustrated one of the inadmissable assumptions: > > > > "unicode as a medium is universal in the same way that

Re: Does Python optimize low-power functions?

2013-12-06 Thread John Ladasky
On Friday, December 6, 2013 11:32:00 AM UTC-8, Nick Cash wrote: > The reasons why have already been answered, I just wanted to point out that > Python makes it extremely easy to check these sorts of things for yourself. Thanks for the heads-up on the dis module, Nick. I haven't played with that

Re: Does Python optimize low-power functions?

2013-12-06 Thread Oscar Benjamin
On 6 December 2013 18:16, John Ladasky wrote: > The following two functions return the same result: > > x**2 > x*x > > But they may be computed in different ways. The first choice can accommodate > non-integer powers and so it would logically proceed by taking a logarithm, > multiplying

Re: ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread Roy Smith
Steven D'Aprano pearwood.info> writes: > Yes, it appears that MT-NewsWatcher is *deeply, deeply* confused about > encodings and character sets. It doesn't just assume things are ASCII, > but makes a half-hearted attempt to be charset-aware, but badly. I can > only imagine that it was written b

Python 2.8 release schedule

2013-12-06 Thread Mark Lawrence
My apologies if you've seen this before but here is the official schedule http://www.python.org/dev/peps/pep-0404/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedding multiple interpreters

2013-12-06 Thread Gregory Ewing
Garthy wrote: To allow each script to run in its own environment, with minimal chance of inadvertent interaction between the environments, whilst allowing each script the ability to stall on conditions that will be later met by another thread supplying the information, and to fit in with existi

Re: squeeze out some performance

2013-12-06 Thread Joel Goldstick
On Fri, Dec 6, 2013 at 11:52 AM, John Ladasky wrote: > On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: > > > I try to squeeze out some performance of the code pasted on the link > below. > > http://pastebin.com/gMnqprST > Not that this will speed up your code but you have

Re: Embedding multiple interpreters

2013-12-06 Thread Gregory Ewing
Garthy wrote: The bare minimum would be protection against inadvertent interaction. Better yet would be a setup that made such interaction annoyingly difficult, and the ideal would be where it was impossible to interfere. To give you an idea of the kind of interference that's possible, consi

Re: squeeze out some performance

2013-12-06 Thread Mark Lawrence
On 06/12/2013 16:52, John Ladasky wrote: On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: I try to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST Several comments: 1) I find this program to be very difficult to read, la

Re: squeeze out some performance

2013-12-06 Thread Dan Stromberg
On Fri, Dec 6, 2013 at 2:38 PM, Mark Lawrence wrote: > On 06/12/2013 16:52, John Ladasky wrote: > >> On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: >> >> I try to squeeze out some performance of the code pasted on the link >>> below. >>> http://pastebin.com/gMnqprST >>>

Eliminate "extra" variable

2013-12-06 Thread Igor Korot
Hi, ALL, I have following code: def MyFunc(self, originalData): data = {} dateStrs = [] for i in xrange(0, len(originalData)): dateStr, freq, source = originalData[i] data[str(dateStr)] = {source: freq} dateStrs.append(dateStr) for i in xrange(0

Re: Managing Google Groups headaches

2013-12-06 Thread Gregory Ewing
rusi wrote: On Friday, December 6, 2013 1:06:30 PM UTC+5:30, Roy Smith wrote: Which means, if I wanted to (and many examples of this exist), I can write my own client which presents the same information in different ways. Not sure whats your point. The point is the existence of an alternat

Re: Eliminate "extra" variable

2013-12-06 Thread Gary Herron
On 12/06/2013 11:37 AM, Igor Korot wrote: Hi, ALL, I have following code: def MyFunc(self, originalData): data = {} dateStrs = [] for i in xrange(0, len(originalData)): dateStr, freq, source = originalData[i] data[str(dateStr)] = {source: freq}

Re: Eliminate "extra" variable

2013-12-06 Thread Joel Goldstick
On Fri, Dec 6, 2013 at 2:37 PM, Igor Korot wrote: > Hi, ALL, > I have following code: > > def MyFunc(self, originalData): > data = {} > dateStrs = [] > for i in xrange(0, len(originalData)): >dateStr, freq, source = originalData[i] >data[str(dateStr)] = {so

Re: ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 6:00 AM, Steven D'Aprano wrote: > - character 33 was permitted to be either the exclamation > mark ! or the logical OR symbol | > > - consequently character 124 (vertical bar) was always > displayed as a broken bar ¦, which explains why even today >

One liners

2013-12-06 Thread Dan Stromberg
Does anyone else feel like Python is being dragged too far in the direction of long, complex, multiline one-liners? Or avoiding temporary variables with descriptive names? Or using regex's for everything under the sun? What happened to using classes? What happened to the beautiful emphasis on r

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread Gregory Ewing
rusi wrote: On Friday, December 6, 2013 10:11:04 PM UTC+5:30, MRAB wrote: You're exaggerating. It's more like 500 years ago. :-) I was going to say the same until I noticed the "the way people think English was spoken..." That makes it unarguable -- surely there are some people who (wrongly)

Re: One liners

2013-12-06 Thread Ned Batchelder
On 12/6/13 6:54 PM, Dan Stromberg wrote: Does anyone else feel like Python is being dragged too far in the direction of long, complex, multiline one-liners? Or avoiding temporary variables with descriptive names? Or using regex's for everything under the sun? What happened to using classes?

Re: One liners

2013-12-06 Thread Michael Torrie
On 12/06/2013 04:54 PM, Dan Stromberg wrote: > Does anyone else feel like Python is being dragged too far in the direction > of long, complex, multiline one-liners? Or avoiding temporary variables > with descriptive names? Or using regex's for everything under the sun? > > What happened to using

Re: One liners

2013-12-06 Thread Dan Stromberg
On Fri, Dec 6, 2013 at 4:10 PM, Michael Torrie wrote: > On 12/06/2013 04:54 PM, Dan Stromberg wrote: > > Does anyone else feel like Python is being dragged too far in the > direction > > of long, complex, multiline one-liners? Or avoiding temporary variables > > with descriptive names? Or using

Re: Eliminate "extra" variable

2013-12-06 Thread Roy Smith
In article , Joel Goldstick wrote: > Python lets you iterate over a list directly, so : > > for d in originalData: > dateStr, freq, source = d > data[source] = freq I would make it even simpler: > for dateStr, freq, source in originalData: > data[source] = freq

Re: One liners

2013-12-06 Thread Michael Torrie
On 12/06/2013 05:14 PM, Dan Stromberg wrote: > I'm thinking mostly of stackoverflow, but here's an example I ran into (a > lot of) on a job: > > somevar = some_complicated_thing(somevar) if > some_other_complicated_thing(somevar) else somevar > > Would it really be so bad to just use an if statem

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Gregory, On 07/12/13 08:53, Gregory Ewing wrote: > Garthy wrote: >> The bare minimum would be protection against inadvertent interaction. >> Better yet would be a setup that made such interaction annoyingly >> difficult, and the ideal would be where it was impossible to interfere. > > To give

Re: Eliminate "extra" variable

2013-12-06 Thread Joel Goldstick
On Fri, Dec 6, 2013 at 7:16 PM, Roy Smith wrote: > In article , > Joel Goldstick wrote: > > > Python lets you iterate over a list directly, so : > > > > for d in originalData: > > dateStr, freq, source = d > > data[source] = freq > > I would make it even simpler: > > > f

Re: Eliminate "extra" variable

2013-12-06 Thread Tim Chase
On 2013-12-06 11:37, Igor Korot wrote: > def MyFunc(self, originalData): > data = {} > for i in xrange(0, len(originalData)): >dateStr, freq, source = originalData[i] >data[str(dateStr)] = {source: freq} this can be more cleanly/pythonically written as def my_

Re: One liners

2013-12-06 Thread Joel Goldstick
On Fri, Dec 6, 2013 at 7:20 PM, Michael Torrie wrote: > On 12/06/2013 05:14 PM, Dan Stromberg wrote: > > I'm thinking mostly of stackoverflow, but here's an example I ran into (a > > lot of) on a job: > > > > somevar = some_complicated_thing(somevar) if > > some_other_complicated_thing(somevar) e

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-06 Thread Rotwang
On 06/12/2013 16:51, Piotr Dobrogost wrote: [...] I thought of that argument later the next day. Your proposal does unify access if the old obj.x syntax is removed. As long as obj.x is a very concise way to get attribute named 'x' from object obj it's somehow odd that identifier x is treated n

Re: Eliminate "extra" variable

2013-12-06 Thread Ethan Furman
On 12/06/2013 03:38 PM, Joel Goldstick wrote: On Fri, Dec 6, 2013 at 2:37 PM, Igor Korot wrote: def MyFunc(self, originalData): data = {} dateStrs = [] for i in xrange(0, len(originalData)): dateStr, freq, source = originalData[i]

Re: Embedding multiple interpreters

2013-12-06 Thread Garthy
Hi Gregory, On 07/12/13 08:39, Gregory Ewing wrote: > Garthy wrote: >> To allow each script to run in its own environment, with minimal >> chance of inadvertent interaction between the environments, whilst >> allowing each script the ability to stall on conditions that will be >> later met by an

Re: One liners

2013-12-06 Thread Roy Smith
In article , Joel Goldstick wrote: > Aside from django urls, I am not sure I ever wrote regexes in python. For > some reason they must seem awfully sexy to quite a few people. Back to my > point above -- ever try to figure out a complicated regex written by > someone else? Regex has a bad rap

Re: interactive help on the base object

2013-12-06 Thread Terry Reedy
On 12/6/2013 12:03 PM, Mark Lawrence wrote: Is it just me, or is this basically useless? >>> help(object) Help on class object in module builtins: class object | The most base type Given that this can be interpreted as 'least desirable', it could definitely be improved. Surely a few m

Re: Python 2.8 release schedule

2013-12-06 Thread Terry Reedy
On 12/6/2013 4:26 PM, Mark Lawrence wrote: My apologies if you've seen this before but here is the official schedule http://www.python.org/dev/peps/pep-0404/ The PEP number is not an accident ;-). -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.8 release schedule

2013-12-06 Thread Mark Lawrence
On 07/12/2013 01:39, Terry Reedy wrote: On 12/6/2013 4:26 PM, Mark Lawrence wrote: My apologies if you've seen this before but here is the official schedule http://www.python.org/dev/peps/pep-0404/ The PEP number is not an accident ;-). Sorry but I don't get it :) -- My fellow Pythonistas,

Re: Python 2.8 release schedule

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 12:48 PM, Mark Lawrence wrote: > On 07/12/2013 01:39, Terry Reedy wrote: >> >> On 12/6/2013 4:26 PM, Mark Lawrence wrote: >>> >>> My apologies if you've seen this before but here is the official >>> schedule http://www.python.org/dev/peps/pep-0404/ >> >> >> The PEP number is

Re: Python 2.8 release schedule

2013-12-06 Thread Mark Lawrence
On 07/12/2013 01:54, Chris Angelico wrote: On Sat, Dec 7, 2013 at 12:48 PM, Mark Lawrence wrote: On 07/12/2013 01:39, Terry Reedy wrote: On 12/6/2013 4:26 PM, Mark Lawrence wrote: My apologies if you've seen this before but here is the official schedule http://www.python.org/dev/peps/pep-04

Re: Python 2.8 release schedule

2013-12-06 Thread Chris Angelico
On Sat, Dec 7, 2013 at 1:00 PM, Mark Lawrence wrote: > On 07/12/2013 01:54, Chris Angelico wrote: >> >> On Sat, Dec 7, 2013 at 12:48 PM, Mark Lawrence >> wrote: >>> Sorry but I don't get it :) >> >> [explained the joke] > > Clearly that went straight over your head. *facepalm* Yep, it did. Compl

Re: One liners

2013-12-06 Thread Steven D'Aprano
On Fri, 06 Dec 2013 15:54:22 -0800, Dan Stromberg wrote: > Does anyone else feel like Python is being dragged too far in the > direction of long, complex, multiline one-liners? Or avoiding temporary > variables with descriptive names? Or using regex's for everything under > the sun? All those t

Re: Managing Google Groups headaches

2013-12-06 Thread Ned Batchelder
On 12/6/13 8:03 AM, rusi wrote: I think you're off on the wrong track here. This has nothing to do with >plain text (ascii or otherwise). It has to do with divorcing how you >store and transport messages (be they plain text, HTML, or whatever) >from how a user interacts with them. Evidently (

Re: One liners

2013-12-06 Thread Steven D'Aprano
On Fri, 06 Dec 2013 17:20:27 -0700, Michael Torrie wrote: > On 12/06/2013 05:14 PM, Dan Stromberg wrote: >> I'm thinking mostly of stackoverflow, but here's an example I ran into >> (a lot of) on a job: >> >> somevar = some_complicated_thing(somevar) if >> some_other_complicated_thing(somevar) el

Re: ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread rusi
On Saturday, December 7, 2013 12:30:18 AM UTC+5:30, Steven D'Aprano wrote: > On Fri, 06 Dec 2013 05:03:57 -0800, rusi wrote: > > Evidently (and completely inadvertently) this exchange has just > > illustrated one of the inadmissable assumptions: > > "unicode as a medium is universal in the same wa

  1   2   >