Re: fast regex

2010-05-11 Thread Paul Rubin
Lawrence D'Oliveiro writes: > “Fast regex” is a contradiction in terms. You use regexes when you want ease > of definition and application, not speed. > > For speed, consider hand-coding your own state machine. Preferably in a > compiled language like C. But, nothing stops a regexp library from

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread Werner F. Bruhin
Martin, Thanks for the quick reply. On 10/05/2010 22:25, Martin v. Loewis wrote: Werner F. Bruhin wrote: Just upgraded on my Windows 7 machine my copy of 2.6.4 to 2.6.5. However doing sys.version still shows 2.6.4 even so python.exe is dated 19. March 2010 with a size of 26.624 bytes. Is

Iterating a sequence two items at a time

2010-05-11 Thread Ulrich Eckhardt
Hi! I have a list [1,2,3,4,5,6] which I'd like to iterate as (1,2), (3,4), (5,6). I can of course roll my own, but I was wondering if there was already some existing library function that already does this. def as_pairs(seq): i = iter(seq) yield (i.next(), i.next()) Question to this cod

Re: Is Python a functional programming language?

2010-05-11 Thread Paul Rubin
Luis M. González writes: > That doesn't mean python can compete with other purely functional > languages, but it's probably as functional as it can be for a more > conventional, multiparadigm language. Ben Lippmeier made the interesting claim that one of the defining characteristics of functional

Re: Iterating a sequence two items at a time

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 12:09 AM, Ulrich Eckhardt wrote: > Hi! > > I have a list [1,2,3,4,5,6] which I'd like to iterate as (1,2), (3,4), > (5,6). I can of course roll my own, but I was wondering if there was > already some existing library function that already does this. When a problem involves

Re: HTTP Post Request

2010-05-11 Thread kak...@gmail.com
On May 11, 5:06 am, Kushal Kumaran wrote: > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > > On May 10, 10:22 am, Kushal Kumaran > > wrote: > >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com wrote: > >> > Hi to all, i want to ask you a question, concerning the best way to do > >

Re: Iterating a sequence two items at a time

2010-05-11 Thread Bruno Desthuilliers
Ulrich Eckhardt a écrit : Hi! I have a list [1,2,3,4,5,6] which I'd like to iterate as (1,2), (3,4), (5,6). I can of course roll my own, but I was wondering if there was already some existing library function that already does this. >>> l = range(10) >>> for x, y in zip(l[::2], l[1::2]): ...

inherit from data type

2010-05-11 Thread Richard Lamboj
Hello, i want to inherit from a data type. How can i do this? Can anyone explain more abou this? How knows python that it is a float, or a string? Kind Regards Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: fast regex

2010-05-11 Thread Bryan
Lawrence D'Oliveiro wrote: > “Fast regex” is a contradiction in terms. You use > regexes when you want ease of definition and > application, not speed. Python or Perl regex's are not actually regular expressions. Real regular expression compilers produce blazing fast results, but they cannot suppo

Re: Iterating a sequence two items at a time

2010-05-11 Thread Ulrich Eckhardt
Ulrich Eckhardt wrote: > I have a list [1,2,3,4,5,6] which I'd like to iterate as (1,2), (3,4), > (5,6). I can of course roll my own, but I was wondering if there was > already some existing library function that already does this. > > > def as_pairs(seq): > i = iter(seq) > yield (i.next(

Re: inherit from data type

2010-05-11 Thread Ulrich Eckhardt
Richard Lamboj wrote: > i want to inherit from a data type. How can i do this? Can anyone explain > more abou this? Other than in e.g. C++ where int and float are special types, you can inherit from them in Python like from any other type. The only speciality of int, float and string is that they

Re: inherit from data type

2010-05-11 Thread James Mills
On Tue, May 11, 2010 at 6:38 PM, Richard Lamboj wrote: > i want to inherit from a data type. How can i do this? Can anyone explain more > abou this? How knows python that it is a float, or a string? $ python Python 2.6.5 (r265:79063, Apr 27 2010, 18:26:49) [GCC 4.4.1 (CRUX)] on linux2 Type "help"

