ANNOUNCE: Hexerei 1.1

2005-02-26 Thread Ransdell, Robert Ethan
Hexerei 1.1! Description Hexerei is a colorful software package for Python (and optionally a web server) that assignsa color value to each word or letter in a database. Hexerei then utilizes the PIL to convert producean image consisting of color blocks which correspond to the given text.

error: db type could not be determined

2005-02-26 Thread neutrinman
why does the following error occur? def quit_time(): data_file = shelve.open("data.dat", "c") data_file["quit_time"] = datetime.datetime.today() print data_file["quit_time"] raw_input("enter") Traceback (most recent call last):

Re: Yet another logo design...

2005-02-26 Thread Harlin Seritt
I like the type logo (on the right of the image). The black snake-like image can be cropped though. :-) Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: Watermark on images

2005-02-26 Thread Michele Simionato
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 -- http://mail.python.org/mailman/listinfo/python-list

Error in pywordnet

2005-02-26 Thread Gurpreet Sachdeva
I am using pywordnet and when ever I import the package from wordnet import *, I get an error: Exception exceptions.AttributeError: DbfilenameShelf instance has no attribute 'writeback' in ignored Now the package works fine until I tried to use that in Apache via CGI. Apache is showing a Server

Re: netmask arithmetic?

2005-02-26 Thread Roel Schroeven
Dan Stromberg wrote: Before I go and reinvent the wheel, does anyone already have python code that can do netmask arithmetic - for example, determining if a list of hostnames are on subnets described by a list of networks+netmasks like: 128.200.34.0/24 128.195.16.128/25 ...and so on?

Re: error: db type could not be determined

2005-02-26 Thread John Machin
[EMAIL PROTECTED] wrote: why does the following error occur? I don't know; I've never used the shelve module. Let's see what as two utter n00bz we can find out. Let's check out where it clagged: lib\anydbm.py, line 80, in open ... Hmm, reading backwards a little, looks like it called

Re: Converting HTML to ASCII

2005-02-26 Thread Paul Rubin
Jorgen Grahn [EMAIL PROTECTED] writes: You should probably do what some other poster suggested -- download lynx or some other text-only browser and make your code execute it in -dump mode to get the text-formatted html. You'll get that working in an hour or so, and then you can see if you need

Re: split a directory string into a list

2005-02-26 Thread Duncan Booth
Josef Meile wrote: This should work ***reasonably*** reliably on Windows and Unix. Are there any cases when it does not work? The most obvious case where it wouldn't work would be for a UNC path name. Using the string split method gives two empty strings:

Re: Which module is set in?

