Re: Last iteration?

2007-10-16 Thread Raymond Hettinger
[Diez B. Roggisch] > > out:) But I wanted a general purpose based solution to be available that > > doesn't count on len() working on an arbitrary iterable. [Peter Otten] > You show signs of a severe case of morbus itertools. > I, too, am affected and have not yet fully recovered... Maybe you guy

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-16 Thread Paddy
> >story stargaming, I caught it first this time !-) Shouldn't that be s-o-r-r-y :-) > <*ot> -- http://mail.python.org/mailman/listinfo/python-list

Re: best way of dealing with currency?

2007-10-16 Thread Paddy
On Oct 16, 8:29 pm, Paul Miller <[EMAIL PROTECTED]> wrote: > I'm looking at doing some currency calculations in some Python code > integrated with a C++ application. I want to be able to come up with the > same values I get in an Excel spreadsheet. Ouch! do really want to come up with the Excel re

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Robert Kern
Grant Edwards wrote: > On 2007-10-16, Robert Kern <[EMAIL PROTECTED]> wrote: > >> It's not universal. Many people consider it harmful. Google "reply-to >> considered >> harmful" for a variety of opinions, for and against. >> >> I use GMane to read and post to this list because I like my lists to

Matlab axis control problem - solved

2007-10-16 Thread Dick Crepeau
I don't understand my earlier problem but the following code works no matter what the ylim is set to: I reworked the example major_minor_demo1.py to find the answer. thanks Dick C ps: I still can't post a reply since I read the list with my mozilla or konqueror browser and email separately wit

Re: Dynamic and lazy import

2007-10-16 Thread Stargaming
On Tue, 16 Oct 2007 13:16:50 +, Alexandre Badez wrote: > Hye everyone, > > I'm would like to do something a bit tricky. > > I would like when I do something like to create a __init__ package's > (here calle my_package) file witch make an action when we try to import > something in this packa

Re: while statements

2007-10-16 Thread Zentrader
O> > while cal <=0: > >#Prompt for calories > >cal = input("Please enter the number of calories in your food: ") > >if cal <=0: > >print "Error. The number of calories must be positive." > > >#Prompt for fat > >fat = input("Please enter the number of fat

Re: Problem with proxies

2007-10-16 Thread stoyan
import urllib2 proxy_support = urllib2.ProxyHandler({'http' : 'username:[EMAIL PROTECTED]:port'}) opener=urllib2.build_opener(proxy_support) urllib2.install_opener(opener) print urllib2.urlopen('http://www.python.org').read() Hi, the above works for me. The hardest part is getting the proxy handl

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread [EMAIL PROTECTED]
On Oct 16, 11:38 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-16, Robert Kern <[EMAIL PROTECTED]> wrote: > > I use GMane to read and post to this list because I like my lists to act > > like > > USENET. > > http://gmane.org > > Since "this list" is just mirroring a Usenet news group,

urlgrabber cookie handling?

2007-10-16 Thread Devraj
Hi everyone, I have been battling to make my code work with a HTTPS proxy, current my code uses urllib2 to to most things and works well, except that urllib2 doesn't handle HTTPS proxies. Urlgrabber (http://linux.duke.edu/projects/urlgrabber/help/ urlgrabber.grabber.html) looks very promising exc

Re: Dynamic and lazy import

2007-10-16 Thread Gabriel Genellina
En Tue, 16 Oct 2007 10:16:50 -0300, Alexandre Badez <[EMAIL PROTECTED]> escribió: > I would like when I do something like to create a __init__ package's > (here calle my_package) file witch make an action when we try to > import something in this package... > > Quiet like __getattribute__ work f

Re: Simple HTML template engine?

2007-10-16 Thread Jack
This one is really small and simple (one small file): http://davidbau.com/archives/2007/02/18/python_templates.html "allen.fowler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Grant Edwards
On 2007-10-16, Robert Kern <[EMAIL PROTECTED]> wrote: > It's not universal. Many people consider it harmful. Google "reply-to > considered > harmful" for a variety of opinions, for and against. > > I use GMane to read and post to this list because I like my lists to act like > USENET. > > http:

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Steve Lamb
On 2007-10-17, Byung-Hee HWANG <[EMAIL PROTECTED]> wrote: > Just click "Ctrl-L", then you can reply to lists directly if you use > good mailer like mutt or thunderbird or evolution ;; Thunderbird only if it has the list-reply patch, has either enigmail or mhengy installed and has the reply-to