Re: inherit from data type

2010-05-11 Thread Bruno Desthuilliers
Richard Lamboj a écrit : Hello, i want to inherit from a data type. How can i do this? Hmmm, let's see... Could it be possible that it's documented somewhere ? Like, in the FineManual(tm) ?-) http://docs.python.org/tutorial/classes.html#inheritance Can anyone explain more abou this? How k

How to eliminate "Debug: src/helpers.cpp(140): 'CreateActCtx' failed" message ?

2010-05-11 Thread Barak, Ron
Hi, I created my first py2exe windows exe, and when it's run, I see on the console: $ ./svm_ts_tool_in_progress.exe 11:49:32: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x007b (the filename, directory name, or volume label syntax is incorrect.). This is a non-fatal error

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 10:47:35 schrieb Ulrich Eckhardt: > Richard Lamboj wrote: > > i want to inherit from a data type. How can i do this? Can anyone explain > > more abou this? > > Other than in e.g. C++ where int and float are special types, you can > inherit from them in Python like from any o

How to make this doctest work?

2010-05-11 Thread
Hello I ran across this accidentally and wonders how to make the doctest in following code snippet work: import doctest def a(): """ >>> a = '\\r\\n' >>> print a No matter how many blank lines I add here, it just can't get enough -_- """ pass doctest.testmod() ps:

Re: inherit from data type

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 2:18 AM, Richard Lamboj wrote: > What i also want to know: variable1 = 10.50 type(variable1) > > > Is there a way to tell python that it use antoher class than float for float, > like myfloat? Its just a "tell-me-what-is-possible". > > Sample: variable1 = 1

Dynamically compiling and reloading SWIG .pyd file

2010-05-11 Thread Dave Guthrie
I am creating an application which has it's code split between python and C. The Python is used to provide a high level GUI interface and the C is for low level functions. I use SWIG to create Python Bindings for the C functions. I want to implement a feature where there is a button in the toolbar

Re: inherit from data type

2010-05-11 Thread Ulrich Eckhardt
Richard Lamboj wrote: > "How knows python that it is a float, or a string?" Sorry this was bad > expressed. I want to create a new data type, which inherits from float. I > just know the "dir" function and the "help" function to get more > infromations about the class, but i need to get more inform

Re: Picking a license

2010-05-11 Thread Paul Boddie
On 10 Mai, 17:01, Patrick Maupin wrote: > > I'll be charitable and assume the fact that you can make that > statement without apparent guile merely means that you haven't read > the post I was referring to: > > http://www.gnu.org/philosophy/why-not-lgpl.html Of course I have read it, and not just

Re: HTTP Post Request

2010-05-11 Thread kak...@gmail.com
On May 11, 10:56 am, "kak...@gmail.com" wrote: > On May 11, 5:06 am, Kushal Kumaran > wrote: > > > > > On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > > > On May 10, 10:22 am, Kushal Kumaran > > > wrote: > > >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com > > >> wrote: > > >>

Re: Picking a license

2010-05-11 Thread Paul Boddie
On 10 Mai, 20:36, Patrick Maupin wrote: > > I've addressed this before.  Aahz used a word in an accurate, but to > you, inflammatory, sense, but it's still accurate -- the man *would* > force you to pay for the chocolate if you took it. Yes, *if* you took it. He isn't forcing you to take it, thou

Re: lame sphinx questions [Was: lame epydoc questions]

2010-05-11 Thread Jean-Michel Pichavant
Phlip wrote: On May 10, 1:51 pm, Phlip wrote: On May 10, 1:39 pm, Chris Rebert wrote: Sphinx is in vogue right now:http://sphinx.pocoo.org/ Okay, we have ten thousand classes to document. How to add them all to index.rst? I remember trying using Sphinx for auto documented

win32com sql update problem

2010-05-11 Thread Mark Carter
Consider the following snippet of code: import win32com.client DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=M:\\Finance\\camel\ \camel.mdb;' conn.Open(DSN) cursor = conn.Execute("UPDATE tblInvoice SET InvComments='Python' WHERE InvBillingPeriod = 'April 2010' AND InvJobCode = '2169'") rows