2005-02-26 Thread Raymond Hettinger
[Michael Hartl] It's good that you're using Python 2.3, which does have sets available, as a previous poster mentioned. Users of Python 2.2 or earlier can get most of the Set functionality using the following class (from Peter Norvig's utils.py file): Py2.3's set module also works under

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
# the following solution is submitted by # Sean Gugler and David Eppstein independently # 20050224. @def parti(aList, equalFunc): @result = [] @for i in range(len(aList)): @for s in result: @if equalFunc( aList[i], aList[s[0]] ): @s.append(i) @

function expression with 2 arguments

2005-02-26 Thread Xah Lee
is there a way to write a expression of a function with more than 1 argument? e.g., i want a expression that's equivalent to def f(x,y) return x+y Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

class factory example needed (long)

2005-02-26 Thread Gary Ruben
I have a class factory problem. You could say that my main problem is that I don't understand class factories. My specific problem: I have a class with several methods I've defined. To this class I want to add a number of other class methods where the method names are taken from a list. For each

Re: function expression with 2 arguments

2005-02-26 Thread Harlin Seritt
Not exactly sure what you're looking for but you can do the following: def dosomething(numlist): return numlist[0] + numlist[1] numlist = [ 5, 10] val = dosomething(numlist) If so, that would be somewhat pointless. It's always best to keep it simple. It looks like the function you wrote

Making a calendar

2005-02-26 Thread Pete.....
Hi all. I'm trying to make a calendar for my webpage, python and html is the only programming languages that I know, is it possible to make such a calendar with pythong code and some html. The Idea is that when I click the link calendar on my webpage, then the user will be linked to the

Problem When Unit Testing with PMock

2005-02-26 Thread steven
Hi, Anyone was using pmock for unit testing with python? I met a problem and hope someone to help me. For short, the pmock seems can not mock a iterator object. For example, the tested object is foo, who need to send message to another object bar. So, to test the foo, I need mock a mockBar.

Re: possible python/linux/gnome issue!!

2005-02-26 Thread Lee Harr
On 2005-02-26, bruce [EMAIL PROTECTED] wrote: hi... i'm running rh8.0 with gnome.. i'm not sure of the version (it's whatever rh shipped). i've recently updated (or tried to update) python to the latest version. when i try to run the 'Server Settings/Services' Icon within gnome, nothing

Re: possible python/linux/gnome issue!!

2005-02-26 Thread Jarek Zgoda
Lee Harr napisa(a): [EMAIL PROTECTED] bin]# redhat-config-services /usr/share/redhat-config-services/serviceconf.py:331: SyntaxWarning: argument named None def on_mnuRescan_activate(self,None): I don't think this has ever been legal... so that's strange. It was, but currently is not

remove strings from source

2005-02-26 Thread qwweeeit
For a python code I am writing I need to remove all strings definitions from source and substitute them with a place-holder. To make clearer: line 45 sVar=this is the string assigned to sVar must be converted in: line 45 sVar=s1 Such substitution is recorded in a file under: s0001[line

Re: Threading and consuming output from processes

2005-02-26 Thread Jack Orenstein
I asked: I am developing a Python program that submits a command to each node of a cluster and consumes the stdout and stderr from each. I want all the processes to run in parallel, so I start a thread for each node. There could be a lot of output from a node, so I have a thread reading each

any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root() functionality (which solves arbitrary polynomials). Does anyone know of a Python module/package that

Re: PythonCard and Py2Exe

2005-02-26 Thread PipedreamerGrey
That did it. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
Just wrote: While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root() functionality (which solves arbitrary polynomials). Does anyone know of a Python

Re: getting at raw POST data?

2005-02-26 Thread Sarat Venugopal
Erik Johnson wrote: I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) Often, people do require abnormal things. I need to write a CGI program that accepts and processes that data.

Re: cgi: getting at raw POST data?

2005-02-26 Thread madsurfer2000
Erik Johnson wrote: I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that accepts and processes that data. I'm not seeing how to get at data that's not

Re: remove strings from source

2005-02-26 Thread Duncan Booth
qwweeeit wrote: I need your help in correctly identifying the strings (also embedding the r'xx..' or u'yy...' as part of the string definition). The problem is mainly on the multi-line definitions or in cached strings (embedding chr() definitions or escape sequences). Have a look at

Re: Threading and consuming output from processes

2005-02-26 Thread Donn Cave
Quoth Jack Orenstein [EMAIL PROTECTED]: [ ... re alternatives to threads ] | Thanks for your replies. The streams that I need to read contain | pickled data. The select call returns files that have available input, | and I can use read(file_descriptor, max) to read some of the input | data. But

Re: Making a calendar

2005-02-26 Thread Michele Simionato
Looking at the calendar module in the standard library may help. Also, pydoc calendar is your friend. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: fdups: calling for beta testers

2005-02-26 Thread Peter Hansen
Patrick Useldinger wrote: (9) Any good reason why the executables don't have .py extensions on their names? (9) Because I am lazy and Linux doesn't care. I suppose Windows does? Unfortunately, yes. Windows has nothing like the x permission bit, so you have to have an actual extension on the

Re: function expression with 2 arguments

2005-02-26 Thread Peter Hansen
Xah Lee wrote: is there a way to write a expression of a function with more than 1 argument? e.g., i want a expression that's equivalent to def f(x,y) return x+y Since assignment is a statement in Python, not an expression, and since def f is an assignment that binds a function object to the

Whither datetime.date ?

2005-02-26 Thread Harald Hanche-Olsen
I'm confused. I was going to try linkchecker, and it dies with a traceback ending in File /usr/local/lib/python2.4/calendar.py, line 32, in _localized_month _months = [datetime.date(2001, i+1, 1).strftime for i in range(12)] AttributeError: 'module' object has no attribute 'date' Sure

Re: strange SyntaxError

2005-02-26 Thread Scott David Daniels
Attila Szabo wrote: 2005, Feb 25 - Scott David Daniels wrote : Attila Szabo wrote: ...lambda x: 'ABC%s' % str(x) ... OK, to no real effect, in main you define an unnamed function that you can never reference. Pretty silly, but I'll bite. This code was simplified, the lambda was part of a

Re: Whither datetime.date ?

2005-02-26 Thread Diez B. Roggisch
Harald Hanche-Olsen wrote: I'm beginning to wonder if the FreeBSD python package is at fault. Maybe - at my system, it has no Date or DateTime Python 2.4.1a0 (#2, Feb 9 2005, 12:50:04) [GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2 Type help, copyright, credits or license for more information.

Re: Whither datetime.date ?

2005-02-26 Thread Tim Peters
[Harald Hanche-Olsen] I'm confused. I was going to try linkchecker, and it dies with a traceback ending in File /usr/local/lib/python2.4/calendar.py, line 32, in _localized_month _months = [datetime.date(2001, i+1, 1).strftime for i in range(12)] AttributeError: 'module' object has no

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Terry Reedy
Just [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does SciPy do what you want? Specifically Scientific.Functions.FindRoot [1] Scientific.Functions.Polynomial [2] http://starship.python.net/~hinsen/ScientificPython/ScientificPythonManual/Sci entific_9.html [2]

Re: Whither datetime.date ?

2005-02-26 Thread Harald Hanche-Olsen
+ Tim Peters [EMAIL PROTECTED]: | As you've deduced, you're certainly not getting Python's builtin | datetime module. Argh. Yeah, I've had one lying around in my personal python directory since 2000, had totally forgotten it was there. This one ... *** Author: Jeff Kunce [EMAIL PROTECTED] ***

Re: Problem When Unit Testing with PMock

2005-02-26 Thread Terry Reedy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Anyone was using pmock for unit testing with python? I met a problem and hope someone to help me. For short, the pmock seems can not mock a iterator object. Why bother? def mockit(): raise StopIteration now pass mockit() For

Re: Watermark on images

2005-02-26 Thread Terry Reedy
Michele Simionato [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 Googling Python image watermark and first hit is !!! ASPN : Python Cookbook : Watermark with PIL ... Description: Apply a watermark to an image using the

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread John M. Gamble
In article [EMAIL PROTECTED], Just [EMAIL PROTECTED] wrote: While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except Thank you. it's not Python... Sorry about that. I'm especially looking for its

Re: Making a calendar

2005-02-26 Thread Ksenia Marasanova
This is close to what you want: http://freespace.virgin.net/hamish.sanderson/htmlcalendar.html You'll also need HTMLTemplate http://freespace.virgin.net/hamish.sanderson/htmltemplate.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Leo 4.3-a3 Outlining IDE

2005-02-26 Thread Brad Clements
FYI, After install and you run it for the first time (and if it asks for your initials), then expect the plug-in manager to throw a bad window name error in TK. You must exit, then restart Leo before running the plugin manager after the initial install. -- Novell DeveloperNet Sysop #5 --

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (John M. Gamble) wrote: In article [EMAIL PROTECTED], Just [EMAIL PROTECTED] wrote: While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except Thank you. it's not

Re: fdups: calling for beta testers

2005-02-26 Thread Serge Orlov
Peter Hansen wrote: Patrick Useldinger wrote: (9) Any good reason why the executables don't have .py extensions on their names? (9) Because I am lazy and Linux doesn't care. I suppose Windows does? Unfortunately, yes. Windows has nothing like the x permission bit, so you have to have an

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread John M. Gamble
In article [EMAIL PROTECTED], Just [EMAIL PROTECTED] wrote: Heh, how big are the odds you find the author of an arbitrary Perl module on c.l.py... Hey, that's why it's called lurking. Any will do. As I wrote in another post, I'm currently only looking for a quintic equation solver, which

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Just
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (John M. Gamble) wrote: The original source for the algorithm used in the module is from Hiroshi Murakami's Fortran source, and it shouldn't be too difficult to repeat the translation process to python. Ah ok, I'll try to locate that

[solved] Re: error in non-existing code?

2005-02-26 Thread Thomas Newman
Thomas Newman wrote: Michael Hoffman wrote: Thomas Newman wrote: I wanted to look at the code that gives me the error, but there is no line 447 in /usr/lib/python2.3/pyclbr.py: Try deleting pyclbr.py[co]. There were recursive imports, meaning file A imported file B and

Re: remove strings from source

2005-02-26 Thread M.E.Farmer
qwweeeit wrote: For a python code I am writing I need to remove all strings definitions from source and substitute them with a place-holder. To make clearer: line 45 sVar=this is the string assigned to sVar must be converted in: line 45 sVar=s1 Such substitution is recorded in a file

Re: function expression with 2 arguments

2005-02-26 Thread Xah Lee
lambda x, y: x + y that's what i was looking for. ... once i have a lambda expr, how to apply it to arguments? e.g. in Mathematica Function[#1+#2][a,b] Python doc is quite confounded in it's way of organization centered around implementation tied to hardware (as most imperative languages are

Re: function expression with 2 arguments

2005-02-26 Thread Leif K-Brooks
Xah Lee wrote: lambda x, y: x + y that's what i was looking for. ... once i have a lambda expr, how to apply it to arguments? http://python.org/doc/current/ref/calls.html -- http://mail.python.org/mailman/listinfo/python-list

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
folks: when using google to post a reply, it sometimes truncates the subject line. i.e. [perl-python] is lost. This software error is obvious, they could not have not noticed it. another thing more egregious is that google _intentionally_ edit with people's posts. (e.g. they change email address

Using PyOpenGL what should I use for a GUI ?

2005-02-26 Thread Gilles Leblanc
Hi I have started a small project with PyOpenGL. I am wondering what are the options for a GUI. So far I checked PyUI but it has some problems with 3d rendering outside the Windows platform. I know of WxPython but I don't know if I can create a WxPython window, use gl rendering code in it and

Re: Thread scheduling

2005-02-26 Thread M.E.Farmer
This may help. http://linuxgazette.net/107/pai.html Also be sure to google. search strategy: Python threading Python threads Python thread tutorial threading.py example Python threading example Python thread safety hth, M.E.Farmer --

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
Serge Orlov wrote: Or use exemaker, which IMHO is the best way to handle this problem. Looks good, but I do not use Windows. -pu -- http://mail.python.org/mailman/listinfo/python-list

Re: Canonical way of dealing with null-separated lines?

2005-02-26 Thread Douglas Alan
I wrote: Okay, here's the definitive version (or so say I). Some good doobie please make sure it makes its way into the standard library: Oops, I just realized that my previously definitive version did not handle multi-character newlines. So here is a new definition version. Oog, now my

Re: remove strings from source

2005-02-26 Thread qwweeeit
Thank you for your suggestion, but it is too complicated for me... I decided to proceed in steps: 1. Take away all commented lines 2. Rebuild the multi-lines as single lines I have already written the code and now I can face the problem of mouving string definitions into a data base file...

Re: generic equivalence partition

2005-02-26 Thread Xah Lee
People, ... sorry for the latching on on this broadside issue, but it is impotant ... here's are some germane points from another online discussion: the bug-reporting issue has came up so many times by so many people i thought i'd make a comment of my view. when a software is ostensibly

Re: Thread scheduling

2005-02-26 Thread Peter Hansen
Jack Orenstein wrote: I am using Python 2.2.2 on RH9, and just starting to work with Python threads. Is this also the first time you've worked with threads in general, or do you have much experience with them in other situations? This program seems to point to problems in Python thread scheduling.

Xlib in Python? I need XDrawString()

2005-02-26 Thread Artificial Life
All I really want is to write a few strings to the background of my X display. XDrawString() is what I need. The Xlib for Python shows it's out dated. Is there any alternative? -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread scheduling

2005-02-26 Thread Jack Orenstein
Peter Hansen wrote: Jack Orenstein wrote: I am using Python 2.2.2 on RH9, and just starting to work with Python threads. Is this also the first time you've worked with threads in general, or do you have much experience with them in other situations? Yes, I've used threading in Java.

Re: weird strings question

2005-02-26 Thread Lucas Raab
Robert Kern wrote: Lucas Raab wrote: Is it possible to assign a string a numerical value?? For example, in the string test can I assign a number to each letter as in t = 45, e = 89, s = 54, and so on and so forth?? Use a dictionary with the strings as keys. string2num = {} string2num['t'] = 45

Re: Xlib in Python? I need XDrawString()

2005-02-26 Thread jepler
python-xlib may not see any development, but I used it recently with python 2.2 or 2.3, and don't remember any particular problems doing so. you may want to give it a try, instead of dismissing it out of hand. Jeff pgpEbkioBp45P.pgp Description: PGP signature --

Re: Xlib in Python? I need XDrawString()

2005-02-26 Thread Mike Meyer
Artificial Life [EMAIL PROTECTED] writes: All I really want is to write a few strings to the background of my X display. XDrawString() is what I need. The Xlib for Python shows it's out dated. Is there any alternative? If you're referring to URL: http://sourceforge.net/projects/python-xlib ,

Re: [perl-python] generate all possible pairings

2005-02-26 Thread Mike Meyer
Xah Lee [EMAIL PROTECTED] writes: This is brought to you by the perl-python community. To subscribe, see http://xahlee.org/perl-python/python.html assert len(perl-python community) == 1 mike -- Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/ Independent

Re: [perl-python] generate all possible pairings

2005-02-26 Thread Chris Mattern
Mike Meyer wrote: Xah Lee [EMAIL PROTECTED] writes: This is brought to you by the perl-python community. To subscribe, see http://xahlee.org/perl-python/python.html assert len(perl-python community) == 1 mike Apparently there are actually people who subscribe. Maybe they're

string methods (warning, newbie)

2005-02-26 Thread anthonyberet
Is there a string mething to return only the alpha characters of a string? eg 'The Beatles - help - 03 - Ticket to ride', would be 'TheBeatlesTickettoride' If not then how best to approach this? I have some complicated plan to cut the string into individual characters and then concatenate a new

Re: fdups: calling for beta testers

2005-02-26 Thread John Machin
On Sat, 26 Feb 2005 23:53:10 +0100, Patrick Useldinger [EMAIL PROTECTED] wrote: I've tested it intensively Famous Last Words :-) Thanks for your feedback! Here's some more: (1) Manic s/w producing lots of files all the same size: the Borland C[++] compiler produces a debug symbol file (.tds)

Re: string methods (warning, newbie)

2005-02-26 Thread anthonyberet
anthonyberet wrote: Is there a string mething [method] to return only the alpha characters of a string? eg 'The Beatles - help - 03 - Ticket to ride', would be 'TheBeatlesTickettoride' erm, no it wouldn't, it would be 'TheBeatleshelpTickettoride', but you get me, I am sure. If not then how

Re: Dealing with config files what's the options

2005-02-26 Thread Jorgen Grahn
On Fri, 25 Feb 2005 21:54:16 -0500, Tom Willis [EMAIL PROTECTED] wrote: On Fri, 25 Feb 2005 15:02:04 -0700, Dave Brueck [EMAIL PROTECTED] wrote: Jorgen Grahn wrote: ... How about writing them in Python? ... I actually thought of this, and I was kind of on the fence due to the intended

Re: Thread scheduling

2005-02-26 Thread Peter Hansen
Jack Orenstein wrote: Peter Hansen wrote: You've got two shared global variables, done and counter. Each of these is modified in a manner that is not thread-safe. I don't know if counter is causing trouble, but it seems likely that done is. I understand that. Basically, the statement

Re: string methods (warning, newbie)

2005-02-26 Thread Peter Hansen
anthonyberet wrote: Is there a string mething to return only the alpha characters of a string? eg 'The Beatles - help - 03 - Ticket to ride', would be 'TheBeatlesTickettoride' If not then how best to approach this? I have some complicated plan to cut the string into individual characters and

Re: Converting HTML to ASCII

2005-02-26 Thread Grant Edwards
On 2005-02-26, Paul Rubin http wrote: Jorgen Grahn [EMAIL PROTECTED] writes: You should probably do what some other poster suggested -- download lynx or some other text-only browser and make your code execute it in -dump mode to get the text-formatted html. You'll get that working in an hour

RE: string methods (warning, newbie)

2005-02-26 Thread Jimmy Retzlaff
Anthonyberet wrote: Is there a string mething to return only the alpha characters of a string? eg 'The Beatles - help - 03 - Ticket to ride', would be 'TheBeatlesTickettoride' If not then how best to approach this? I have some complicated plan to cut the string into individual characters

Re: string methods (warning, newbie)

2005-02-26 Thread Terry Reedy
anthonyberet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a string mething to return only the alpha characters of a string? eg 'The Beatles - help - 03 - Ticket to ride', would be 'TheBeatlesTickettoride' I believe you can do this with string.translate (string

Re: Thread scheduling

2005-02-26 Thread Jack Orenstein
On my machines (one Py2.4 on WinXP, one Py2.3.4 on RH9.0) I don't see this behaviour. Across about fifty runs each. Thanks for trying this. One thing you might try is experimenting with sys.setcheckinterval(), just to see what effect it might have, if any. That does seem to have an impact. At 0,

Re: Making a calendar

2005-02-26 Thread Brian Sutherland
On Sat, Feb 26, 2005 at 01:57:20PM +0100, Pete. wrote: I'm trying to make a calendar for my webpage, python and html is the only programming languages that I know, is it possible to make such a calendar with pythong code and some html. The Idea is that when I click the link calendar on

Re: Thread scheduling

2005-02-26 Thread Peter Hansen
Jack Orenstein wrote: One thing you might try is experimenting with sys.setcheckinterval(), just to see what effect it might have, if any. That does seem to have an impact. At 0, the problem was completely reproducible. At 100, I couldn't get it to occur. If you try other values in between, can

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
Just wrote: (Hm, I had the impression that scipy != Konrad Hinsen's Scientific module.) You're probably right :) I had played with [1], but it only calculates one root, and I need all roots (specifically, for a quintic equation). [2] doesn't seem to be a solver? Actually, I was curious whether

Re: function expression with 2 arguments

2005-02-26 Thread Nick Coghlan
Xah Lee wrote: Python doc is quite confounded in it's way of organization centered around implementation tied to hardware (as most imperative languages are hardware-centric), as opposed to algorithm math concepts. Actually, Python's docs are centred around the fact that they expect people to

Re: string methods (warning, newbie)

2005-02-26 Thread Nick Coghlan
Jimmy Retzlaff wrote: The approach you are considering may be easier than you think: filter(str.isalpha, 'The Beatles - help - 03 - Ticket to ride') 'TheBeatleshelpTickettoride' Hmm, I think this is a case where filter is significantly clearer than the equivalent list comprehension: Py .join([c

Is it possible to pass a parameter by reference?

2005-02-26 Thread Anthony Liu
I defined two functions, f1 and f2. f1 modifies the value of a variable called apple. I want to pass the modified value of apple to f2. How can I do this? I got stuck. __ Do you Yahoo!? Yahoo! Mail - You care about security. So do

PyUnit and multiple test scripts

2005-02-26 Thread Calvin Spealman
I'm trying to find the best way to use PyUnit and organize my test scripts. What I really want is to separate all my tests into 'test' directories within each module of my project. I want all the files there to define a 'suite' callable and to then all all those suites from all those test

Re: Is it possible to pass a parameter by reference?

2005-02-26 Thread M.E.Farmer
Anthony Liu wrote: I defined two functions, f1 and f2. f1 modifies the value of a variable called apple. I want to pass the modified value of apple to f2. How can I do this? I got stuck. Pydef f1(apple): ...apple += 1 ...f2(apple) pydef f2(apple): ...print 'you have %s

Re: Problem When Unit Testing with PMock

2005-02-26 Thread steven
def mockit(): raise StopIteration now pass mockit() but it behaviors differenctly when pass in a mockit() and pass in an iterator with empty. so i think the code emulates nothing. def intit(k): for i in range(k): yield i Now you mean define my own iteration without the help of pmock.

parse lines to name value pairs

2005-02-26 Thread sunriselee
Hi all, I want to parse some string lines into name value pairs, where the value will be a list. Here are some sample lines: line1 = path {{data/tom} C:/user/john} line2 = books{{book music red} {book {math 1} blue} {book {tom's book} green}} For line1, the name is path, the name-value should

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Carl Banks
Just wrote: While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root() functionality (which solves arbitrary polynomials). Does anyone know of a Python

simple input that can understand special keys?

2005-02-26 Thread Gabriel B.
i'm writting an application that will use Tinker in a newer future. Now it's console only. I simply ommit some data on the display, print() some other and go on. The problem is that i can't test the actions tiggered by special keys, like Page Up/Down or the F1...12 Right now i'm using raw_input()

Re: cgi: getting at raw POST data?

2005-02-26 Thread Tim Roberts
Erik Johnson nobody at anywhere dot com wrote: I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that accepts and processes that data. I'm not seeing how

Re: Is it possible to pass a parameter by reference?

2005-02-26 Thread Tim Roberts
Anthony Liu [EMAIL PROTECTED] wrote: I defined two functions, f1 and f2. f1 modifies the value of a variable called apple. I want to pass the modified value of apple to f2. How can I do this? I got stuck. It depends on the data type. Essentially, all objects are passed by reference.

[ python-Bugs-1152424 ] Dict docstring error Python-2.3.5

2005-02-26 Thread SourceForge.net
Bugs item #1152424, was opened at 2005-02-26 11:19 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1152424group_id=5470 Category: Documentation Group: Python 2.3 Status: Open

[ python-Bugs-1152723 ] urllib2 dont respect debuglevel in httplib

2005-02-26 Thread SourceForge.net
Bugs item #1152723, was opened at 2005-02-27 03:49 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1152723group_id=5470 Category: Python Library Group: Python 2.4 Status: Open

[ python-Bugs-1152726 ] Default class args get clobbered by prior instances.

2005-02-26 Thread SourceForge.net
Bugs item #1152726, was opened at 2005-02-26 22:10 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1152726group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status:

[ python-Bugs-1152726 ] Default class args get clobbered by prior instances.

2005-02-26 Thread SourceForge.net
Bugs item #1152726, was opened at 2005-02-26 22:10 Message generated for change (Settings changed) made by sdrabble You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1152726group_id=5470 Category: Python Interpreter Core Group: Python 2.3 Status: Open

[ python-Bugs-1110242 ] gzip.GzipFile.flush() does not flush all internal buffers

2005-02-26 Thread SourceForge.net
Bugs item #1110242, was opened at 2005-01-26 16:42 Message generated for change (Comment added) made by alanmcintyre You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1110242group_id=5470 Category: Python Library Group: Python 2.4 Status: Open Resolution:

[ python-Bugs-1152762 ] curses.textpad raises error

2005-02-26 Thread SourceForge.net
Bugs item #1152762, was opened at 2005-02-27 19:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1152762group_id=5470 Category: Python Library Group: Python 2.3 Status: Open