Re: what does "python -i" use as input stream (stdin)?

2008-09-25 Thread Gabriel Genellina
En Thu, 25 Sep 2008 09:49:31 -0300, Almar Klein <[EMAIL PROTECTED]> escribió: Hi, I want to start "python -i" from a subprocess and change its stdin stream, so I get control over the commands I feed the interpreter. I thought just changing sys.stdin to my custom file-like object would suff

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Diez B. Roggisch
Nick Craig-Wood schrieb: Scott Sharkey <[EMAIL PROTECTED]> wrote: B> Our development group at work seems to be heading towards adopting python as one of our standard "systems languages" for internal application development (yeah!). One of the issues that's come up is the problem with apt

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Diez B. Roggisch
Dmitry S. Makovey schrieb: Scott Sharkey wrote: Any insight into the best way to have a consistent, repeatable, controllable development and production environment would be much appreciated. you have just described OS package building ;) I can't speak for everybody, but supporting multiple pl

Re: is decorator the right thing to use?

2008-09-25 Thread Dmitry S. Makovey
George Sakkis wrote: > I'm not sure if the approach below deals with all the issues, but one > thing it does is decouple completely the proxied objects from the > proxy: > class _ProxyMeta(type): It smelled to me more and more like metaclass too, I was just trying to avoid them :) Your code

Re: PEP Proposal

2008-09-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Gabriel Genellina wrote: En Thu, 25 Sep 2008 16:24:58 -0300, <[EMAIL PROTECTED]> escribió: sorry, I have these ideas for longer than 10 years, please have a look on it and comment on it. Thx. This is another proposal for introducing types into Python. You got the

Re: Quick sort implementation in python

2008-09-25 Thread bearophileHUGS
Alex Snast: > However i have no idea how to access the values of a data structure that > doesn't allow random access.< Well, a sorting algorithm can work in-place, sorting the position of the items inside the given collection, or it can create a new data structure with the items (in Python all it

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Scott Sharkey
Diez B. Roggisch wrote: > Dmitry S. Makovey schrieb: >> Scott Sharkey wrote: >>> Any insight into the best way to have a consistent, repeatable, >>> controllable development and production environment would be much >>> appreciated. >> >> you have just described OS package building ;) Except that

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Dmitry S. Makovey
Diez B. Roggisch wrote: > - different OS. I for one don't know about a package management tool > for windows. And while our servers use Linux (and I as developer as > well), all the rest of our people use windows. No use telling them to > apt-get instal python-imaging. that is a very valid poin

Re: Quick sort implementation in python

2008-09-25 Thread Martin v. Löwis
> Now as you can see I'm passing my list object to both functions along > with their first, last indices I cannot really see that. More specifically, it isn't definite what the type of the "a" argument is, nor does the specific type of "a" matter for the algorithm. It could be a list, or it could

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Diez B. Roggisch
that is a very valid point, but it seemed that Scott has homogeneous environment: Debian/Ubuntu so my post was relative to the original request. I agree that when you throw Windows/MacOS into the mix things become "interesting". But then it's better when your developers develop on server/platform

Re: How to get the filename in the right case ?

2008-09-25 Thread Diez B. Roggisch
Stef Mientki schrieb: OKB (not okblacke) wrote: Stef Mientki wrote: import Module1 d:\data_python_25\pylab_works\module1.py(3)() -> print "hello" (Pdb) Then we know if PDB is really the culprit. So pdb is the problem. Yep, it does the same t

Re: Python style: exceptions vs. sys.exit()

2008-09-25 Thread Ross Ridge
Ross Ridge wrote: > Plenty of people were quick to say that the exception should be passed > through to the caller. No one said this behaviour should be documented. > There may be little practical difference bewteen calling sys.exit() > after printing an error and progating an exception if no one

Re: How can I customize builtin module search path to prefix/lib to prefix/lib64?

2008-09-25 Thread js
For 64bit python, there's no need to look at lib/lib-dynload because libraries for 64bit should be in lib64/lib-dynload. Having module search path which point to libraries the python can not understand is, IMHO, wrong. On Fri, Sep 26, 2008 at 3:03 AM, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On

Re: Python style: exceptions vs. sys.exit()

2008-09-25 Thread Ross Ridge
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Also note that there are quite a couples cases where the library authors >themselves cannot predict which exception types may be raised - as soon >as the library functions expect callback functions, file-like or >dict-like or whatever-like objects

Re: Eggs, VirtualEnv, and Apt - best practices?

2008-09-25 Thread Dmitry S. Makovey
Diez B. Roggisch wrote: > Well, you certainly want a desktop-orientied Linux for users, so you > chose ubuntu - but then on the server you go with a more stable debian > system. Even though the both have the same technical and even package > management-base, they are still incompatible wrt to packa