Re: Is Python a functional programming language?

2010-05-11 Thread Lawrence D'Oliveiro
In message <7xvdavd4bq@ruckus.brouhaha.com>, Paul Rubin wrote: > Python is a pragmatic language from an imperative tradition ... I thought the opposite of “functional” was “procedural”, not “imperative”. The opposite to the latter is “declarative”. But (nearly) all procedural languages also

Re: Is Python a functional programming language?

2010-05-11 Thread Lawrence D'Oliveiro
In message , Stefan Behnel wrote: > But the beauty is that Python is multi-paradigm ... The trouble with “multi-paradigm” is that it offends the zealots on all sides. It’s like saying that, to effect a compromise among multiple conflicting monotheistic religions, we should create a polytheisti

Re: Picking a license

2010-05-11 Thread Steven D'Aprano
On Tue, 11 May 2010 03:34:49 -0700, Paul Boddie wrote: > It's like saying that the shopkeeper is some kind of Darth Vader > character who is coercing people to take the chocolate Last time I came home with chocolate, I tried that excuse on my wife. She didn't believe it for a second. Next time,

Re: Is Python a functional programming language?

2010-05-11 Thread Stefan Behnel
Lawrence D'Oliveiro, 11.05.2010 13:13: Stefan Behnel wrote: But the beauty is that Python is multi-paradigm ... The trouble with “multi-paradigm” is that it offends the zealots on all sides. It’s like saying that, to effect a compromise among multiple conflicting monotheistic religions, we sh

unittest basics

2010-05-11 Thread John Maclean
is there a way to test that a certian library or module is or can be loaded successfully? self.assert('import blah') -- John Maclean MSc. (DIC) BSc. (Hons) Linux Systems and Applications 07739 171 531 -- http://mail.python.org/mailman/listinfo/python-list

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 11:38:42 schrieb Ulrich Eckhardt: > Richard Lamboj wrote: > > "How knows python that it is a float, or a string?" Sorry this was bad > > expressed. I want to create a new data type, which inherits from float. I > > just know the "dir" function and the "help" function to get

Re: unittest basics

2010-05-11 Thread Giampaolo Rodolà
There's no reason for such a thing. You can just make "import module" in your test and if something goes wrong that will be treated as any other test failure. --- Giampaolo http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil 2010/5/11 John Maclean : > is there a way to test that a

how to import a module for global use in a library package ?

2010-05-11 Thread Auré Gourrier
Dear all, I am building a library package of the form: rootlib ---__init__ ---subpackage1 --__init__ --sub1module1 --sub1module2 --... ---subpackage2 -- __init__ --sub2module1 --sub2module2 --... My rootlib.__init__ file contains: __name__= ... __version_

Re: how to import a module for global use in a library package ?

2010-05-11 Thread Jean-Michel Pichavant
Auré Gourrier wrote: [snip] My question is the following: I need to import an external package, say numpy, for use in various submodules. So far, I simply do an import numpy as _numpy where needed, say sub1module1 and sub2module2. This means that I import this package a number of times which d

Re: virtualenvwrapper for Windows (Powershell)

2010-05-11 Thread Guillermo
On May 11, 7:43 am, Lawrence D'Oliveiro wrote: > In message > <22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com>, > > Guillermo wrote: > > If you've ever missed it on Windows and you can use Powershell ... > > I thought the whole point of Windows was to get away from this command-

Re: unittest basics

2010-05-11 Thread Chris Withers
import unittest class MyTestCase(unittest.TestCase): def test_my_import(self): import blah cheers, Chris John Maclean wrote: is there a way to test that a certian library or module is or can be loaded successfully? self.assert('import blah') -- Simplistix - Content Management, Bat

Re: How to measure speed improvements across revisions over time?

2010-05-11 Thread exarkun
On 08:13 pm, m...@tplus1.com wrote: I know how to use timeit and/or profile to measure the current run-time cost of some code. I want to record the time used by some original implementation, then after I rewrite it, I want to find out if I made stuff faster or slower, and by how much. Other t

Re: virtualenvwrapper for Windows (Powershell)