Re: Yet another comparison of Python Web Frameworks

2007-10-16 Thread Massimo Di Pierro
I have posted a new version of Gluon and some slides. I am hoping to have a draft manual soon. I believe I have fixed all of the issues that have been addressed but, if not, please let me know. Massimo Did you try gluon? http://mdp.cti.depaul.edu/examples On Oct 13, 2007, at 12:17 AM, Kay Sch

A near realtime file system mirror application written in Python

2007-10-16 Thread Roc Zhou
Hello: Recently I started an open source project "cutils" on the sourceforge: https://sourceforge.net/projects/crablfs/ The document can be found at: http://crablfs.sourceforge.net/#ru_data_man This project's mirrord/fs_mirror is a near realtime file system mirroring application across 2 or more

Re: How to find imported modules

2007-10-16 Thread Gabriel Genellina
En Tue, 16 Oct 2007 17:50:06 -0300, <[EMAIL PROTECTED]> escribió: > On Oct 16, 3:46 pm, Johny <[EMAIL PROTECTED]> wrote: >> Now I need to find out which of Programs imports a particular module >> - module timesocket.py >> Is that possible without opening each program? > > It is with grep on *nix

Re: best way of dealing with currency?

2007-10-16 Thread Asun Friere
On Oct 17, 10:56 am, Mark Shroyer <[EMAIL PROTECTED]> wrote: > On 2007-10-16, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > The module decimal. But in the end, you might not be able to recreate > > the same values as excel, due to the unknown intricacies of excel. > > But it can be done! All it

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Ben Finney
"J. Cliff Dyer" <[EMAIL PROTECTED]> writes: > With thunderbird, I do "reply all," which has the ugly side effect > that the poster of the message I'm responding to gets 2 copies, > unless I remember to delete one of them. Though glacially slow (originally requested in 2000), the "reply to list" f

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Byung-Hee HWANG
On Tue, 2007-10-16 at 23:45 +0200, stef mientki wrote: > hello, > > I'm always have great difficulties, replying to this beautiful and > helpful list. > > When I hit the reply button, > the message is sent personally to the sender and not to the list. > I've subscribed to dozen's of lists, > and

Re: negative base raised to fractional exponent

2007-10-16 Thread Ken Schutte
[EMAIL PROTECTED] wrote: > Does anyone know of an approximation to raising a negative base to a > fractional exponent? For example, (-3)^-4.1 since this cannot be > computed without using imaginary numbers. Any help is appreciated. As others have said, you can use Python's complex numbers (jus

Python-URL! - weekly Python news and links (Oct 17)