Re: text processing

2008-09-25 Thread MRAB
On Sep 25, 6:34 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 25 Sep 2008 15:51:28 +0100, [EMAIL PROTECTED] wrote: > > I have string like follow > > 12560/ABC,12567/BC,123,567,890/JK > > > I want above string to group like as follow (12560,ABC) > > (12567,BC) > > (123,567,890,JK

Re: Not fully OO ?

2008-09-25 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Craig Allen wrote: > It is clearly possible to write procedural code... that is, > Python does not force object oriented syntax or concepts on you ... Object orientation IS procedural. -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-25 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, candide wrote: > "... Python supports OOP and classes to an extent, but is not a full OOP > language." Python allows you to use OO-style constructs, but doesn't force you to have inheritance and subclasses if you don't want to. Duck typing is usually a much more fl

Re: PEP Proposal

2008-09-25 Thread Carl Banks
On Sep 25, 4:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 25 Sep 2008 16:24:58 -0300, <[EMAIL PROTECTED]> escribió: > > > sorry, I have these ideas for longer than 10 years, please have a look   > > on it > > and comment on it. Thx. > > > This is another proposal for introducing

Re: Not fully OO ?

2008-09-25 Thread James Mills
On Fri, Sep 26, 2008 at 8:20 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > Object orientation IS procedural. Correction: OOP is Imperative. --JamesMills -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP Proposal

2008-09-25 Thread James Mills
On Fri, Sep 26, 2008 at 6:14 AM, <[EMAIL PROTECTED]> wrote: > Typed parameters. Method-Declaration-filtered-typed parameters. That's what > I'm thinking of. Why do we need this (rubbish) ? Seriously. The use-case is far too small. And don't invent use-cases either. Instead of coming up with idea

Re: How to get the filename in the right case ?

2008-09-25 Thread MRAB
On Sep 25, 8:38 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > I found a partial workaround that is good enough for me: > > def Get_Windows_Filename ( FileName ) : >   if os.name == 'nt' : >     File = os.path.splitext ( FileName .lower ())[0] >     return glob.glob ( File + '.p?' ) >   return FileN

Milenko Kindl bnvnvnvb

2008-09-25 Thread logan . johnny11
NEW YORK - Financial markets grew more upbeat Thursday as political leaders said they struck an agreement in principle on a massive spending plan to revive the crippled financial system. The Dow Jones industrial average jumped about 200 points on optimism about the bailout, and demand for safe-have

Re: How to get the filename in the right case ?

2008-09-25 Thread Fredrik Lundh
Stef Mientki wrote: > 1. I've a multitab editor. > 2. When a breakpoint is reached, > 3. I check if the file specified in pdb output, is already open in one > of the editor tabs, > 4. if not, I open a new tab with the correct file, > 5. I focus the correct editor tab and jump to the line specifie

Small Accidents Mean Big Trouble for Supercollider

2008-09-25 Thread [EMAIL PROTECTED]
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup glitches in the massive, complex machines they use to smash atoms. But the unique qualities of the world's l

Re: How to get the filename in the right case ?

2008-09-25 Thread Stef Mientki
Fredrik Lundh wrote: Stef Mientki wrote: > 1. I've a multitab editor. > 2. When a breakpoint is reached, > 3. I check if the file specified in pdb output, is already open in one > of the editor tabs, > 4. if not, I open a new tab with the correct file, > 5. I focus the correct editor tab and jum

Re: multiprocessing eats memory

2008-09-25 Thread Istvan Albert
On Sep 25, 8:40 am, "Max Ivanov" <[EMAIL PROTECTED]> wrote: > At any time in main process there are shouldn't be no more than two copies of > data > (one original data and one result). >From the looks of it you are storing a lots of references to various copies of your data via the async set. --

deleting an object

2008-09-25 Thread Karl Kobata
Please help. Questions based on snippet of code below. 1) when myTestCase is deleted, is just the pointer deleted or the entire instance with all of its data and data structure deleted? 2) What is the practice for deleted the object and recovering the memory it occupies? 3) If

Re: PEP Proposal

2008-09-25 Thread Aaron "Castironpi" Brady
On Sep 25, 2:24 pm, [EMAIL PROTECTED] wrote: > Hi, > > sorry, I have these ideas for longer than 10 years, please have a look on it > and comment on it. Thx. > > > > This is another proposal for introducing types into Python. > > There are many reasons for incorporating types into Python, but

SimpleXMLRPCServer -- turning off request log?

2008-09-25 Thread mh
My SimpleXMLRPCServer program prints to stderr a line like this for each request: ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 - Is there a way to turn this logging off? I have RTFM and can't seem to find a way to do so. Many TIA! Mark -- Mark Harrison Pixar Animation S

