Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread idrevetnom
Maybe this could be of interest : http://tnt.math.metro-u.ac.jp/nzmath/manual/modules/combinatorial.html hope this helps Id -- http://mail.python.org/mailman/listinfo/python-list

How to Embed PHP in HTML print

2010-01-24 Thread NickC
I am running a Python application under apache web server, executing as a cgi script. Most of the output is print statements that write HTML. I'd like to embed some PHP code within the HTML. The PHP is a gallery plugin script that talks to the core photo gallery application, written in php.

Re: distutils not finding all of my pure python modules

2010-01-24 Thread Gabriel Genellina
En Thu, 21 Jan 2010 12:41:20 -0300, Jeremy jlcon...@gmail.com escribió: from distutils.core import setup purePythonModules = ['regex', 'gnuFile'] setup(name='PythonForSafeguards', version='0.9.1', description = 'Python code for MCNP and Safeguards analysis.', author = 'Jake the

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steve Howell
On Jan 23, 8:00 pm, Raymond Hettinger pyt...@rcn.com wrote: [Steve Howell] Why wouldn't you get a competent C programmer simply make list_ass_slice smart enough to make list.pop(0) O(1)? When this suggestion was discussed on python-dev years ago, it was rejected.  One reason is that it

Re: How to Embed PHP in HTML print

2010-01-24 Thread Duncan Booth
NickC reply...@works.fine.invalid wrote: Some possible ideas: Is there a way I can get python to call functions within a PHP app? Perhaps write the plugin in a separate script in PHP, and include that page within my output so that apache recognises the page inclusion? How to get apache to

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steven D'Aprano
On Sun, 24 Jan 2010 02:33:36 -0800, Steve Howell wrote: You are also a brilliant computer scientist, despite the fact that you are defending a list implemenation that can't pop the first element off the list in O(1) time. You say that like it's a bad thing. It's very simple: the trade-offs

Re: py2exe deal with python command line inside a program

2010-01-24 Thread Jonathan Hartley
On Jan 22, 7:35 pm, susan_kij...@yahoo.ca wrote: Hi, I need to create a python subprogress, like this: myProcess = subprocess.Popen([sys.executable, 'C:\myscript.py'],                                        env=env, stdin=subprocess.PIPE,                                        

Re: py2exe deal with python command line inside a program

2010-01-24 Thread Chris Rebert
On Sun, Jan 24, 2010 at 3:28 AM, Jonathan Hartley tart...@tartley.com wrote: On Jan 22, 7:35 pm, susan_kij...@yahoo.ca wrote: Hi, I need to create a python subprogress, like this: myProcess = subprocess.Popen([sys.executable, 'C:\myscript.py'],                                        env=env,

Re: ISC License

2010-01-24 Thread Joan Miller
On 23 ene, 18:45, a...@pythoncraft.com (Aahz) wrote: In article 00eb248d-c9c9-430f-bc83-41ac865c5...@e11g2000yqe.googlegroups.com, Joan Miller  pelok...@gmail.com wrote: There is a license approved by the OSI, the ISC License [1], which should be included in the PyPi classifiers [2].

Re: iterating lists

2010-01-24 Thread Stefan Behnel
Steven D'Aprano, 23.01.2010 18:44: On Sat, 23 Jan 2010 18:29:33 +0100, Roel Schroeven wrote: for w in l1[:]: #use copy of l1 for iteration print(l1.pop()) #decomposite list I would prefer: while l1: print(l1.pop()) I would prefer: for x in reversed(l1): print(x)

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread Dave Angel
kj wrote: Before I go off to re-invent a thoroughly invented wheel, I thought I'd ask around for some existing module for computing binomial coefficient, hypergeometric coefficients, and other factorial-based combinatorial indices. I'm looking for something that can handle fairly large

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread Alf P. Steinbach
* Dave Angel: kj wrote: Before I go off to re-invent a thoroughly invented wheel, I thought I'd ask around for some existing module for computing binomial coefficient, hypergeometric coefficients, and other factorial-based combinatorial indices. I'm looking for something that can handle fairly

Re: How to Embed PHP in HTML print

2010-01-24 Thread NickC
On Sun, 24 Jan 2010 10:37:51 +, Duncan Booth wrote: content with ajax. Alternatively, use urllib in Python to retrieve a page from the Apache server and insert that into its own output: that Thanks for hint on urllib. I shake my head in amazement with python sometimes. I'll write it

ctypes for AIX

2010-01-24 Thread Waddle, Jim
I need to use ctypes with python running on AIX. It appears that python is being developed mostly for windows. Is there a policy concerning getting functions like ctypes working on AIX. Jim Waddle KIT-D 425-785-5194 -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes for AIX

2010-01-24 Thread Chris Rebert
On Sun, Jan 24, 2010 at 5:54 AM, Waddle, Jim jim.wad...@boeing.com wrote: I need to use ctypes with python running on AIX. According to the ctypes readme, ctypes is based on libffi, which according to its website, supports AIX for PowerPC64. So, perhaps you could state what the actual error or

Default path for files

2010-01-24 Thread Rotwang
Hi all, can anybody tell me whether there's a way to change the default location for files to be opened by open()? I'd like to be able to create files somewhere other than my Python folder without having to write the full path in the filename every time. Sorry if this is a stupid question, I

Re: Default path for files

2010-01-24 Thread Krister Svanlund
On Sun, Jan 24, 2010 at 4:08 PM, Rotwang sg...@hotmail.co.uk wrote: Hi all, can anybody tell me whether there's a way to change the default location for files to be opened by open()? I'd like to be able to create files somewhere other than my Python folder without having to write the full path

how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method was dict_keys. so i'm now curious as to the attributes of the dict_keys

some turtle questions

2010-01-24 Thread Brian Blais
Hello, I am trying to think of things to do with the turtle module with my students, and I have some ideas where I am not sure whether the turtle module can do it. 1) is there a way to determine the current screen pixel color? I am thinking about having the turtle go forward until it

Re: Consume an iterable

2010-01-24 Thread Jan Kaliszewski
Dnia 23-01-2010 o 15:19:56 Peter Otten __pete...@web.de napisał(a): def consume_islice(n, items): next(islice(items, n, n), None) One problem: the above function doesn't consume the entire iterator like the original example does for n=None. Passing sys.maxint instead is not pretty.

Re: Default path for files

2010-01-24 Thread Rotwang
Krister Svanlund wrote: On Sun, Jan 24, 2010 at 4:08 PM, Rotwang sg...@hotmail.co.uk wrote: Hi all, can anybody tell me whether there's a way to change the default location for files to be opened by open()? I'd like to be able to create files somewhere other than my Python folder without having

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
* Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method was dict_keys. so i'm now curious as to the

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 16:28:26 Robert P. J. Day rpj...@crashcourse.ca wrote once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? dir(type(an_obj)) or more reliable: list(vars(type(an_obj))) (dir() uses __dir__

Re: Default path for files

2010-01-24 Thread Christian Heimes
Rotwang wrote: import os os.chdir(path) to site.py (or any other module which is automatically imported during initialisation) change the default location to path every time I used Python? First of all you shouldn't alter the site module ever! The optional sitecustomize module exists to

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Robert P. J. Day
On Sun, 24 Jan 2010, Alf P. Steinbach wrote: * Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the keys() method

Re: Consume an iterable

2010-01-24 Thread Peter Otten
Jan Kaliszewski wrote: Dnia 23-01-2010 o 15:19:56 Peter Otten __pete...@web.de napisał(a): def consume_islice(n, items): next(islice(items, n, n), None) One problem: the above function doesn't consume the entire iterator like the original example does for n=None. Passing sys.maxint

PS.

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 16:56:42 Jan Kaliszewski z...@chopin.edu.pl wrote: 24-01-2010, 16:28:26 Robert P. J. Day rpj...@crashcourse.ca wrote once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? dir(type(an_obj)) or

Re: Default path for files

2010-01-24 Thread Rotwang
Christian Heimes wrote: Rotwang wrote: import os os.chdir(path) to site.py (or any other module which is automatically imported during initialisation) change the default location to path every time I used Python? First of all you shouldn't alter the site module ever! The optional

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
* Robert P. J. Day: On Sun, 24 Jan 2010, Alf P. Steinbach wrote: * Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned by the

Re: Consume an iterable

2010-01-24 Thread Jan Kaliszewski
Don't the results look suspicious to you? Try measuring with iterator = iter([]) You are obviously right, my brain doesn't work well today :-( But the corret results even more distinctly support my thesis -- that for n=None using n=sys.maxint (consume3) is noticeably faster than 0-maxlen

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 17:37:41 Alf P. Steinbach al...@start.no wrote: DictKeys = type( {}.keys() ) dir( DictKeys ) list( vars( DictKeys ) ) help( DictKeys ) It doesn't help much though because the only method of interrest is __iter__ Not only. Please, consider: dictkeys =

Re: Symbols as parameters?

2010-01-24 Thread Gabriel Genellina
En Fri, 22 Jan 2010 10:16:50 -0300, Alf P. Steinbach al...@start.no escribió: I get the impression that there's some message traffic that I don't see, perhaps on the mailing list, since (a) I haven't seen that about 'locals' pointed out by anyone else in this thread, and I think I've

Splitting text at whitespace but keeping the whitespace in the returned list

2010-01-24 Thread python
I need to parse some ASCII text into 'word' sized chunks of text AND collect the whitespace that seperates the split items. By 'word' I mean any string of characters seperated by whitespace (newlines, carriage returns, tabs, spaces, soft-spaces, etc). This means that my split text can contain

Re: Splitting text at whitespace but keeping the whitespace in the returned list

2010-01-24 Thread MRAB
pyt...@bdurham.com wrote: I need to parse some ASCII text into 'word' sized chunks of text AND collect the whitespace that seperates the split items. By 'word' I mean any string of characters seperated by whitespace (newlines, carriage returns, tabs, spaces, soft-spaces, etc). This means that

Re: Symbols as parameters?

2010-01-24 Thread Alf P. Steinbach
* Gabriel Genellina: En Fri, 22 Jan 2010 10:16:50 -0300, Alf P. Steinbach al...@start.no escribió: I get the impression that there's some message traffic that I don't see, perhaps on the mailing list, since (a) I haven't seen that about 'locals' pointed out by anyone else in this thread, and

Re: Consume an iterable

2010-01-24 Thread Peter Otten
Jan Kaliszewski wrote: But the corret results even more distinctly support my thesis -- that for n=None using n=sys.maxint (consume3) is noticeably faster than 0-maxlen deque (consume1 and consume2): That advantage may not survive the next release:

Re: [Edu-sig] some turtle questions

2010-01-24 Thread Helene Martin
I'm almost sure that there's no way for a turtle to know anything about the background. That's an unfortunate limitation! As for putting a limit on a turtle's travel, you need to write an appropriate conditional. For example, if you want your turtle to stay within a 200x200 square centered

Re: Splitting text at whitespace but keeping the whitespace in the returned list

2010-01-24 Thread python
MRAB, MRAB pyt...@mrabarnett.plus.com wrote: import re re.split(r'(\s+)', Hello world!) ['Hello', ' ', 'world!'] That was exactly (EXACTLY!) the solution I was looking for. Thank you! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Consume an iterable

2010-01-24 Thread Jan Kaliszewski
24-01-2010, 18:24:49 Peter Otten __pete...@web.de wrote: n=None using n=sys.maxint (consume3) is noticeably faster than 0-maxlen deque (consume1 and consume2): That advantage may not survive the next release:

Re: Symbols as parameters?

2010-01-24 Thread George Sakkis
On Jan 22, 8:39 pm, Martin Drautzburg martin.drautzb...@web.de wrote: Martin Drautzburg wrote: with scope():     # ...     # use up, down, left, right here # up, down, left, right no longer defined after the with block exits. Just looked it up again. It's a cool thing. Too bad my

Re: simple cgi program

2010-01-24 Thread Aahz
In article 4b531bf9$0$1140$4fafb...@reader1.news.tin.it, superpollo ute...@esempio.net wrote: i would like to submit the following code for review. it is a simple common gateway interface program, which uses the least possible libraries for the sake of mechanism undertanding. You should

Re: py2exe deal with python command line inside a program

2010-01-24 Thread im_smialing
Hi Jonathan, Here is the traceback I got, 'test.py' is where main starts, and I replaced 'sys.executable' with string 'python': args: ['python', 'C:\\myscript.py'] Traceback (most recent call last): File test.py, line 22, in module File subprocess.pyc, line 594, in __init__ File

Re: Default path for files

2010-01-24 Thread Günther Dietrich
Rotwang sg...@hotmail.co.uk wrote: Check out http://docs.python.org/library/os.html and the function chdir it is what you are looking for. Thank you. So would adding import os os.chdir(path) to site.py (or any other module which is automatically imported during initialisation) change the

Re: py2exe deal with python command line inside a program

2010-01-24 Thread im_smialing
On Jan 24, 6:35 am, Chris Rebert c...@rebertia.com wrote: On Sun, Jan 24, 2010 at 3:28 AM, Jonathan Hartley tart...@tartley.com wrote: On Jan 22, 7:35 pm, susan_kij...@yahoo.ca wrote: Hi, I need to create a python subprogress, like this: myProcess = subprocess.Popen([sys.executable,

Re: py2exe deal with python command line inside a program

2010-01-24 Thread Chris Rebert
On Sun, Jan 24, 2010 at 10:25 AM, im_smialing susan_kij...@yahoo.ca wrote: On Jan 24, 6:35 am, Chris Rebert c...@rebertia.com wrote: On Sun, Jan 24, 2010 at 3:28 AM, Jonathan Hartley tart...@tartley.com wrote: On Jan 22, 7:35 pm, susan_kij...@yahoo.ca wrote: Hi, I need to create a

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steve Howell
On Jan 24, 3:20 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 24 Jan 2010 02:33:36 -0800, Steve Howell wrote: You are also a brilliant computer scientist, despite the fact that you are defending a list implemenation that can't pop the first element off the list in

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steve Howell
On Jan 23, 3:04 pm, Terry Reedy tjre...@udel.edu wrote: On 1/23/2010 12:17 PM, Steve Howell wrote: Terry Reedy said: ''' If you try writing a full patch, as I believe someone did, or at least a prototype thereof, when the idea was discussed, you might have a better idea of what

Terminal application with non-standard print

2010-01-24 Thread Rémi
Hello everyone, I would like to do a Python application that prints data to stdout, but not the common way. I do not want the lines to be printed after each other, but the old lines to be replaced with the new ones, like wget does it for example (when downloading a file you can see the

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Aahz
In article b4440231-f33f-49e1-9d6f-5fbce0a63...@b2g2000yqi.googlegroups.com, Steve Howell showel...@yahoo.com wrote: Even with realloc()'s brokenness, you could improve pop(0) in a way that does not impact list access at all, and the patch would not change the time complexity of any operation;

Re: Terminal application with non-standard print

2010-01-24 Thread Grant Edwards
On 2010-01-24, R?mi babedo...@yahoo.fr wrote: I would like to do a Python application that prints data to stdout, but not the common way. I do not want the lines to be printed after each other, but the old lines to be replaced with the new ones, like wget does it for example (when downloading

Re: Terminal application with non-standard print

2010-01-24 Thread Rémi
Thank you for your answer, but that does not work : the second line is printed after the first one. -- Rémi Grant Edwards wrote: On 2010-01-24, R?mi babedo...@yahoo.fr wrote: I would like to do a Python application that prints data to stdout, but not the common way. I do not want the lines

[ANN] Python 2.5.5 Release Candidate 2.

2010-01-24 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release candidate 2 of Python 2.5.5. This is a source-only release that only includes security fixes. The last full bug-fix release of Python 2.5 was Python 2.5.4. Users are encouraged to upgrade to the

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steve Howell
On Jan 24, 11:28 am, a...@pythoncraft.com (Aahz) wrote: In article b4440231-f33f-49e1-9d6f-5fbce0a63...@b2g2000yqi.googlegroups.com, Steve Howell  showel...@yahoo.com wrote: Even with realloc()'s brokenness, you could improve pop(0) in a way that does not impact list access at all, and the

Re: Terminal application with non-standard print

2010-01-24 Thread Grant Edwards
On 2010-01-24, R?mi babedo...@yahoo.fr wrote: Thank you for your answer, but that does not work: Works fine for me. the second line is printed after the first one. Not when I run it. There's not much more I can say given the level of detail you've provided. -- Grant --

Re: Consume an iterable

2010-01-24 Thread Raymond Hettinger
     def consume2(iterator, n):  # the approved proposal (see #7764)          if n is None:              collections.deque(iterator, maxlen=0)          else:              next(islice(iterator, n, n), None) FWIW, the deque() approach becomes even faster in Py2.7 and Py3.1 which has a

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Terry Reedy
On 1/24/2010 2:26 PM, Steve Howell wrote: I think it's a good idea to write a PEP on this issue, and I will attempt a first draft. I think I should submit the first draft to python-ideas, correct? That is not a *requirement* for drafts in general, but it is a good idea for a community or

Re: Symbols as parameters?

2010-01-24 Thread Alf P. Steinbach
Just top-posting for clarity. :-) code file=directions.py up = UP left= LEFT down= DOWN right = RIGHT /code code file=locals.py # This code is not guaranteed to work by the language specification. # But it is one way to do the solution I presented earlier in the thread. import

easy_install error ...

2010-01-24 Thread tekion
All, I am running into issue with easy install error, see error below: python setup.py easy_install -m 'docutils==0.4' running easy_install error: Not a URL, existing file, or requirement spec: 'docutils==0.4' any idea as to why? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Terminal application with non-standard print

2010-01-24 Thread Rémi
My apologies, I did not run the lines properly. Thanks, that works great now. If I understand well, \r erases the last line. How about erasing the previous lines? For example when writing sys.stdout.write(1\n2\n) sys.stdout.write(\r3) the 1 is still visible. -- Rémi On 24 jan, 20:53, Grant

Re: [Edu-sig] some turtle questions

2010-01-24 Thread Alf P. Steinbach
* Helene Martin: I'm almost sure that there's no way for a turtle to know anything about the background. That's an unfortunate limitation! The background for the turtle is just a Tkinter canvas. So yes, it's technically possible to inspect things there, since there is method to obtain the

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: Proposal: Improve list's implementation so that deleting elements from the front of the list does not require an O(N) memmove operation. ... It is possible now, of course, to use a data structure in Python that has O(1) for deleting off the top of the

Re: Consume an iterable

2010-01-24 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: This code consumes an iterator to exhaustion. It is short, sweet, and hard to beat. I've always used sum(1 for x in iterator) or some such. -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread Dave Angel
Alf P. Steinbach wrote: div class=moz-text-flowed style=font-family: -moz-fixed* Dave Angel: kj wrote: Before I go off to re-invent a thoroughly invented wheel, I thought I'd ask around for some existing module for computing binomial coefficient, hypergeometric coefficients, and other

Re: py2exe deal with python command line inside a program

2010-01-24 Thread im_smiling
Thanks for taking time to help me. If I use either way, requiring python being installed, or allow source codes exposure, it seems in some degree, there's not necessarily to make the executable package any more, which is very frustrating Suppose I take the first way, python environment must

start .pyo files with doubleclick on windows

2010-01-24 Thread News123
Hi, I'd like to start .pyo files under windows with a double click. (I know I can just write a .bat wrapper, but somehow it would be more fun to start with a direct double click) Currently this works if the file does not import any other .pyo file. The problem is, that a dobleclick performs

Re: start .pyo files with doubleclick on windows

2010-01-24 Thread Alf P. Steinbach
* News123: Hi, I'd like to start .pyo files under windows with a double click. (I know I can just write a .bat wrapper, but somehow it would be more fun to start with a direct double click) Currently this works if the file does not import any other .pyo file. The problem is, that a

Re: [2.5.1.1/dictionary] Change sorting order?

2010-01-24 Thread Gilles Ganault
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com wrote: To avoid users from creating login names that start with digits in order to be listed at the top, I'd like to sort the list differently every minute so that it'll start with the next letter, eg. display the list from

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread casevh
On Jan 23, 2:55 pm, kj no.em...@please.post wrote: Before I go off to re-invent a thoroughly invented wheel, I thought I'd ask around for some existing module for computing binomial coefficient, hypergeometric coefficients, and other factorial-based combinatorial indices.  I'm looking for

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Daniel Stutzbach
On Sun, Jan 24, 2010 at 1:53 PM, Steve Howell showel...@yahoo.com wrote: I don't think anybody provided an actual link, but please correct me if I overlooked it. I have to wonder if my messages are all ending up in your spam folder for some reason. :-) PEP 3128 (which solves your problem, but

Re: start .pyo files with doubleclick on windows

2010-01-24 Thread News123
Hi Alf, Alf P. Steinbach wrote: * News123: Hi, I'd like to start .pyo files under windows with a double click. C:\ assoc .pyo .pyo=Python.CompiledFile C:\ ftype python.compiledfile python.compiledfile=C:\Program Files\cpython\python31\python.exe %1 %* C:\ _ Use ftype to

Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread John Ladasky
Hello everyone, I've posted this same question over on ubuntuforums.org, so I'm trying to get help in all of the logical places. I'm running Ubuntu Linux 8.04 (Hardy) on a fairly new x86 box, with two hard disks in a software RAID 1 configuration. Hardy comes with Python 2.5 as a standard

Re: [2.5.1.1/dictionary] Change sorting order?

2010-01-24 Thread Arnaud Delobelle
Gilles Ganault nos...@nospam.com writes: On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com wrote: To avoid users from creating login names that start with digits in order to be listed at the top, I'd like to sort the list differently every minute so that it'll start with the

Re: Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread Benjamin Kaplan
On Sun, Jan 24, 2010 at 5:53 PM, John Ladasky lada...@my-deja.com wrote: Hello everyone, I've posted this same question over on ubuntuforums.org, so I'm trying to get help in all of the logical places. I'm running Ubuntu Linux 8.04 (Hardy) on a fairly new x86 box, with two hard disks in a

Re: How to Embed PHP in HTML print

2010-01-24 Thread Steve Holden
NickC wrote: On Sun, 24 Jan 2010 10:37:51 +, Duncan Booth wrote: content with ajax. Alternatively, use urllib in Python to retrieve a page from the Apache server and insert that into its own output: that Thanks for hint on urllib. I shake my head in amazement with python sometimes.

Re: Consume an iterable

2010-01-24 Thread Peter Otten
Raymond Hettinger wrote: FWIW, the deque() approach becomes even faster in Py2.7 and Py3.1 which has a high-speed path for the case where maxlen is zero. Here's a snippet from Modules/_collectionsmodule.c: /* Run an iterator to exhaustion. Shortcut for the extend/extendleft methods

Re: Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread Christian Heimes
Benjamin Kaplan wrote: Extensions written in C must be recompiled for every version of Python. Since you're using a version of Python not available through the package manager, your packages are also not available through that. You'll have to download the sources for those and compile them by

Re: ctypes for AIX

2010-01-24 Thread Andrew MacIntyre
Waddle, Jim wrote: Is there a policy concerning getting functions like ctypes working on AIX. If you can get it working, post a patch on the bug tracker. -- - Andrew I MacIntyre These thoughts are mine

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread Mel
Dave Angel wrote: But I still think there must be code for the gamma function that would be quicker. But I haven't chased that lead. Log of the gamma function is also an algorithm in its own right (e.g. published in _Numerical Recipes_.) Mel. --

Re: Symbols as parameters?

2010-01-24 Thread Steven D'Aprano
On Sun, 24 Jan 2010 10:11:07 -0800, George Sakkis wrote: Both in your example and by using a context manager, you can get away with not passing locals() explicitly by introspecting the stack frame. You say that as if it were less of an ugly hack than the locals() trick. But sys._getframe is a

Re: Broken Python 2.6 installation on Ubuntu Linux 8.04

2010-01-24 Thread John Ladasky
Thanks, Benjamin, I am getting a handle on this. I've written my own Python modules before, and have installed them using distutils. So I know that procedure. I just downloaded the Numpy 1.4.0 tarball, and I succeeded in installing it. A program I wrote which depends on numpy ran successfully

Re: Symbols as parameters?

2010-01-24 Thread George Sakkis
On Jan 25, 1:05 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Sun, 24 Jan 2010 10:11:07 -0800, George Sakkis wrote: Both in your example and by using a context manager, you can get away with not passing locals() explicitly by introspecting the stack frame. You say that

Re: medians for degree measurements

2010-01-24 Thread Robert Kern
On 2010-01-23 05:52 , Steven D'Aprano wrote: On Fri, 22 Jan 2010 22:09:54 -0800, Steve Howell wrote: On Jan 22, 5:12 pm, MRABpyt...@mrabarnett.plus.com wrote: Steve Howell wrote: I just saw the thread for medians, and it reminded me of a problem that I need to solve. We are writing some

Re: how to generate random numbers that satisfy certain distribution

2010-01-24 Thread Robert Kern
On 2010-01-23 21:30 , Steven D'Aprano wrote: On Sat, 23 Jan 2010 14:10:10 -0800, Paul Rubin wrote: Steven D'Apranost...@remove-this-cybersource.com.au writes: The Box-Muller transform is reasonably simple, but you can't be serious that it is simpler than adding twelve random numbers and

Re: easy_install error ...

2010-01-24 Thread tekion
I am also having another issue with easy_install, python setup.py easy_install --find-links thirdparty 'docutils==0.4' running easy_install error: Not a URL, existing file, or requirement spec: 'docutils==0.4' I think both problem are related. I have setuptool version .6C11 install and I am

Sikuli: the coolest Python project I have yet seen...

2010-01-24 Thread Ron
Sikuli is the coolest Python project I have ever seen in my ten year hobbyist career. An MIT oepn source project, Sikuli uses Python to automate GUI tasks (in any GUI or GUI baed app that runs the JVM) by simply drag and dropping GUI elements into Python scripts as function arguments. Download at

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steve Howell
On Jan 24, 12:44 pm, Paul Rubin no.em...@nospam.invalid wrote: Steve Howell showel...@yahoo.com writes: Proposal: Improve list's implementation so that deleting elements from the front of the list does not require an O(N) memmove operation. ... It is possible now, of course, to use a data

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Steven D'Aprano
On Sun, 24 Jan 2010 20:12:11 -0800, Steve Howell wrote: The most ambitious proposal is to fix the memory manager itself to allow the release of memory from the start of the chunk. That's inappropriate given the memory fragmentation it would cause. Bullshit. Memory managers consolidate

Re: [2.5.1.1/dictionary] Change sorting order?

2010-01-24 Thread Arnaud Delobelle
Arnaud Delobelle arno...@googlemail.com writes: Gilles Ganault nos...@nospam.com writes: On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com wrote: To avoid users from creating login names that start with digits in order to be listed at the top, I'd like to sort the list

Re: list.pop(0) vs. collections.dequeue

2010-01-24 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: There is nothing wrong with deque, at least as far as I know, if the data strucure actually applies to your use case. It does not apply to my use case. You haven't explained why deque doesn't apply to your use case. Until a convincing explanation

Re: Sikuli: the coolest Python project I have yet seen...

2010-01-24 Thread tim
On Jan 25, 11:18 am, Ron ursusmaxi...@gmail.com wrote: Sikuli is the coolest Python project I have ever seen in my ten year hobbyist career. An MIT oepn source project, Sikuli uses Python to automate GUI tasks (in any GUI or GUI baed app that runs the JVM) by simply drag and dropping GUI

[issue2611] Extend buildbot web interface to allow for forced tests to be run on a slave in verbose mode.

2010-01-24 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I'm closing this as won't fix. If there is a need to run specific tests in specific ways, it is best to check in code that does it as desired. If it is then unacceptable to run that change on all slaves, a branch can be created, and

[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-24 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7767 ___

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-24 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think the bug here is really in the application, which makes a system call to fuse and the fuse callback in the same process. This isn't supported, and IMO doesn't need to be. Python makes no promises that it will accept callbacks while

[issue7242] Forking in a thread raises RuntimeError

2010-01-24 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: One relevant difference may be the change to the fork semantics in Solaris 10: fork() now means the same as fork1(). Before, fork() meant the same as forkall(), unless the applications was linked with -lpthread, in which case fork() also

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the latest patch! It's looking good, but I have a few comments: (1) It's not necessary to do an isinstance(a, Decimal) check before calling _convert_other, since _convert_other does that check anyway. It doesn't really harm

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: One more: (5) The patch includes a (presumably accidental) change to the divmod docstring, from Return (a // b, a % b) to Return (self // other, self % other). I think the first version is preferable. --

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: And another. :) (6) I think that with these changes, the single argument methods, like Context.exp, and Context.sqrt, should also accept integers. Thoughts? -- ___ Python tracker

[issue2531] float compared to decimal is silently incorrect.

2010-01-24 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: So here's the plan for trunk. The big question is: what should be done for py3k? For trunk: - all comparisons (==, !=, =, =, , ) between floats and Decimals return the correct numerical result, as though the float were converted to

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: (6) Yes, I think that is logical. In cdecimal, I accept integers for all unary methods except is_canonical and number_class. -- ___ Python tracker rep...@bugs.python.org

[issue2531] float compared to decimal is silently incorrect.

2010-01-24 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I'm new to this thread, so I hope I didn't miss anything that has been said already. I don't fully understand why TypeError cannot be raised in 2.x. The 2.6 documentation for tp_richcompare says: If you want to implement a type for which

  1   2   >