2010-05-11 Thread David Robinow
On Tue, May 11, 2010 at 1:43 AM, Lawrence D'Oliveiro wrote: > In message > <22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com>, > Guillermo wrote: >> If you've ever missed it on Windows and you can use Powershell ... > I thought the whole point of Windows was to get away from this

reading xml from python

2010-05-11 Thread Hvidberg, Martin
I'm looking for at way to read (and later write) small simple .xml file from Python. e.g. I would like to read the following from a small ini.xml file into a dictionary. default False False UBMlight True I would prefer a relative simple (not too much creating new classes) way to do thi

Re: Picking a license

2010-05-11 Thread Lie Ryan
On 05/11/10 20:24, Paul Boddie wrote: > On 10 Mai, 17:01, Patrick Maupin wrote: >> >> I'll be charitable and assume the fact that you can make that >> statement without apparent guile merely means that you haven't read >> the post I was referring to: >> >> http://www.gnu.org/philosophy/why-not-lgp

Re: reading xml from python

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 5:54 AM, Hvidberg, Martin wrote: > I'm looking for at way to read (and later write) small simple .xml file from > Python. > > e.g. I would like to read the following from a small ini.xml file into a > dictionary. > > > > >  default >  False >  False >  UBMlight >  True >

Re: reading xml from python

2010-05-11 Thread Philip Semanchuk
On May 11, 2010, at 8:54 AM, Hvidberg, Martin wrote: I'm looking for at way to read (and later write) small simple .xml file from Python. e.g. I would like to read the following from a small ini.xml file into a dictionary. default False False UBMlight True I would prefer a relative si

urllib.urlopen blocking?

2010-05-11 Thread Dominik Gabi
Hi, I'm new to python and have been playing around with it for a few days now. So please forgive me if this is a stupid question :) I've tried writing a little application with pygtk and urllib. When a button is clicked I create a new thread that opens an URL with urllib. The new thread is runnin

Re: lame sphinx questions [Was: lame epydoc questions]

2010-05-11 Thread Phlip
On May 11, 3:54 am, Jean-Michel Pichavant wrote: > I remember trying using Sphinx for auto documented APIs, but it was not > suitable at that time. You can include API docs generated from the code, > but you still need to write the docs around. > If I'm correct,  Sphinx is one of the best tool to

Re: urllib.urlopen blocking?

2010-05-11 Thread Antoine Pitrou
On Tue, 11 May 2010 06:22:29 -0700 (PDT) Dominik Gabi wrote: > > I'm new to python and have been playing around with it for a few days > now. So please forgive me if this is a stupid question :) > > I've tried writing a little application with pygtk and urllib. For the record, have you tried ca

Re: Extract all words that begin with x