2007-10-16 Thread Gabriel Genellina
QOTW: "Aaaugh! Don't use __slots__!" - Aahz "I will use public attributes (with access customizable with properties) and remember that in Python I can do everything :)." - Artur Siekielski Don't use __slots__ to create struct-like objects: http://groups.google.com/group/co

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread J. Cliff Dyer
Dick Crepeau wrote: > It seems to me the original question was how can I reply to a posted > message. > > I'm new here and see that while there are replies to several messages, > many times, like with this note, the issue is brought up as if it is new. > > I don't know how to do a reply, can some

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Ben Finney
Dick Crepeau <[EMAIL PROTECTED]> writes: > It seems to me the original question was how can I reply to a posted > message. By choosing whether you want to "reply to the author", or "reply to the list". (Every message from the mailing list automatically provides the correct infromation to make bot

why doesn't have this list a "reply-to" ?

2007-10-16 Thread Dick Crepeau
It seems to me the original question was how can I reply to a posted message. I'm new here and see that while there are replies to several messages, many times, like with this note, the issue is brought up as if it is new. I don't know how to do a reply, can someone tell me how? This note was

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Peter Decker
On 10/16/07, stef mientki <[EMAIL PROTECTED]> wrote: > I'm always have great difficulties, replying to this beautiful and > helpful list. > > When I hit the reply button, > the message is sent personally to the sender and not to the list. > I've subscribed to dozen's of lists, > and all have an "r

Re: Problem calling python modules from python apache handler

2007-10-16 Thread Graham Dumpleton
On Oct 17, 8:00 am, mannewalis <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following setup... > > Apache 2.2.3, Python 2.5 and mod_python 3.3.1 > > I have configured apache to call a python script when fetching .py > resources...so far so good... I did the hello world script in the > mod_python

Re: negative base raised to fractional exponent

2007-10-16 Thread Karthik Gurusamy
On Oct 16, 2:48 pm, [EMAIL PROTECTED] wrote: > Does anyone know of an approximation to raising a negative base to a > fractional exponent? For example, (-3)^-4.1 since this cannot be > computed without using imaginary numbers. Any help is appreciated. Use complex numbers. They are part of pyth

Matplotlib axis control problem

2007-10-16 Thread Dick Crepeau
I would like to control the y axis of a plot. The following code does exactly what I want it to! On my linux computer it sets the y axis limits to 18.0 minimum, 58.0 maximum, plots some points on y=x, provides ticks at 20,30,40,50 and horizontal tick lines that intersect the plotted points.

Re: how to convert string to number?

2007-10-16 Thread Tim Chase
> I am new to Python and find it very interesting welcome to the wonderful world of Python :) > so I decided to try to port a big project from matlab to > python. To prove the value of the python, I need to find an > python way to do it. A good exercise for learning Python. > The input file c

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Ben Finney
Robert Kern <[EMAIL PROTECTED]> writes: > It's not universal. Many people consider it harmful. Google > "reply-to considered harmful" for a variety of opinions, for and > against. The arguments in support of munging have been defeated, since 2001. Munging the "Reply-To" field is in violation of s

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Ben Finney
stef mientki <[EMAIL PROTECTED]> writes: > I'm always have great difficulties, replying to this beautiful and > helpful list. > > When I hit the reply button, > the message is sent personally to the sender and not to the list. Yes. That's what the "reply" function is for: sending a reply to the

RE: how to convert string to number?

2007-10-16 Thread wang frank
Hi, Tim, Thanks for your help. For some reason, I only get your reply from the forum. This is not a homework problem since I have left the school long time ago. I am new to Python and find it very interesting so I decided to try to port a big project from matlab to python. To prove the value

Re: ANN: magnitude 0.9.1

