Re: lambda functions ?

2007-02-05 Thread Maxim Veksler
Wow, Thank you everyone for the help. I am amazed by the motivation people have on this list to help new comers. I hope that I will be able to contribute equally some day. On 05 Feb 2007 14:22:05 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Maxim Veksler" <[EMAIL PROTECTED]> write

Re: python for web programming

2007-02-05 Thread Gabriel Genellina
En Tue, 06 Feb 2007 02:10:14 -0300, <[EMAIL PROTECTED]> escribió: > Can you show me some reference datas for python web programming?Thanks. http://wiki.python.org/moin/WebProgramming http://wiki.python.org/moin/WebApplications or search the wiki, or even use Google. -- Gabriel Genellina --

Re: Taint (like in Perl) as a Python module: taint.py

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 23:01:51 -0300, Ben Finney <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> writes: > >> I suppose you don't intend to publish the SafeString class - but if >> anyone can get a SafeString instance in any way or another, he can >> convert *anything* into

python for web programming

2007-02-05 Thread JStoneGT
hello, Can you show me some reference datas for python web programming?Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-05 Thread Paddy
On Feb 5, 2:48 pm, "Gosi" <[EMAIL PROTECTED]> wrote: > It is quite easy to call J from Python > > http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... Hii Gosi, >From reading what has gone before, you seem to have got it in the neck from some pythonistas. I'd just like to say f

Re: Decimating Excel files

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 22:31:30 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Feb 6, 10:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> I'd try the "xlrd" package - it is capable of reading Excel files on any >> platform. > > Thanks for the plug, Gabriel. However xlrd is not the pa

Re: Dlaczego ten destruktor nie dziala

2007-02-05 Thread alf
Sulsa wrote: > sorry, wrong group. the group is correct but language wrong, did you find out why the exception pops up -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-05 Thread [EMAIL PROTECTED]
On Feb 5, 8:48 am, "Gosi" <[EMAIL PROTECTED]> wrote: > It is quite easy to call J from Python > > http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... There are a couple of issue that should be adressed. Am I going to jail if I write a program and then redistribute all the fil

Re: Decimating Excel files

2007-02-05 Thread John Machin
On Feb 6, 1:19 pm, gonzlobo <[EMAIL PROTECTED]> wrote: > I tried to open the file with Kate, trust me, it's an Excel file. Who or what is Kate? In what sense is trying to open it any evidence that it's an Excel file? Did you *succeed* in opening the file "with Kate"? What is the problem that the

Re: Coordinate Grid Points

2007-02-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > On Feb 5, 3:29 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Hello, >>> I am very knew to python and am attempting to write a program >>>in python that a friend of mine is having to write in java. I am doing >>>this for fun and woul

Re: Decimating Excel files

