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 referen

Re: cgi: getting at raw POST data?

2005-02-26 Thread Tim Roberts
"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

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: 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 modul

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-v

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.

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. Py>def f1(apple): ...apple += 1 ...f2(apple) py>def f2(apple): ...print 'you have

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 directori

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

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(

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 start

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: 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 you

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 calenda

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, t

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: 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 > charac

Re: Converting HTML to ASCII

2005-02-26 Thread Grant Edwards
On 2005-02-26, Paul Rubin 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

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 the

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

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 > in

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 bes

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 (

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: [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 > >http://mail.python.org/mailman/listinfo/python-list

Re: Converting HTML to ASCII

2005-02-26 Thread Jorgen Grahn
On 26 Feb 2005 02:36:31 -0800, Paul Rubin <> 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 tha

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 http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consulta

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 http://sourceforge.net/projects/python-xlib >,

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 -- http://mail.python.org/mailman/

Re: Converting HTML to ASCII

2005-02-26 Thread Mike Meyer
Michael Spencer <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> It also fails on tags with a ">" in a string in the tag. That's >> well-formed but ill-used HTML. >> True enough...however, it doesn't fail too horribly: > >>> striptags("""the text""") > "'>the text" > >>> De

[perl-python] generate all possible pairings

2005-02-26 Thread Xah Lee
20050226 exercise: generate all possible pairings given a list that is a set partitioned into subsets, generate a list of all possible pairings of elements in any two subset. Example: genpair( [[9,1],[5],[2,8,7]] ); returns: [[5,8],[9,5],[1,5],[9,2],[9,7],[1,8],[1,7],[5,2],[1,2],[9,8],[5,7

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

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

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, "Raymond L. Buvel" <[EMAIL PROTECTED]> wrote: > Just wrote: > > > > > SciPy indeed appear to contain a solver, but I'm currently stuck in > > trying to _get_ it for my platform (OSX). I'm definitely not going to > > install a Fortran compiler just to evaluate i

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 Jav

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: generic equivalence partition

2005-02-26 Thread Erik Max Francis
Xah Lee wrote: ... sorry for the latching on on this broadside issue, but it is impotant ... You made a typo in that last word there. Obviously you meant to write an _e_ instead of an _a_. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53

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.

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 incorre

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

2005-02-26 Thread Raymond L. Buvel
Just wrote: SciPy indeed appear to contain a solver, but I'm currently stuck in trying to _get_ it for my platform (OSX). I'm definitely not going to install a Fortran compiler just to evaluate it (even though my name is not "Ilias" ;-). Also, SciPy is _huge_, so maybe a Python translation of

Re: remove strings from source

2005-02-26 Thread M.E.Farmer
qwweeeit wrote: > 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 ummm, Ok all i can say is did you try this? if not save it as a module then import it into the interp

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... Hopefu

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 br

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: 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 -- http://mail.python.org/mailman/listinfo

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
John Machin wrote: Yes. Moreover, "WinZip", the most popular archive-handler, doesn't grok bzip2. I've added a zip file. It was made in Linux with the zip command-line tool, the man pages say it's compatible with the Windows zip tools. I have also added .py extentions to the 2 programs. I did how

Thread scheduling

2005-02-26 Thread Jack Orenstein
I am using Python 2.2.2 on RH9, and just starting to work with Python threads. I started using the threading module and found that 10-20% of the runs of my test program would hang. I developed smaller and smaller test cases, finally arriving at the program at the end of this message, which uses the

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 then

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

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: 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 ha

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

[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

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 t

Re: fdups: calling for beta testers

2005-02-26 Thread John Machin
Patrick Useldinger wrote: > John Machin wrote: > > > (1) It's actually .bz2, not .bz (2) Why annoy people with the > > not-widely-known bzip2 format just to save a few % of a 12KB file?? (3) > > Typing that on Windows command line doesn't produce a useful result (4) > > Haven't you heard of distut

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 solve

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 yo

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. >

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 -- h

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: 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

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 usi

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() > Fo

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: 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 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 h

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 informatio

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 m

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 en

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 na

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: 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: 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 t

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 to

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

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

2005-02-26 Thread Just
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: > 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() > > f

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 d

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 module/pack

Re: PythonCard and Py2Exe

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

Re: remove strings from source

2005-02-26 Thread Mark McEahern
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 under:

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 imp

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 stream

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 45]

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 (http://www.

Re: function expression with 2 arguments

2005-02-26 Thread Reinhold Birkenfeld
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 Looking for lambda? Reinhold -- http://mail.python.org/mailman/listinfo/python-list

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, not

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. B

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 calend

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 above

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 li

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

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) @

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 P

Polling selections from a listbox (Tkinter)

2005-02-26 Thread Harlin Seritt
I am trying to poll selections from a listbox but can't seem to get it to work correctly. class pollstuff: def __init__(self, master): self.listbox = Listbox(master) self.listbox.pack() names = ['Bob', 'Neal', 'Mike'] for n in names: self.listbox.insert(END, n)

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: >>> os.path.normpath(r'\\machine\

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

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 whichdb.w

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

Re: fdups: calling for beta testers

2005-02-26 Thread Patrick Useldinger
John Machin wrote: (1) It's actually .bz2, not .bz (2) Why annoy people with the not-widely-known bzip2 format just to save a few % of a 12KB file?? (3) Typing that on Windows command line doesn't produce a useful result (4) Haven't you heard of distutils? (1) Typo, thanks for pointing it out (2)(3

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 Ser

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

  1   2   >