Re: Python is slow?

2008-09-25 Thread David Cournapeau
On Wed, Sep 24, 2008 at 3:07 AM, sturlamolden <[EMAIL PROTECTED]> wrote: > On Sep 23, 3:44 pm, Robert Singer <[EMAIL PROTECTED]> wrote: > >> Well, python is not a number crunching language. However much we would >> like it to be (we would ? :-). > >> No scripting language is. > > Not even Matlab, R

Fastest way to max() list

2008-09-25 Thread David Di Biase
I have a list with about 1000-1500 sub-lists which look like so: list[-0.28817955213290786, 3.6693631467403929, 'H', 31.31225233035784]] The first and second values are Angstrom units specifying the location of a particle. What I'd like to do is determine the distance between the smallest and larg

Re: SimpleXMLRPCServer -- turning off request log?

2008-09-25 Thread Sean DiZazzo
On Sep 25, 6:01 pm, [EMAIL PROTECTED] wrote: > My SimpleXMLRPCServer program prints to stderr a line like > this for each request: > > ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 - > > Is there a way to turn this logging off?  I have RTFM and can't > seem to find a way to do

Re: multiple processes, private working directories

2008-09-25 Thread Tim Arnold
"Tim Arnold" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a bunch of processes to run and each one needs its own working > directory. I'd also like to know when all of the processes are > finished. Thanks for the ideas everyone--I now have some news tools in the toolbox. T

Re: SimpleXMLRPCServer -- turning off request log?

2008-09-25 Thread Sean DiZazzo
On Sep 25, 9:04 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote: > On Sep 25, 6:01 pm, [EMAIL PROTECTED] wrote: > > > My SimpleXMLRPCServer program prints to stderr a line like > > this for each request: > > > ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 - > > > Is there a way to

Re: What do you call a class not intended to be instantiated

2008-09-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On 21 Sep 2008 22:39:47 GMT, Steven D'Aprano ><[EMAIL PROTECTED]> declaimed the following in >comp.lang.python: >> >> What do you call such a class? > > A wasted definition... The same functionality is achieved by

Re: Python is slow?

2008-09-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > >AFAICT, _everybody_ is bad at programming C++. > >One begins to suspect it's not the fault of the programmers. http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html -- Aahz ([EMAIL PROTECTED]) <*> ht

Re: text processing

2008-09-25 Thread Paul McGuire
On Sep 25, 9:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have string like follow > 12560/ABC,12567/BC,123,567,890/JK > > I want above string to group like as follow > (12560,ABC) > (12567,BC) > (123,567,890,JK) > > i try regular expression i am able to get first two not the third one.

Re: Fastest way to max() list

2008-09-25 Thread Chris Rebert
On Thu, Sep 25, 2008 at 8:57 PM, David Di Biase <[EMAIL PROTECTED]> wrote: > I have a list with about 1000-1500 sub-lists which look like so: > list[-0.28817955213290786, 3.6693631467403929, 'H', 31.31225233035784]] > > The first and second values are Angstrom units specifying the location of a > p

Writing a well-behaved daemon

2008-09-25 Thread Ben Finney
Howdy all, Writing a Python program to become a Unix daemon is relatively well-documented: there's a recipe for detaching the process and running in its own process group. However, there's much more to a Unix daemon than simply detaching. At a minimum, a well-behaved Unix daemon must at least: *

Re: Writing a well-behaved daemon

2008-09-25 Thread Sean DiZazzo
On Sep 25, 10:08 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Howdy all, > > Writing a Python program to become a Unix daemon is relatively > well-documented: there's a recipe for detaching the process and > running in its own process group. However, there's much more to a Unix > daemon than simply

Re: Comparing float and decimal

2008-09-25 Thread Terry Reedy
Mark Dickinson wrote: On Sep 24, 6:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: If there is not now, there could be in the future, and the decimal authors are committed to follow the standard wherever it goes. Therefore, the safe course, to avoid possible future deprecations due to doing too mu

Re: Quick sort implementation in python

2008-09-25 Thread Terry Reedy
Alex Snast wrote: Hi guys, I've been learning python in the past week and tried to implement a q.sort algorithm in python as follows: def quick_sort(l, first, last) if first < last: q = partition(a, first, last) You changed the name of the list to be sorted from 'l' to 'a'. Please

How to read a jpg bytearray from a Flash AS3 file

2008-09-25 Thread rsgalloway
I'm trying to save an image from a Flash AS3 to my server as a jpg file. I found some PHP code to do this, but I want to do this in Python. I'm not quite sure how to convert the following code to Python. It's mainly the $GLOBALS["HTTP_RAW_POST_DATA"] part I don't know how to convert. source: ht

<    1   2