2007-02-05 Thread gonzlobo
I tried to open the file with Kate, trust me, it's an Excel file. I'm using xlrd, it works beautifully (although come to think of it, I haven't tried writing to an .xls file yet... hmmm) > To clear up the doubts, I'd suggest that the OP do something like this > at the Python interactive prompt: >

IOError: [Errno 4] Interrupted system call

2007-02-05 Thread Marco
Hello,every one, I meet a question: in my old script, I usually use os.popen2() to get info from standard unix(LinuX) program like ps,ifconfig... Now, I write a OO-based programme, I still use os.popen2( check whether mplayer still working via ps command ), but some things I got the following mes

Re: Checking default arguments

2007-02-05 Thread Igor V. Rafienko
[ George Sakkis ] First of all, thanks to everyone who replied. [ ... ] > I don't know why you might want to distinguish between the two in > practice (the unique object idea mentioned in other posts should > handle most uses cases), but if you insist, here's one way to do it: There is no act

Re: Coordinate Grid Points

2007-02-05 Thread Eric . Gabrielson
On Feb 5, 3:29 pm, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > >I am very knew to python and am attempting to write a program > > in python that a friend of mine is having to write in java. I am doing > > this for fun and would like some help as to how i

Re: Taint (like in Perl) as a Python module: taint.py

2007-02-05 Thread Ben Finney
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > I suppose you don't intend to publish the SafeString class - but if > anyone can get a SafeString instance in any way or another, he can > convert *anything* into a SafeString trivially. The point (in Perl) of detecting taint isn't to prevent a pr

Re: Decimating Excel files

2007-02-05 Thread John Machin
On Feb 6, 12:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 5, 5:46 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > En Sat, 03 Feb 2007 18:52:10 -0300, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> escribió: > > > > On Feb 3, 1:43?pm, gonzlobo <[EMAIL PROTECTED]> wrote: > >

Re: Python design project

2007-02-05 Thread [EMAIL PROTECTED]
On Feb 5, 4:09 am, [EMAIL PROTECTED] wrote: > I think I need to explain the things better I think, so I do; > > First answering the questions above; I think i have to explain the > project more. > > With type I mean; typography/fonts/characters.. For my final exam I > created the idea to treath fon

Re: Python design project

2007-02-05 Thread Josh Bloom
Hi Solrick, This sounds like some interesting stuff. I'd love to discuss it some more with you and maybe work with you on it. Some things to think about: 1. Rules for Font interactions. What happens when fonts 'hit' each other, or 'live' long enough to reproduce andmutate maybe? 2. What p

Re: Recursive zipping of Directories in Windows

2007-02-05 Thread [EMAIL PROTECTED]
On Feb 4, 12:42 pm, "Jandre" <[EMAIL PROTECTED]> wrote: > On Feb 1, 9:39 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > > Jandre wrote: > > > Hi > > > > I am a python novice and I am trying to write a python script (most of > > > the code is borrowed) to Zip a directory containing some other >

Re: Decimating Excel files

2007-02-05 Thread John Machin
On Feb 6, 10:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 18:52:10 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > On Feb 3, 1:43?pm, gonzlobo <[EMAIL PROTECTED]> wrote: > >> We have a data acquisition program that saves its output to Excel's > >> .xls

Re: Decimating Excel files

2007-02-05 Thread [EMAIL PROTECTED]
On Feb 5, 5:46 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 18:52:10 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > On Feb 3, 1:43?pm, gonzlobo <[EMAIL PROTECTED]> wrote: > >> We have a data acquisition program that saves its output to Excel's > >> .xls

Re: Taint (like in Perl) as a Python module: taint.py

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 19:13:04 -0300, Johann C. Rocholl <[EMAIL PROTECTED]> escribió: > The following is my first attempt at adding a taint feature to Python > to prevent os.system() from being called with untrusted input. What do > you think of it? A simple reload(os) will drop all your wrapped

Re: Python does not play well with others

2007-02-05 Thread Paul Rubin
"Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > Certainly launching any new threads should be postponed til after the > > fork. > > Except that you can't outright prevent it from being done as a Python > module could create the threads as a side effect of the module import > itself. Yeah, th

Re: Why?

2007-02-05 Thread NoName
thanx a lot!! On 6 Фев., 12:04, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 Feb 2007 21:32:23 -0300, NoName <[EMAIL PROTECTED]> escribio: > > > # -*- coding: cp1251 -*- > > from glob import glob > > > src= "C:\\\\Новая папка\\*.*" > > print "src=",src > print "repr(src)=",repr

Re: lambda functions ?

2007-02-05 Thread Toby A Inkster
Maxim Veksler wrote: > And what is the "f" object? An integer? a pointer? an Object? A function. -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux * = I'm getting there! -- http://mail.python.org/mai

Re: Why?

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 21:32:23 -0300, NoName <[EMAIL PROTECTED]> escribió: > # -*- coding: cp1251 -*- > from glob import glob > > src= "C:\\\\Новая папка\\*.*" print "src=",src print "repr(src)=",repr(src) > print glob(src) for fn in glob(src): print fn > > > > > > ['C:\\\\\xcd\xee\xe2\xe

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 16:47:43 -0300, metaperl <[EMAIL PROTECTED]> escribió: > For this program: > > def reverse(data): > for index in range(len(data)-1, -1, -1): > yield data[index] > > r = reverse("golf") > > for char in r: > print char > > > I'm wondering if the line: > > r = rev

Re: Why?

2007-02-05 Thread John Machin
On Feb 6, 11:32 am, "NoName" <[EMAIL PROTECTED]> wrote: > # -*- coding: cp1251 -*- > from glob import glob > > src= "C:\\\\Новая папка\\*.*" > print glob(src) > > ['C:\\\\\xcd\xee\xe2\xe0\xff \xef\xe0\xef\xea\xe0\\ksdjfk.txt', 'C: > \\\\\xcd\xee\xe2\xe0\xff \xef > \xe0\xef\xea\xe0\\\xeb

Re: Python module question

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 16:43:54 -0300, Rodolfo S. Carvalho <[EMAIL PROTECTED]> escribió: > My question is: can I code a method __getattr__() to change the behavior > of > the 'import' command? You can play with __import__, imp and ihooks, but could you explain better what you need? Perhaps you

Why?

2007-02-05 Thread NoName
# -*- coding: cp1251 -*- from glob import glob src= "C:\\\\Новая папка\\*.*" print glob(src) ['C:\\\\\xcd\xee\xe2\xe0\xff \xef\xe0\xef\xea\xe0\\ksdjfk.txt', 'C: \\\\\xcd\xee\xe2\xe0\xff \xef \xe0\xef\xea\xe0\\\xeb\xfb\xe2\xee\xe0\xeb\xee\xe0\xeb.txt'] Why not "C:\\\\Новая пап

Re: get objects referencing another one

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 12:59:23 -0300, Olivier Feys <[EMAIL PROTECTED]> escribió: > I'm working on a tree and I have refcounting problems. > Is it possible from an object, to get the list of objects referencing it > ? Try gc.get_referrers -- Gabriel Genellina -- http://mail.python.org/mailma

Re: Calling J from Python

2007-02-05 Thread greg
Alexander Schmolck wrote: > For example I once wrote this (slow) code to display > part of a mandelbrot fractal: > > load'viewmat' > viewmat+/2&>:|((j.~/~(%~i:)99)&+@:*:)^:(i.32)0 > > It'll likely require you more typing in python, Yes, but with Python you wouldn't have to spend a couple

Re: Decimating Excel files

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 18:52:10 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On Feb 3, 1:43?pm, gonzlobo <[EMAIL PROTECTED]> wrote: >> We have a data acquisition program that saves its output to Excel's >> .xls format. Unfortunately, the programmer was too stupid to write >> files the

Re: ctypes.com.IUnknown

2007-02-05 Thread Robin Becker
Robin Becker wrote: > Giles Brown wrote: >> >> >> What about downloading the spin-off library? >> http://sourceforge.net/projects/comtypes/ >> >> (I think this was created to move the com stuff out of ctypes?) > > > Thanks I didn't know that; I'll give it a whirl. I tried, but f

Re: raise or not to raise [Newbie]

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 18:07:12 -0300, Jacol <[EMAIL PROTECTED]> escribió: > I understand that author generated exception and than extracted the name > of > function from the exeption. But is any sens in using exeptions service if > we have smthing simpler: just print for example? In my opinion n

Re: confused about resizing array in Python

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 21:34:19 -0300, Dongsheng Ruan <[EMAIL PROTECTED]> escribió: > This seems to be clever to use reference for list. > > Is it unique to Python? > > How about the traditional programming languages like C, Pascal or C++? Python is written in C - so obviously it can be done in p

Re: .pth configuration method not working

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 20:03:03 -0300, Mark <[EMAIL PROTECTED]> escribió: > Sys.path doesn't recognize any directories that I add using the .pth > method. I'm running Windows XP if that helps diagnose the problem. Using Python 2.4.3 on WinXP too. My Python is on C:\apps\Python. Works fine for me

Re: Definitions of editor and IDE?

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 19:48:06 -0300, Dick Moores <[EMAIL PROTECTED]> escribió: > Are there generally accepted definitions of "editor" and "IDE". Is there > a clear-cut > distinction between them? I've been looking at the lists of each at > python.org, > < http://wiki.python.org/moin/PythonEdito

Re: wave

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 17:00:39 -0300, Silver Rock <[EMAIL PROTECTED]> escribió: > supose i´ve opened a sound with the wave module: > import wave sound=wave.open(filename,'rb') > > now this is strange: > sound.getnframes() != len(sound.readframes(sound.getnframes()) > True > > Why s

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 10:15 am, Paul Rubin wrote: > "Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > There is also much more possibility for code, if it runs up extra > > threads, to interfere with the operation of the Apache parent process. > > Certainly launching any new threads

Re: PYTHONPATH or any other way to set seachpath (winXP) ?

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 14:25:31 -0300, Stef Mientki <[EMAIL PROTECTED]> escribió: > Is it possible to change the searchpath for modules on the flight, > under winXP ? > Most preferred is some command to extend the searchpath. > (the environment variable PYTHONPATH needs a reboot) PYTHONPATH is use

Re: Coordinate Grid Points

2007-02-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hello, >I am very knew to python and am attempting to write a program > in python that a friend of mine is having to write in java. I am doing > this for fun and would like some help as to how i can generate random > coordinate points (x,y) and compare them with u

Re: CTypes

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 13:01:56 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I'm trying to install PyWinAuto for Python 2.4. It said that one of > the required libraries that I need to install would be CTypes. So I > head over to CTypes's SourceForge page and I installed CTypes for > Py

Re: Coordinate Grid Points

2007-02-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hello, >I am very knew to python and am attempting to write a program > in python that a friend of mine is having to write in java. I am doing > this for fun and would like some help as to how i can generate random > coordinate points (x,y) and compare them with u

Re: Python does not play well with others

2007-02-05 Thread Paul Rubin
"Graham Dumpleton" <[EMAIL PROTECTED]> writes: > The first is whether it would be possible for code to be run with > elevated privileges given that the main Apache process usually is > started as root. I'm not sure at what point it switches to the special > user Apache generally runs as and whether

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 9:15 am, Paul Rubin wrote: > "Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > Yes, these per VirtualHost interpreter instances will only be created > > on demand in the child process when a request arrives which > > necessitates it be created and so there is s

Coordinate Grid Points

2007-02-05 Thread Eric . Gabrielson
Hello, I am very knew to python and am attempting to write a program in python that a friend of mine is having to write in java. I am doing this for fun and would like some help as to how i can generate random coordinate points (x,y) and compare them with user inputted coordinate points. For

Re: stlib name clash when using python as ASP language

2007-02-05 Thread Gabriel Genellina
En Sun, 04 Feb 2007 09:53:22 -0300, Joost <[EMAIL PROTECTED]> escribió: >> You *assume* that [0] is the IIS path, but perhaps some other imported >> module changed sys.path too, and now it's not the first one anymore. >> If you know exactly the path, try sys.path.remove(iis_path). >> > > It's wa

Re: Broken Library Code, suggested course of action

2007-02-05 Thread Bruno Desthuilliers
Melih Onvural a écrit : > I've been trying to use the URLParse library, and I thought I had all > of the kinks worked out when I ran into this: > > Traceback (most recent call last): > File "./run.py", line 130, in ? > main() > File "./run.py", line 126, in main > r = crawl.crawl(p, x)

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 8:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 5, 12:52 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > John Nagle wrote: > > > >>Graham Dumpleton wrote: > > > >>>On Feb 4, 1:05 pm, Paul Rubin wrote: > > > >>>

Re: lambda functions ?

2007-02-05 Thread Bruno Desthuilliers
Maxim Veksler a écrit : > Hello, > I'm new on this list and in python. Welcome on board... > It seems python has some interesting concept of "ad hoc" function > which I'm trying to understand without much success. > > Take the following code for example: > > """ > def make_incrementor(n):

glutInit and wxPython on Mac OSX

2007-02-05 Thread Artie
I seem to have uncovered a problem when using glutInit alongside wxPython on Mac OSX. If glutInit is called prior to creating a wx.App, many window and mouse events are either lost, not generated, or misgenerated for the glcanvas. However, if glutInit is called after the wx.App has been created t

Re: Parameter lists

2007-02-05 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Sun, 04 Feb 2007 17:45:04 +0100, Mizipzor wrote: > > >>Consider the following snippet of code: >> >>class Stats: >>def __init__(self, speed, maxHp, armor, strength, attackSpeed, imagePath): >>self.speed = speed >>self.maxHp = maxHp >>

Re: Unicode formatting for Strings

2007-02-05 Thread John Machin
On Feb 6, 8:05 am, [EMAIL PROTECTED] wrote: > On Feb 5, 7:00 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > > On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > Hi, > > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > > > s

Re: lambda functions ?

2007-02-05 Thread Paul Rubin
"Maxim Veksler" <[EMAIL PROTECTED]> writes: > >>> def make_incrementor(n): > ... return lambda x: x + n Is the same as: def make_incrementor(n): def inner(x): return x + n return inner When you enter make_incrementor, it allocates a memory slot (normally we'd think of this as

Re: lambda functions ?

2007-02-05 Thread Don Morrison
Maybe you would like a generator: >>> def f(n): ... while True: ... n += 1 ... yield n ... >>> a = f(5) >>> >>> a.next() 6 >>> a.next() 7 >>> a.next() 8 >>> a.next() 9 >>> On 2/5/07, Maxim Veksler <[EMAIL PROTECTED]> wrote: > Hello, > I'm new on this list and in pytho

Re: Python does not play well with others

2007-02-05 Thread Paul Rubin
"Graham Dumpleton" <[EMAIL PROTECTED]> writes: > Yes, these per VirtualHost interpreter instances will only be created > on demand in the child process when a request arrives which > necessitates it be created and so there is some first time setup for > that specific interpreter instance at that po

Taint (like in Perl) as a Python module: taint.py

2007-02-05 Thread Johann C. Rocholl
The following is my first attempt at adding a taint feature to Python to prevent os.system() from being called with untrusted input. What do you think of it? # taint.py - Emulate Perl's taint feature in Python # Copyright (C) 2007 Johann C. Rocholl <[EMAIL PROTECTED]> # # Permission is hereby gran

Re: Python does not play well with others

2007-02-05 Thread Paul Rubin
"Graham Dumpleton" <[EMAIL PROTECTED]> writes: > No such limitation exists with mod_python as it does all the > interpreter creation and management at the Python C API level. The one > interpreter per process limitation is only when using the standard > 'python' runtime executable and you are doing

Broken Library Code, suggested course of action

2007-02-05 Thread Melih Onvural
I've been trying to use the URLParse library, and I thought I had all of the kinks worked out when I ran into this: Traceback (most recent call last): File "./run.py", line 130, in ? main() File "./run.py", line 126, in main r = crawl.crawl(p, x) File "/home/monvural/src/crawl.py", l

lambda functions ?

2007-02-05 Thread Maxim Veksler
Hello, I'm new on this list and in python. It seems python has some interesting concept of "ad hoc" function which I'm trying to understand without much success. Take the following code for example: """ >>> def make_incrementor(n): ... return lambda x: x + n ... >>> f = make_incrementor(42) >>>

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-05 Thread Gabriel Genellina
En Sat, 03 Feb 2007 07:35:22 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: > >> En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> >> escribió: >> >>> John Nagle wrote: >>> >>> import warnings >>> warnings.filterwarnings("ignore", message="Old style

Re: Python does not play well with others

2007-02-05 Thread [EMAIL PROTECTED]
On Feb 5, 12:52 pm, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > John Nagle wrote: > > >>Graham Dumpleton wrote: > > >>>On Feb 4, 1:05 pm, Paul Rubin wrote: > > "Paul Boddie" <[EMAIL PROTECTED]> writes: > >> Realistically, mod_python is a d

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > No, thanks. But hopefully we have Python : > > Python 2.4.1 (#1, Jul 23 2005, 00:37:37) > [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. >

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 5:39 am, Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > > > The GIL doesn't affect seperate processes, and any large server that > > > cares about stability is going to be running a pre-forking MPM no > > > matter what language they're supporting.

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 4:52 am, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > John Nagle wrote: > > >>Graham Dumpleton wrote: > > >>>On Feb 4, 1:05 pm, Paul Rubin wrote: > > "Paul Boddie" <[EMAIL PROTECTED]> writes: > >> Realistically, mod_python is a de

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Laurent Pointal a écrit : > Bruno Desthuilliers wrote: > > >>Gosi a écrit : >> >>>On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>>J has very many advanced operations. >> >>what's an "advanced operation" ? > > > An operation which dont stay in place. > You meant something l

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Alexander Schmolck a écrit : > Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > > >>Alexander Schmolck wrote: >> >> >>>Apart from being less to type >> >>Cool. Less to type. > > > Yes. Readability is more important in many context, but for something designed > for interactive experimentation

Re: alias for data member of class instance?

2007-02-05 Thread Bruno Desthuilliers
Sean McIlroy a écrit : > hi all > > is there a way to do this ... > > class clown: > def __init__(self): > self.x = 0 > self.y = ALIAS(self.x) ## FEASIBLE ? class Alias(object): def __init__(self, attrname): self._attrname = attrname def __get__(s

Re: alias for data member of class instance?

2007-02-05 Thread Larry Bates
Sean McIlroy wrote: Sean McIlroy wrote: > hi all > > is there a way to do this ... > > class clown: > def __init__(self): > self.x = 0 > self.y = ALIAS(self.x) ## FEASIBLE ? > > ... so that you get results like this ... > > krusty = clown() > krusty.x >>> 0 > k

Re: alias for data member of class instance?

2007-02-05 Thread Bruno Desthuilliers
Sean McIlroy a écrit : > hi all > > is there a way to do this ... > > class clown: > def __init__(self): > self.x = 0 > self.y = ALIAS(self.x) ## FEASIBLE ? > class Clown(object): def __init__(self): self.x = 0 @apply def x(): def fget(self)

[ANN] Python Akismet 0.1.5

2007-02-05 Thread Fuzzyman
`Python Akismet 0.1.5 `_ is now available. Fixed a typo/bug in ``submit_ham``. Thanks to Ian Ozsvald for pointing this out. **Python Akismet** is a Python interface to the `Akismet `_, spam blocking web-service. It is aimed at trapping s

Re: Unicode formatting for Strings

2007-02-05 Thread robson . cozendey . rj
On Feb 5, 7:00 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > Hi, > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > > string, so here is the code snippet: > > > > # -*- codi

Re: wxPython: TextCtrl delayed update when using TE_RICH(2)

2007-02-05 Thread jean-michel bain-cornu
> > This is almost totally wrong. There is no "new event loop" involved. > The OP is running a long task in the main thread, which is blocking > the event loop. When the event loop is blocked, the application will > not update and cannot be interacted with. It's that simple. The event > loop in a

Re: Unicode formatting for Strings

2007-02-05 Thread Chris Mellon
On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > string, so here is the code snippet: > > > > # -*- coding: utf-8 -*- > > filename = u"Ataris Aquáticos #2.txt" > > f = open(filename,

Re: Calling J from Python

2007-02-05 Thread Laurent Pointal
Bruno Desthuilliers wrote: > Gosi a écrit : >> On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> J has very many advanced operations. > > what's an "advanced operation" ? An operation which dont stay in place. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode formatting for Strings

2007-02-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi, > > I´m trying desperately to tell the interpreter to put an 'á' in my > string, so here is the code snippet: > > # -*- coding: utf-8 -*- > filename = u"Ataris Aquáticos #2.txt" > f = open(filename, 'w') > > Then I save it with Windows Notepad, in the UTF-8 format.

Re: alias for data member of class instance?

2007-02-05 Thread Paul Rubin
"Sean McIlroy" <[EMAIL PROTECTED]> writes: > self.y = ALIAS(self.x) ## FEASIBLE ? The closest thing is probably to use @property. -- http://mail.python.org/mailman/listinfo/python-list

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread Jussi Salmela
metaperl kirjoitti: > For this program: > > def reverse(data): > for index in range(len(data)-1, -1, -1): > yield data[index] > > r = reverse("golf") > > for char in r: > print char > > > I'm wondering if the line: > > r = reverse("golf") > > "demands" the contents of the fun

alias for data member of class instance?

2007-02-05 Thread Sean McIlroy
hi all is there a way to do this ... class clown: def __init__(self): self.x = 0 self.y = ALIAS(self.x) ## FEASIBLE ? ... so that you get results like this ... krusty = clown() krusty.x >> 0 krusty.y >> 0 krusty.x = 1 krusty.x >> 1 krusty.y >> 1 ... ? th

Re: Calling J from Python

2007-02-05 Thread John Salerno
Alexander Schmolck wrote: > Would you use a calculator that would require Java-style > boilerplate to add two numbers? This isn't a Java newsgroup, so your metaphor is irrelevant. People use Python because it *isn't* Java and does not succumb to the problem you seem to be accusing it of. -- ht

Re: Calling J from Python

2007-02-05 Thread Alexander Schmolck
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > > Apart from being less to type > > Cool. Less to type. Yes. Readability is more important in many context, but for something designed for interactive experimentation and exploration little typing is absolutely ess

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : > Gosi wrote: > > >>On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> >>>Gosi wrote: >>> It is quite easy to call J from Python >>> >>>http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... >>> >>>What is J, and why should we care

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Alexander Schmolck a écrit : > Larry Bates <[EMAIL PROTECTED]> writes: > > >>And why is that superior to this: >> >>def avg(l): >>return float(sum(l))/len(l) >> >> >avg([1,2,3,4]) >> >>2.5 > > > Apart from being less to type and it is superior in that it's generalizes much > better, e.g

Re: Missing member

2007-02-05 Thread Ayaz Ahmed Khan
"Paul McGuire" typed: > Here's a suggestion: use new-style classes. Have _BaseEntity inherit > from object, allows you to use super for invoking methods on super > classes. Instead of: > class Entity(_BaseEntity): > def __init__(self, type, x = 0, y = 0): > _BaseEntity.__i

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Larry Bates a écrit : > > def avg(l): > return float(sum(l))/len(l) > > avg([1,2,3,4]) > > 2.5 def avg(*args): return float(sum(args)) / len(args)) > > Which can actually be read and debugged in the future! in_my_arms(tm) -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Gosi a écrit : > On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >>Gosi wrote: >> >>>It is quite easy to call J from Python >> >>http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... >> >>What is J, and why should we care? >> >>Diez > > > J is in many ways s

Re: Calling J from Python

2007-02-05 Thread Bruno Desthuilliers
Gosi a écrit : > On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >>Gosi wrote: >> >>>It is quite easy to call J from Python >> >>http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... >> >>What is J, and why should we care? >> >>Diez > > > J is in many ways s

"flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread metaperl
For this program: def reverse(data): for index in range(len(data)-1, -1, -1): yield data[index] r = reverse("golf") for char in r: print char I'm wondering if the line: r = reverse("golf") "demands" the contents of the function reverse() all at once and if I must write for c

Re: get objects referencing another one

2007-02-05 Thread Bruno Desthuilliers
Olivier Feys a écrit : > I'm working on a tree and I have refcounting problems. > Is it possible from an object, to get the list of objects referencing it ? Another solution may be to use weak references: http://docs.python.org/lib/module-weakref.html HTH -- http://mail.python.org/mailman/listin

Python module question

2007-02-05 Thread Rodolfo S. Carvalho
Hi folks I have a question for this mailing list. When I'm writing a class, I can rewrite the method __getattr__() to modify the object's method/attribute access behavior. My question is: can I code a method __getattr__() to change the behavior of the 'import' command? -- Rodolfo Carvalho

RE: How can I access data from MS Access?

2007-02-05 Thread Sells, Fred
Peter, I sadly admit that I was wrong. "Doesn't seem to work" is effectivly even more useless than "doesn't work". I give up. Years ago we used to get our FORTRAN card decks back from the DP center with a piece of scrap paper saysing "She No Work". top that. -- http://mail.python.org/mailman/li

Re: Finding cpu time spent on my program

2007-02-05 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > On Feb 5, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > >> I am trying to measure the time the processor spends on some >> operation, and I want this measure to not depend on the current load >> of the machine. But doing the following prints different val

Re: Finding cpu time spent on my program

2007-02-05 Thread kyosohma
On Feb 5, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am trying to measure the time the processor spends on some > operation, and I want this measure to not depend on the current load > of the machine. But doing the following prints different values each > time a run. > > import tim

Re: Unicode formatting for Strings

2007-02-05 Thread kyosohma
On Feb 5, 11:55 am, [EMAIL PROTECTED] wrote: > Hi, > > I´m trying desperately to tell the interpreter to put an 'á' in my > string, so here is the code snippet: > > # -*- coding: utf-8 -*- > filename = u"Ataris Aquáticos #2.txt" > f = open(filename, 'w') > > Then I save it with Windows Notepad, in

Re: Calling J from Python

2007-02-05 Thread Stef Mientki
> > Mh, just looking at some "advanced" J source taken from > wikipedia.org makes me feel sick: > > | Here's a J program to calculate the average of a list of numbers: > |avg=: +/ % # > |avg 1 2 3 4 > | 2.5 > And here is the Python way of calculating the average >>> mean([1,2,3,4]) 2.5

Re: Calling J from Python

2007-02-05 Thread Bjoern Schliessmann
Alexander Schmolck wrote: > Apart from being less to type Cool. Less to type. > and it is superior in that it's > generalizes much better, e.g: > > avg&.^. NB. geomtric mean > avg&.%NB. harmonic mean > avg M NB. column mean of matrix M > avg"1 M NB. row mean of matrix M Is there

Re: Python does not play well with others

2007-02-05 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > > The GIL doesn't affect seperate processes, and any large server that > > cares about stability is going to be running a pre-forking MPM no > > matter what language they're supporting. > >Pre-forking doesn't reduce load; it just improves responsiveness

Re: Calling J from Python

2007-02-05 Thread Laurent Pointal
Diez B. Roggisch wrote: > m=: >@(0&{) > v=: >@(1&{) > h=: >@(2&{) > qu =: >@(3&{) > z=: [EMAIL PROTECTED]: > ret =: |[EMAIL PROTECTED]: > init =: z;z;z;i. > f1m =: (m,[EMAIL PROTECTED]);v;h;[EMAIL PROTECTED] > f5m =: (z;(v,{:@m);h;qu,[EMAIL PROTECTED]) @ (f1m^:5) > f1h =: (z;

Re: Python compiled on Windows

2007-02-05 Thread hg
Duncan Booth wrote: > Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > >> Hello, I'm only curious. >> >> Why is Python and most extension (also wxPython) not built using an >> open source compiler like gcc or g++ on Windows? >> >> I'm always wondering, why Microsoft is still supported >> in tha

  1   2   >