2010-05-11 Thread Aahz
In article , Terry Reedy wrote: >On 5/10/2010 5:35 AM, James Mills wrote: >> On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: >>> Have I missed something, or wouldn't this work just as well: >>> >> list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas'] >> [word for word in list_o

Re: lame sphinx questions [Was: lame epydoc questions]

2010-05-11 Thread Jean-Michel Pichavant
Phlip wrote: On May 11, 3:54 am, Jean-Michel Pichavant wrote: I remember trying using Sphinx for auto documented APIs, but it was not suitable at that time. You can include API docs generated from the code, but you still need to write the docs around. If I'm correct, Sphinx is one of the b

Re: Picking a license

2010-05-11 Thread Paul Boddie
On 11 Mai, 15:00, Lie Ryan wrote: > > Come on, 99%  of the projects released under GPL did so because they > don't want to learn much about the law; they just need to release it > under a certain license so their users have some legal certainty. Yes, this is frequently the case. And the GPL does

Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Terry, > ... word[0:1] does the same thing. All Python programmers should learn to > use slicing to extract a char from a string that might be empty. Is there an equivalent way to slice the last char from a string (similar to an .endswith) that doesn't raise an exception when a string is empty?

Re: urllib.urlopen blocking?

2010-05-11 Thread Dominik Gabi
> For the record, have you tried calling gobject.threads_init() at the > beginning of your application (just after importing all modules)? I haven't... now it works, thanks :) Any tips on how to avoid mistakes like that in the future? I'm somewhat confused as to how I was supposed to get this out

Re: Is Python a functional programming language?

2010-05-11 Thread Paul Rubin
Lawrence D'Oliveiro writes: > I thought the opposite of “functional” was “procedural”, not “imperative”. > The opposite to the latter is “declarative”. But (nearly) all procedural > languages also have declarative constructs, not just imperative ones > (certainly Python does). Presumably an “im

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Thanks again, Stefan. My comments are below. Stefan Behnel wrote: j vickroy, 10.05.2010 17:39: Unfortunately, when "Hudson Build now" is performed, the Hudson Console output, for this job, is: Started by user anonymous Updating svn:

Re: Is Python a functional programming language?

2010-05-11 Thread Michele Simionato
On May 10, 8:18 pm, a...@pythoncraft.com (Aahz) wrote: > saying that functional features > are "tacked on" understates the case.  Consider how frequently people > reach for list comps and gen exps.  Function dispatch through dicts is > the standard replacement for a switch statement.  Lambda callba

Re: urllib.urlopen blocking?

2010-05-11 Thread Antoine Pitrou
On Tue, 11 May 2010 07:35:52 -0700 (PDT) Dominik Gabi wrote: > > For the record, have you tried calling gobject.threads_init() at the > > beginning of your application (just after importing all modules)? > > I haven't... now it works, thanks :) Any tips on how to avoid mistakes > like that in th

Re: Extract all words that begin with x

2010-05-11 Thread superpollo
Aahz ha scritto: In article , Terry Reedy wrote: On 5/10/2010 5:35 AM, James Mills wrote: On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote: Have I missed something, or wouldn't this work just as well: list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas'] [word for word in list_of_

Re: unable to get Hudson to run unit tests

2010-05-11 Thread Stefan Behnel
j vickroy, 11.05.2010 16:46: > Stefan Behnel wrote: No, what Hudson actually does, is, it writes your command(s) into a text file and runs it with the system's shell interpreter (which, unless otherwise configured, is "cmd.exe" on Windows). This is not the behavior I am experiencing on my Windo

Iterating over dict and removing some elements

2010-05-11 Thread Ulrich Eckhardt
Hi! I wrote a simple loop like this: d = {} ... for k in d: if some_condition(d[k]): d.pop(k) If I run this, Python complains that the dictionary size changed during iteration. I understand that the iterator relies on the internal structure not changing, but how would I str

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread superpollo
pyt...@bdurham.com ha scritto: Terry, ... word[0:1] does the same thing. All Python programmers should learn to use slicing to extract a char from a string that might be empty. Is there an equivalent way to slice the last char from a string (similar to an .endswith) that doesn't raise an ex

Re: Iterating over dict and removing some elements

2010-05-11 Thread superpollo
Ulrich Eckhardt ha scritto: Hi! I wrote a simple loop like this: d = {} ... for k in d: if some_condition(d[k]): d.pop(k) If I run this, Python complains that the dictionary size changed during iteration. I understand that the iterator relies on the internal structure not

PyMPI comm.gather problem

2010-05-11 Thread Peyman Askari
Hi I have run into a serious problem with PyMPI (Python bindings for the Message Passing Interface). Unfortunately I can not provide any example code as it is a massive program (38,000+ lines) and it is very difficult to break the program down due to multiple inheritance. When I run the progra

Re: Iterating over dict and removing some elements

2010-05-11 Thread Michele Simionato
Or you copy the whole dictionary or you just copy the keys: for k in d.keys(): ... or for k in list(d): ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating over dict and removing some elements

2010-05-11 Thread Jerry Hill
On Tue, May 11, 2010 at 11:08 AM, Ulrich Eckhardt wrote: > My first approach was to simply postpone removing the elements, but I was > wondering if there was a more elegant solution. Iterate over something other than the actual dictionary, like this: d = {1: 'one', 2: 'two', 3: 'three'} for k i

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Stefan Behnel wrote: j vickroy, 11.05.2010 16:46: > Stefan Behnel wrote: No, what Hudson actually does, is, it writes your command(s) into a text file and runs it with the system's shell interpreter (which, unless otherwise configured, is "cmd.exe" on Windows). This is not the behavior I am e

Re: Iterating over dict and removing some elements

2010-05-11 Thread superpollo
superpollo ha scritto: Ulrich Eckhardt ha scritto: Hi! I wrote a simple loop like this: d = {} ... for k in d: if some_condition(d[k]): d.pop(k) If I run this, Python complains that the dictionary size changed during iteration. I understand that the iterator relies on th

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread Jerry Hill
On Tue, May 11, 2010 at 10:37 AM, wrote: > Is there an equivalent way to slice the last char from a string (similar > to an .endswith) that doesn't raise an exception when a string is empty? If you use negative indexes in the slice, they refer to items from the end of the sequence instead of the

Re: unable to get Hudson to run unit tests

2010-05-11 Thread j vickroy
Stefan Behnel wrote: j vickroy, 11.05.2010 16:46: > Stefan Behnel wrote: No, what Hudson actually does, is, it writes your command(s) into a text file and runs it with the system's shell interpreter (which, unless otherwise configured, is "cmd.exe" on Windows). This is not the behavior I am e

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Superpollo, > word[len(word)-1:] Perfect! Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread python
Jerry, > If you use negative indexes in the slice, they refer to items from the end of > the sequence instead of the front. So slicing the last character from the > string would be: > > word[-1:] Perfect! Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

plot debugging problem

2010-05-11 Thread Sandy Sandy
Hi friends pls help with debugging problem the mutter is: during debugging the debug processes stacks when fig is created for example, in code import random import matplotlib.pyplot as plt from pylab import * x= 23; y = 11; print(23456) plt.plot(range(10)) plot([1,2,3])

graphs in Python during debugging

2010-05-11 Thread Sandy Sandy
Hi friends Can you help pls to find how to plot graphs in Python during debugging without destroying figures to continue to debug the mutter is: during debugging the debug processes stacks when fig is created for example, in code import random import matplotlib.pyplot as plt from pylab

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread James Mills
On Wed, May 12, 2010 at 2:01 AM, wrote: >> word[len(word)-1:] This works just as well: >>> word[-1:] cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Slice last char from string without raising exception on empty string (Re: Extract all words that begin with x)

2010-05-11 Thread superpollo
James Mills ha scritto: On Wed, May 12, 2010 at 2:01 AM, wrote: word[len(word)-1:] This works just as well: word[-1:] d'uh. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to get Hudson to run unit tests

2010-05-11 Thread Stefan Behnel
j vickroy, 11.05.2010 17:42: Here are the Hudson job | Configure | Execute shell | Command inputs: -- cd level-1 dir nosetests.exe --with-xunit --xunit-file=nosetests.xml --verbose ---

Re: Problem displaying jpgs in Tkinter via PIL

2010-05-11 Thread Armin
Never mind, I gave up on Tkinter and have switched to wxPython now. Getting jpg images to display in a wx frame worked like a charm... (As I said, I'm very new to Python, so I didn't really know what my options for GUI programming were.) It seems like the ImageTk module on the Enthought distri

Re: Problem displaying jpgs in Tkinter via PIL

2010-05-11 Thread Antoine Pitrou
On Tue, 11 May 2010 09:57:01 -0700 Armin wrote: > Never mind, I gave up on Tkinter and have switched to wxPython now. > Getting jpg images to display in a wx frame worked like a charm... (As > I said, I'm very new to Python, so I didn't really know what my options > for GUI programming were.)

Re: lame sphinx questions [Was: lame epydoc questions]

2010-05-11 Thread Phlip
> epydoc supports reStructured text markups. Oh, good. For a moment there, I thought I'd be stuck with a markup language that was persnickety! -- http://mail.python.org/mailman/listinfo/python-list

Re: plot debugging problem

2010-05-11 Thread Matteo Landi
I imagine you have to create a separate thread for it. Just thoughts. On Tue, May 11, 2010 at 6:08 PM, Sandy Sandy wrote: > Hi friends > pls help with debugging problem > the mutter is: > during debugging the  debug processes stacks when fig is created > for example, in code > > import random > >

Re: Is Python a functional programming language?

2010-05-11 Thread Terry Reedy
On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote: In message<7xvdavd4bq@ruckus.brouhaha.com>, Paul Rubin wrote: Python is a pragmatic language from an imperative tradition ... I thought the opposite of “functional” was “procedural”, not “imperative”. The opposite to the latter is “declarat

Re: inherit from data type

2010-05-11 Thread Terry Reedy
On 5/11/2010 7:51 AM, Richard Lamboj wrote: I just want to test what is possible with python and what not. There is no problem that i need to solve. This is what i'am searching for: http://docs.python.org/reference/datamodel.html Last year i have stopped programming python, but now i'am back w

documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
The documentation at http://docs.python.org/py3k/library/string.html#format-specification-mini-language '<' Forces the field to be left-aligned within the available space (This is the default.) The conflicting example:: >>> format(3.2,'10.5f') ' 3.2' >>>

Re: plot debugging problem

2010-05-11 Thread Matteo Landi
Well, I cannot tell you how to do that in a precise way, but googling a bit I found this (expecially the second example): http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/ Take a look also at the Matplotlib cookbook: http://www.scipy.org/Cookbook/Matplotlib ps. when you ans

Re: How to make this doctest work?

2010-05-11 Thread Terry Reedy
On 5/11/2010 5:29 AM, Xie&Tian wrote: Hello I ran across this accidentally and wonders how to make the doctest in following code snippet work: import doctest def a(): """ >>> a = '\\r\\n' >>> print a No matter how many blank lines I add here, it just can't get enough

Pythonw.exe randomly crashing

2010-05-11 Thread Dean Weimer
Hi, I have a python application I wrote that is randomly crashing, I was wondering if anyone else has ran into this error, or if anyone has any idea about how to fix it. This is currently running under Windows server 2008 R2 x64 in terminal services, with Python 2.6.4 x64 installed. I ran into th

default argument

2010-05-11 Thread Back9
Hi, Is this grammer working in Python? class test: self._value = 10 def func(self, self._value) When i try it, it complains about undefined self. i don't know why. TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: default argument

2010-05-11 Thread Back9
On May 11, 3:06 pm, Back9 wrote: > Hi, > > Is this grammer working in Python? > > class test: >   self._value = 10 >   def func(self, self._value) > > When i try it, it complains about undefined self. > > i don't know why. > > TIA Sorry here is the what i meant class test: self._value = 10 de

Re: documentation bug? (format spec mini language)

2010-05-11 Thread MRAB
Alan G Isaac wrote: The documentation at http://docs.python.org/py3k/library/string.html#format-specification-mini-language '<' Forces the field to be left-aligned within the available space (This is the default.) The conflicting example:: >>> format(3.2,'10.5f') '

Re: default argument

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 12:08 PM, Back9 wrote: > On May 11, 3:06 pm, Back9 wrote: >> When i try it, it complains about undefined self. >> >> i don't know why. >> >> TIA > > Sorry > here is the what i meant > class test: >  self._value = 10 >  def func(self, pos = self._value) You're still defin

Re: Is Python a functional programming language?

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 11:13 AM, Terry Reedy wrote: > On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote: >> In message<7xvdavd4bq@ruckus.brouhaha.com>, Paul Rubin wrote: >> >>> Python is a pragmatic language from an imperative tradition ... >> >> I thought the opposite of “functional” was “proc

Re: how to import a module for global use in a library package ?

2010-05-11 Thread Terry Reedy
On 5/11/2010 8:04 AM, Auré Gourrier wrote: Dear all, I am building a library package of the form: rootlib ---__init__ ---subpackage1 --__init__ --sub1module1 --sub1module2 --... ---subpackage2 -- __init__ --sub2module1 --sub2module2 --... My rootlib.__init__ fil

Re: default argument

2010-05-11 Thread Back9
On May 11, 3:20 pm, Chris Rebert wrote: > On Tue, May 11, 2010 at 12:08 PM, Back9 wrote: > > On May 11, 3:06 pm, Back9 wrote: > > >> When i try it, it complains about undefined self. > > >> i don't know why. > > >> TIA > > > Sorry > > here is the what i meant > > class test: > >  self._value =

First Timer

2010-05-11 Thread Donna Lane
I have downloaded Python and I'm a beginner in every sense. What I want to know now is when I am in Idle and have made a syntax error how do I repair? After the error I can't type in anything and I get this bing noise. Usually I just start idle over again. Thanks to anyone out there who respond

Re: Iterating over dict and removing some elements

2010-05-11 Thread Terry Reedy
On 5/11/2010 11:29 AM, Jerry Hill wrote: On Tue, May 11, 2010 at 11:08 AM, Ulrich Eckhardt wrote: My first approach was to simply postpone removing the elements, but I was wondering if there was a more elegant solution. Iterate over something other than the actual dictionary, like this: d =

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 20:16:50 schrieb Terry Reedy: > On 5/11/2010 7:51 AM, Richard Lamboj wrote: > > I just want to test what is possible with python and what not. There is > > no problem that i need to solve. > > > > This is what i'am searching for: > > http://docs.python.org/reference/datamode

Re: fast regex

2010-05-11 Thread Nobody
On Tue, 11 May 2010 17:48:41 +1200, Lawrence D'Oliveiro wrote: >> I was working with regex on a very large text, really large but I have >> time constrained. > > “Fast regex” is a contradiction in terms. Not at all. A properly-written regexp engine will be limited only by memory bandwidth, provi

Limitation of os.walk

2010-05-11 Thread kj
I want implement a function that walks through a directory tree and performs an analsysis of all the subdirectories found. The task has two essential requirements that, AFAICT, make it impossible to use os.walk for this: 1. I need to be able to prune certain directories from being visited. 2.

Re: default argument

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 12:41 PM, Back9 wrote: > On May 11, 3:20 pm, Chris Rebert wrote: >> On Tue, May 11, 2010 at 12:08 PM, Back9 wrote: >> > On May 11, 3:06 pm, Back9 wrote: >> >> >> When i try it, it complains about undefined self. >> >> >> i don't know why. >> >> >> TIA >> >> > Sorry >> >

Re: default argument

2010-05-11 Thread j vickroy
Back9 wrote: Hi, Is this grammer working in Python? class test: self._value = 10 def func(self, self._value) When i try it, it complains about undefined self. i don't know why. TIA ... not exactly; try: class Test: _value = 10 def func(self): print id(self._value), self._v

Re: Is Python a functional programming language?

2010-05-11 Thread Terry Reedy
On 5/11/2010 3:25 PM, Chris Rebert wrote: On Tue, May 11, 2010 at 11:13 AM, Terry Reedy wrote: On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote: In message<7xvdavd4bq@ruckus.brouhaha.com>, Paul Rubin wrote: Python is a pragmatic language from an imperative tradition ... I thought the op

Re: First Timer

2010-05-11 Thread Chris Rebert
On Tue, May 11, 2010 at 12:28 PM, Donna Lane wrote: > I have downloaded Python and I'm a beginner in every sense.  What I want to > know now is when I am in Idle and have made a syntax error how do I repair? > After the error I can't type in > > anything and I get this bing noise.  Usually I just

Re: Is Python a functional programming language?

2010-05-11 Thread Nobody
On Tue, 11 May 2010 07:36:30 -0700, Paul Rubin wrote: > Offhand I can't tell that imperative and procedural mean something > different. Both basically mean that the programmer specifies a series of > steps for the computer to carry out. Functional languages are mostly > declarative; for example,

Re: Is Python a functional programming language?

2010-05-11 Thread Lie Ryan
On 05/12/10 05:25, Chris Rebert wrote: > On Tue, May 11, 2010 at 11:13 AM, Terry Reedy wrote: >> On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote: >>> In message<7xvdavd4bq@ruckus.brouhaha.com>, Paul Rubin wrote: >>> Python is a pragmatic language from an imperative tradition ... >>> >>> I

  1   2   >