2007-10-16 Thread George Sakkis
On Oct 16, 7:35 am, Laurent Pointal <[EMAIL PROTECTED]> > > How does it compare to the scalar module ? > (seehttp://russp.us/scalar.htm) or the Unum module (http://home.scarlet.be/be052320/Unum.html) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-16 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : (snip) > def myreversed(sequence): > if isinstance(sequence, basestring): > return type(sequence)().join(reversed(sequence)) > else: > return type(sequence)(reversed(sequence)) > > (in fact, that's so simple I wonder why the built-in reversed() doe

Re: negative base raised to fractional exponent

2007-10-16 Thread John Machin
On Oct 17, 8:03 am, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Does anyone know of an approximation to raising a negative base to a > > fractional exponent? For example, (-3)^-4.1 since this cannot be > > computed without using imaginary numbers. Any help is apprecia

Re: negative base raised to fractional exponent

2007-10-16 Thread Robert Kern
Steve Holden wrote: > [EMAIL PROTECTED] wrote: >> Does anyone know of an approximation to raising a negative base to a >> fractional exponent? For example, (-3)^-4.1 since this cannot be >> computed without using imaginary numbers. Any help is appreciated. >> > A couple of questions. > > 1. Ho

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-16 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : > answering to Dmitri O.Kondratiev (snip) > > def reverse(xs): > if xs: > return xs > else: > return (reverse (xs[1:])) + [xs[0]] I meant: def reverse(xs): if not xs: (etc...) of course... -- http://mail.python.org/mailman/listinfo/python-list

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Robert Kern
stef mientki wrote: > hello, > > I'm always have great difficulties, replying to this beautiful and > helpful list. > > When I hit the reply button, > the message is sent personally to the sender and not to the list. > I've subscribed to dozen's of lists, > and all have an "reply-to" address, th

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-16 Thread Bruno Desthuilliers
answering to Dmitri O.Kondratiev > On Sunday 14 October 2007 5:06:19 pm Dmitri O.Kondratiev wrote: > >>The function I wrote (below) reverses lists all right: >> >>def reverse(xs): >>if xs == []: >>return [] >>else: >>return (reverse (xs[1:])) + [xs[0]] >> >reverse ([1,2

Problem calling python modules from python apache handler

2007-10-16 Thread mannewalis
Hi, I have the following setup... Apache 2.2.3, Python 2.5 and mod_python 3.3.1 I have configured apache to call a python script when fetching .py resources...so far so good... I did the hello world script in the mod_python docs and it works great. Now when I want to add some meat and potatoes

Re: negative base raised to fractional exponent

2007-10-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Does anyone know of an approximation to raising a negative base to a > fractional exponent? For example, (-3)^-4.1 since this cannot be > computed without using imaginary numbers. Any help is appreciated. > A couple of questions. 1. How do you approximate a complex

negative base raised to fractional exponent

2007-10-16 Thread schaefer . mp
Does anyone know of an approximation to raising a negative base to a fractional exponent? For example, (-3)^-4.1 since this cannot be computed without using imaginary numbers. Any help is appreciated. -- http://mail.python.org/mailman/listinfo/python-list

why doesn't have this list a "reply-to" ?

2007-10-16 Thread stef mientki
hello, I'm always have great difficulties, replying to this beautiful and helpful list. When I hit the reply button, the message is sent personally to the sender and not to the list. I've subscribed to dozen's of lists, and all have an "reply-to" address, that points to list and not to the indi

Re: how to get my own namespace ?

2007-10-16 Thread stef mientki
Robert Kern wrote: > stef mientki wrote: > >> I want to view my own namespace, >> i.e. to see the modules namespace in the module itself, >> is that possible ? >> >> I can use >>dir() >> but I read dir is just a convenience function, >> and besides I want key/value pairs. >> > > vars()

RE: how to convert string to number?

2007-10-16 Thread wang frank
It seems that I have problem with the python-list, so I resend this. Thanks Frank From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: how to convert string to number?Date: Tue, 16 Oct 2007 18:15:06 + Hi, I have struggling to efficiently convert a string list to number. Here is my problem. I

Re: Last iteration?

2007-10-16 Thread Bruno Desthuilliers
Paul Hankin a écrit : > On Oct 12, 11:58 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > >>Hello, >>can I determine somehow if the iteration on a list of values is the last >>iteration? >> >>Example: >> >>for i in [1, 2, 3]: >> if last_iteration: >> print i*i >> else: >> print i >

Embedding Python in a multithreaded managed C++ application

2007-10-16 Thread jens . hester
Hi experts, I am currently embedding the Python interpreter 2.3.4 in a managed C++ application (I currently use an unmanaged dll which is linked to Python23.lib). Forget about Ironpython - no binary compatibility for extension modules, forget about a decent C API, by the way... After a lot of work

Re: ctypes & Wrapping Complex Datatypes

2007-10-16 Thread gamename
On Oct 16, 6:52 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 16 Oct 2007 06:47:06 -0700, gamename wrote: > > I've just started using ctypes and so far, its great. But I'm running > > to some problems with complex datatypes. I'm not sure how to wrap > > something like this: >

ctypes & Wrapping Complex Datatypes

2007-10-16 Thread gamename
Hi, I've just started using ctypes and so far, its great. But I'm running to some problems with complex datatypes. I'm not sure how to wrap something like this: /* This defines the Handle type in a header file. I don't think this needs wrapping, its just to show the handle definition for co

Re: how to get my own namespace ?

2007-10-16 Thread kyosohma
On Oct 16, 3:43 pm, stef mientki <[EMAIL PROTECTED]> wrote: > I want to view my own namespace, > i.e. to see the modules namespace in the module itself, > is that possible ? > > I can use >dir() > but I read dir is just a convenience function, > and besides I want key/value pairs. > > thanks, >

Re: How to find imported modules

2007-10-16 Thread kyosohma
On Oct 16, 3:46 pm, Johny <[EMAIL PROTECTED]> wrote: > My Main program imports several other smaller programs. > for example > Main.py > imports > Program1.py > Program2.py > ... > Program50.py > > Now I need to find out which of Programs imports a particular module > - module timesocket.py > Is t

Re: how to get my own namespace ?

2007-10-16 Thread Robert Kern
stef mientki wrote: > I want to view my own namespace, > i.e. to see the modules namespace in the module itself, > is that possible ? > > I can use >dir() > but I read dir is just a convenience function, > and besides I want key/value pairs. vars() will give you a dictionary copy of the local

How to find imported modules

2007-10-16 Thread Johny
My Main program imports several other smaller programs. for example Main.py imports Program1.py Program2.py ... Program50.py Now I need to find out which of Programs imports a particular module - module timesocket.py Is that possible without opening each program? Thanks B. -- http://mail.python

how to get my own namespace ?

2007-10-16 Thread stef mientki
I want to view my own namespace, i.e. to see the modules namespace in the module itself, is that possible ? I can use dir() but I read dir is just a convenience function, and besides I want key/value pairs. thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a timeout for a cookie

2007-10-16 Thread John J. Lee
Peter Bengtsson <[EMAIL PROTECTED]> writes: > On Oct 15, 4:09 pm, sophie_newbie <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm wondering how do you set a 'timeout' or expiry date/time for a >> cookie set using a python cgi script. I can set a cookie ok but I >> dunno how to set the expiry time so it

Capturing OutputDebugString information in python

2007-10-16 Thread danbrotherston
Hello, I am trying to get the output from the win32 platform command OutputDebugString. I have used the following C++ code as a guideline: http://groups.google.com/group/microsoft.public.vc.utilities/browse_frm/thread/1434418cb968d053/1a3c957675242c7e?lnk=st&q=DBWIN_BUFFER&rnum=3#1a3c957675242c7

Re: updmap question

2007-10-16 Thread thermate2
The think that got you such a fast help from the anglo is that you are a corporatist bastard from sas.com On Oct 16, 12:59 pm, Tim Arnold <[EMAIL PROTECTED]> wrote: > On Oct 16, 3:53 pm, [EMAIL PROTECTED] (Robin Fairbairns) wrote: > > > > > "Tim Arnold" <[EMAIL PROTECTED]> writes: > > > >I know

Re: numpy : efficient sum computations

2007-10-16 Thread Robert Kern
TG wrote: > Okay, another one which I don't have answer for. > > it is the reverse case, sort of : > >> phi.shape (x,y) >> d.shape (a,b) > > I want to return m : >> m.shape = (x,y,a,b) > with > m[x,y] = d * phi[x,y] > > currently, my code is : >> m = empty(phi.shape + d.shape) >> m[:,:] = d >

Re: Simple HTML template engine?

2007-10-16 Thread jean-michel bain-cornu
> These days there seems to be more coverage of different needs. For > instance, Mako looks like something I might have used if it had been > around back then. > It's probably the same to me. And many times, the simple python templating system %(var)s is good enough... -- http://mail.python.org

Re: groupby() seems slow

2007-10-16 Thread Raymond Hettinger
On Oct 15, 8:02 pm, 7stud <[EMAIL PROTECTED]> wrote: > t = timeit.Timer("test3()", "from __main__ import test3, key, data") > print t.timeit() > t = timeit.Timer("test1()", "from __main__ import test1, data") > print t.timeit() > > --output:--- > 42.791079998 > 19.0128788948 > > I thought groupby()

Re: best way of dealing with currency?

2007-10-16 Thread Diez B. Roggisch
Paul Miller schrieb: > I'm looking at doing some currency calculations in some Python code > integrated with a C++ application. I want to be able to come up with the > same values I get in an Excel spreadsheet. > > I've been poking around for a couple of days and haven't come across a > definit

Re: best way of dealing with currency?

2007-10-16 Thread Grant Edwards
Just send the currency to me. I'll deal with it. -- Grant Edwards grante Yow! I'm into SOFTWARE! at visi.com -- http://mail.python.org/mailman/listinfo/python-list

best way of dealing with currency?

2007-10-16 Thread Paul Miller
I'm looking at doing some currency calculations in some Python code integrated with a C++ application. I want to be able to come up with the same values I get in an Excel spreadsheet. I've been poking around for a couple of days and haven't come across a definitive method for dealing with curre

Re: some questions about Python and tkinter

2007-10-16 Thread Marc 'BlackJack' Rintsch
On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote: > the first: what is the differences between a function and a classe? A class bundles data and functions into one object. > In which case i should use a function ? > In which case i should use a class ? If you have several functions that operate

Re: Good Book

2007-10-16 Thread kyosohma
On Oct 16, 3:00 am, Lars Johansen <[EMAIL PROTECTED]> wrote: > HI are there any recommended books for an sysadmin who has been mostly > writing shell scripts, but want to move up to create more complex > programs. See also http://www.ibm.com/developerworks/aix/library/au-python/ http://www.samag.

Re: some questions about Python and tkinter

2007-10-16 Thread kyosohma
On Oct 16, 1:52 pm, fabdeb <[EMAIL PROTECTED]> wrote: > Hi every one, > I m a sysadmin who want to know how to use python. > I dont know anything about oriented object programation, i only know > bash and a little perl. > I have some simple questions about python. > > the first: what is the differe

Re: Simple HTML template engine?

2007-10-16 Thread Bruno Desthuilliers
Adrian Cherry a écrit : > "allen.fowler" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>Hello, >> >>Can anyone recommend a simple python template engine for >>generating HTML that relies only on the Pyhon Core modules? >> >>No need for caching, template compilation, etc. >> >>Speed

Re: some questions about Python and tkinter

2007-10-16 Thread Bruno Desthuilliers
fabdeb a écrit : > Hi every one, > I m a sysadmin who want to know how to use python. > I dont know anything about oriented object programation, i only know > bash and a little perl. > I have some simple questions about python. > > the first: what is the differences between a function and a classe

Re: while statements

2007-10-16 Thread martyw
Shawn Minisall wrote: > I just learned about while statements and get why you place them around > inputs for validation, but I'm a little lost on exactly where to place > it with what condition in this program where the number of fat grams > exceeds the total number of calories so that it loops

Re: Build Python 2.5 against Tk 8.5

2007-10-16 Thread Kevin Walzer
Martin v. Löwis wrote: > > Can you please clarify what you mean by "stock Python installation"? > I just built Python 2.5.1 with Tk 8.5 on Debian unstable, and it works > fine. OK, that's good to know. I'm using the precompiled Mac OS X build of 2.5.1 from python.org. > > It's still not clear.

Re: Getting error message/trace over the C API

2007-10-16 Thread Duncan Booth
Sami Vaisanen <[EMAIL PROTECTED]> wrote: > Hello group, > > I'm writing a C++ based application that embeds the python engine. Now I > have a problem regarding exception/error information. Is there a way to > get the exception message and possibly the traceback into a string for > example? I've

Re: numpy : efficient sum computations

2007-10-16 Thread Robert Kern
TG wrote: > Hi there. > > I want to do some intensive computations with numpy, and I'm > struggling a bit to find my wayy. The best place to ask numpy questions is on the numpy mailing list. http://www.scipy.org/Mailing_Lists > Here is the problem : > > m and d are two matrices : >

some questions about Python and tkinter

2007-10-16 Thread fabdeb
Hi every one, I m a sysadmin who want to know how to use python. I dont know anything about oriented object programation, i only know bash and a little perl. I have some simple questions about python. the first: what is the differences between a function and a classe? In which case i should use a

Re: Trying to Send Repeated Messages to a Server Using sockets

2007-10-16 Thread Bruno Desthuilliers
danfolkes a écrit : > Hey Everyone, I am trying to send repeated messages from a "Node" to a > "Server". It works the first time I send the from the Node to Server, > but after that it either errors, or does not do anything. > > I would love some help, here is the code: Posting the trackbacks m

Re: how to convert string to number?

2007-10-16 Thread Tim Chase
> I have struggling to efficiently convert a string list to > number. Here is my problem. I have a file that contains lines > such as: > > data_1 1 1 2 3.5 > > After I read the data from the file by using readlines(), each > line contains a string. I use the re moduel to split the line > into ['d

Re: Build Python 2.5 against Tk 8.5

2007-10-16 Thread Martin v. Löwis
> It's been a while, but when I've tried to run my Tkinter app against Tk > 8.5 with a stock Python installation, I get an error message saying that > Tk 8.4.x is required. Can you please clarify what you mean by "stock Python installation"? I just built Python 2.5.1 with Tk 8.5 on Debian unstabl

RE: re.sub

2007-10-16 Thread DiPierro, Massimo
Thank you this answers my question. I wanted to make sure it was actually designed this way. Massimo From: Tim Chase [EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 1:38 PM To: DiPierro, Massimo Cc: python-list@python.org; Berthiaume, Andre Subject: Re:

Re: Getting error message/trace over the C API

2007-10-16 Thread Thomas Heller
Sami Vaisanen schrieb: > Hello group, > > I'm writing a C++ based application that embeds the python engine. Now I > have a problem regarding exception/error information. Is there a way to > get the exception message and possibly the traceback into a string for > example? I've been eyeballing the

Re: re.sub

2007-10-16 Thread Tim Chase
> Let me show you a very bad consequence of this... > > a=open('file1.txt','rb').read() > b=re.sub('x',a,'x') > open('file2.txt','wb').write(b) > > Now if file1.txt contains a \n or \" then file2.txt is not the > same as file1.txt while it should be. That's functioning as designed. If you want

Re: re.sub

2007-10-16 Thread Tim Chase
> Even stranger > > >>> re.sub('a', '\\n','bab') > 'b\nb' > >>> print re.sub('a', '\\n','bab') > b > b That's to be expected. When not using a print statement, the raw evaluation prints the representation of the object. In this case, the representation is 'b\nb'. When you use the print st

Re: Build Python 2.5 against Tk 8.5

2007-10-16 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote: > >> I'd like to experiment with Tk 8.5 (now in beta) in my Python > >> application, but Python 2.5 requires Tk 8.4.x. > > > > Why do you say that? AFAIK, that's not the case. > > It's been a while,

RE: re.sub

2007-10-16 Thread DiPierro, Massimo
Let me show you a very bad consequence of this... a=open('file1.txt','rb').read() b=re.sub('x',a,'x') open('file2.txt','wb').write(b) Now if file1.txt contains a \n or \" then file2.txt is not the same as file1.txt while it should be. Massimo From: Tim C

RE: re.sub

2007-10-16 Thread DiPierro, Massimo
It is the fisrt line that is wrong, the second follows from the first, I agree. From: Tim Chase [EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 1:20 PM To: DiPierro, Massimo Cc: python-list@python.org; Berthiaume, Andre Subject: Re: re.sub > Even strange

how to convert string to number?

2007-10-16 Thread wang frank
Hi, I have struggling to efficiently convert a string list to number. Here is my problem. I have a file that contains lines such as: data_1 1 1 2 3.5 After I read the data from the file by using readlines(), each line contains a string. I use the re moduel to split the line into ['data_1',

RE: re.sub

2007-10-16 Thread DiPierro, Massimo
That is not the problem. The problem is that re.sub('a','\\n','bab') cannot be the same as re.sub('a','\n','bab') This is evaluating the string to be substituted before the substitution. Massimo From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Ch

Re: Good Book

2007-10-16 Thread borroff
On Oct 16, 4:00 am, Lars Johansen <[EMAIL PROTECTED]> wrote: > HI are there any recommended books for an sysadmin who has been mostly > writing shell scripts, but want to move up to create more complex > programs. I believe there's a "Python for System Administration" book in the works, an equival

Re: re.sub

2007-10-16 Thread Chris Mellon
On 10/16/07, Massimo Di Pierro <[EMAIL PROTECTED]> wrote: > Even stranger > > >>> re.sub('a', '\\n','bab') > 'b\nb' > >>> print re.sub('a', '\\n','bab') > b > b > You called print, so instead of getting an escaped string literal, the string is being printed to your terminal, which is printing th

Re: re.sub

2007-10-16 Thread Massimo Di Pierro
Even stranger >>> re.sub('a', '\\n','bab') 'b\nb' >>> print re.sub('a', '\\n','bab') b b Massimo On Oct 16, 2007, at 1:54 AM, DiPierro, Massimo wrote: > Shouldn't this > print re.sub('a','\\n','bab') > b > b > > output > > b\nb > > instead? > > Massimo > > On Oct 16, 2007, at 1:34 AM, G

Re: documentation for tk.call interface

2007-10-16 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > I'm using Python + Tkinter for a small gui . . . there are LOTS of > places inside Tkinter with code like this: > > self.tk.call('tkwait', 'variable', name) > > (this particular one is from the IntVar class). > > I've searched the Tkinter docs with no success;

Re: Problem with proxies

2007-10-16 Thread coolman_suk
i have never used proxies, in college it works fine dont know abt ur wipro settings. anyway try this http://docs.python.org/lib/urllib2-examples.html then l8tr try this http://docs.python.org/lib/module-urllib2.html -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL and getpixel()

2007-10-16 Thread [EMAIL PROTECTED]
> Just pack the RGB values into an `int` by shifting and or-ing. Untested: > > red, green, blue = img.getpixel(x, y) > pixel_as_int = red << 16 | green << 8 | blue > > Ciao, > Marc 'BlackJack' Rintsch thanx Marc will try that dn -- http://mail.python.org/mailman/listinfo/python-list

Re: Good Book

2007-10-16 Thread kyosohma
On Oct 16, 3:00 am, Lars Johansen <[EMAIL PROTECTED]> wrote: > HI are there any recommended books for an sysadmin who has been mostly > writing shell scripts, but want to move up to create more complex > programs. The Python Cookbook would probably be another good resource. While I don't like the

Re: Why does the message send only once?

2007-10-16 Thread Bruno Desthuilliers
danfolkes a écrit : You already posted the same question here one hour and a half ago. Please avoid. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt ProgressBar

2007-10-16 Thread David Boddie
On Mon Oct 15 14:24:09 CEST 2007, luca72 wrote: > Hello i have made anly one test like this: > > from time import sleep > barra = QtGui.QProgressBar() > barra.setMinimum(0) > barra.setMaximum(10) > for a in range(10): >sleep(1) >barra.setValue(a) >app.processEvents()

documentation for tk.call interface

2007-10-16 Thread dbr517
I'm using Python + Tkinter for a small gui . . . there are LOTS of places inside Tkinter with code like this: self.tk.call('tkwait', 'variable', name) (this particular one is from the IntVar class). I've searched the Tkinter docs with no success; can someone point me at the documentation

Re: Why does the message send only once?

2007-10-16 Thread Marc 'BlackJack' Rintsch
On Tue, 16 Oct 2007 15:55:31 +, danfolkes wrote: > Why does the message send only once? > > The node sends once, then fails after that. Because the `Server` just seems to handle the first connection and is done then. Insert some ``print``\s to see what's going on. Ciao, Marc 'Black

Re: Why does the message send only once?

2007-10-16 Thread Bjoern Schliessmann
danfolkes wrote: > Why does the message send only once? Because your server is designed to only accept one connection, wait forever except there is an exception, and quit thereafter. > def Server(address): > [...] > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.bind((HOST

Getting error message/trace over the C API

2007-10-16 Thread Sami Vaisanen
Hello group, I'm writing a C++ based application that embeds the python engine. Now I have a problem regarding exception/error information. Is there a way to get the exception message and possibly the traceback into a string for example? I've been eyeballing the PyErr_ module and it seems fairly

Re: Normalize a polish L

2007-10-16 Thread Roberto Bonvallet
On Oct 15, 6:57 pm, John Machin <[EMAIL PROTECTED]> wrote: > To "asciify" such text, you need to build a look-up table that suits > your purpose. unicodedata.decomposition() is (accidentally) useful in > providing *some* of the entries for such a table. This is the only approach that can actually

  1   2   >