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

2005-03-01 Thread Pierre Schnizer
In case you are still interested pygsl wraps the GSL solver. from pygsl import poly pc = poly.poly_complex(3) tmp, rs = pc.solve((2,3,1)) print rs You get pygsl at http://sourceforge.net/projects/pygsl/ Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Daniel Yoo
Kent Johnson <[EMAIL PROTECTED]> wrote: :> Given a string, I want to find all ocurrences of :> certain predefined words in that string. Problem is, the list of :> words that should be detected can be in the order of thousands. :> :> With the re module, this can be solved something like this: :>

Re: Non-blocking input on windows, like select in Unix

2005-03-01 Thread Jonathan Fine
Paul Rubin wrote: Jonathan Fine <[EMAIL PROTECTED]> writes: My question is this: Under Windows, is it possible to read as many bytes as are available from stdout, without blocking? I think Windows implements non-blocking i/o calls. However the traditional (to some) Python or Java approach to this

directing windows

2005-03-01 Thread Raghul
Hi, I made 3 windows using wxpython.My problem is when I enter the number 2 in my application the second window to be highlighted when i press 1 the first should be highlighted.How can this be done? Is it possible to do this with hash tables or some dictionaries . help me pls -- http://mail.py

Re: yield_all needed in Python

2005-03-01 Thread Isaac To
> "Douglas" == Douglas Alan <[EMAIL PROTECTED]> writes: Douglas> If you actually try doing this, you will see why I want Douglas> "yield_all". Oh... I see your point. I was about to suggest that the code in my posts before should be made to work somehow. I mean, if in def fun1(x)

Re: Question - What is a faster alternative to recursion?

2005-03-01 Thread actuary77
Heiko Wundram wrote: On Wednesday 02 March 2005 06:03, actuary77 wrote: It now makes sense if I write it, (simple): def rec2(n): if n == 0: return [] else: return [n] + rec2(n-1) Or, if you're not interested in a recursive function to do this job (which should be way faster

Re: Help- Recursion v. Iter Speed comparison

2005-03-01 Thread Robert Kern
actuary77 wrote: Recurse from time: 4.305942779541 seconds Iter from time: 0.009904632568359 seconds No comparison, why is recursion so slow? I usually don't delve too deeply into language design issues, so I hope others will correct me if I'm wrong. Recursion is usually slower t

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Nick Craig-Wood
André Søreng <[EMAIL PROTECTED]> wrote: > Given a string, I want to find all ocurrences of > certain predefined words in that string. Problem is, the list of > words that should be detected can be in the order of thousands. > > With the re module, this can be solved something like this: > >

Re: Help- Recursion v. Iter Speed comparison

2005-03-01 Thread actuary77
Heiko Wundram wrote: On Wednesday 02 March 2005 06:03, actuary77 wrote: It now makes sense if I write it, (simple): def rec2(n): if n == 0: return [] else: return [n] + rec2(n-1) Or, if you're not interested in a recursive function to do this job (which should be way faste

Re: Jigsaw solver

2005-03-01 Thread Tim Churches
[EMAIL PROTECTED] wrote: Tim Churches wrote: [EMAIL PROTECTED] wrote: ObPuzzle: how did I "damage" the image? You created a mirror image. Damn. Too easy. There is another explanation for the rapidity with which your brain teaser was solved, but modesty prevents me from mentioni

Re: Is it possible to specify the size of list at construction?

2005-03-01 Thread Terry Hancock
On Tuesday 01 March 2005 02:50 pm, Anthony Liu wrote: > Yes, that's helpful. Thanks a lot. > > But what if I wanna construct an array of arrays like > we do in C++ or Java: > > myArray [][] > > Basically, I want to do the following in Python: > > myArray[0][1] = list1 > myArray[1][2] = list2 >

Re: Jigsaw solver

2005-03-01 Thread [EMAIL PROTECTED]
Tim Churches wrote: > [EMAIL PROTECTED] wrote: > > >[EMAIL PROTECTED] wrote: > > > > > >>This can be interesting: > >>http://science.slashdot.org/science/05/03/01/2340238.shtml > >> > >>Bearophile > >> > >> > > > >Hey, that DataGlyph demo works pretty neat. > > > > > ... > > >Of course, being an o

suse 9 python has no distutils.core ?

2005-03-01 Thread Jaco Smuts
Hello there I'm trying to install  some modules onto a Suse 9 box at work (for the first time). But I'm getting  -- no module named distutils.core when I try  and run python setup.py install ? the default distro is python 2.3.3 I've tried the latest rpm distro I could find on rpmfind.net, but

Re: Help- Simple recursive function to build a list - Sorry for all the noise!

2005-03-01 Thread Heiko Wundram
On Wednesday 02 March 2005 06:03, actuary77 wrote: > It now makes sense if I write it, (simple): > > def rec2(n): > if n == 0: > return [] > else: > return [n] + rec2(n-1) Or, if you're not interested in a recursive function to do this job (which should be way faster..

Re: Jigsaw solver

2005-03-01 Thread Tim Churches
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: This can be interesting: http://science.slashdot.org/science/05/03/01/2340238.shtml Bearophile Hey, that DataGlyph demo works pretty neat. ... Of course, being an old System Test Engineer whose job it was to figure out how to break softwa

Re: Help- Simple recursive function to build a list - Sorry for all the noise!

2005-03-01 Thread actuary77
actuary77 wrote: I am trying to write simple recursive function to build a list: def rec(n,alist=[]): _nl=alist[:] print n,_nl if n == 0: print n,_nl return _nl else: _nl=_nl+[n] rec(n-1,_nl) _nl=[] _nl=rec(4) print _nl ### shouldn't this work? _nl=re

Re: Jigsaw solver

2005-03-01 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > This can be interesting: > http://science.slashdot.org/science/05/03/01/2340238.shtml > > Bearophile Hey, that DataGlyph demo works pretty neat. Decoding your DataGlyph. DataGlyph decoded successfully. four score and seven years ago our fathers brought forth on this

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Isaac To <[EMAIL PROTECTED]> writes: >> "Isaac" == Isaac To <[EMAIL PROTECTED]> writes: > > def gen_all(gen): > for e in gen: > yield e > > def foogen(arg1): > def foogen1(arg2): > # Some code here > # Some code here > gen_all(arg3) > ^ I mean foogen

Re: [perl-python] generate all possible pairings

2005-03-01 Thread Xah Lee
Answer to the previous exercise. http://xahlee.org/perl-python/generate_pairings.html # perl sub genpair ($) { my $partiSet = $_[0]; my @result; for (my $head =0; $head <= ((scalar @$partiSet)-2); $head++ ) { for (my $tail = $head+1; $tail <= ((scalar @$partiSet)-1); $tail++ ) { foreac

Re: python-dev Summary for 2005-01-16 through 2005-01-31

2005-03-01 Thread IncessantRanting
Gerrit Muller wrote: > > as always I do appreciate your summaries. This new format, with the > boilerplate at the end certainly is an improvement. However, I always > use your news announcement as a trigger to read the version at > . I used to do this by >

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> I found out that doing a re.findall will split up the results into an >> array, or rather something called a list (looks like an array to me). > > It may look like an array to you, but it's a list. Python > doesn't have arrays

OK, time to retire (was: Re: python-dev Summary for 2005-01-16 through 2005-01-31)

2005-03-01 Thread Brett C.
Steve Holden wrote: Michele Simionato wrote [on c.l.py]: Brett Cannon: [... python-dev summary ... boilerplate change ...] +1 for this idea. The summary looks much better now :) Keep the good work going, Sorry, but i have to disagree. I hope you won't take this reply personally, Michele, since it'

Re: Help- Simple recursive function to build a list

2005-03-01 Thread Kent Johnson
actuary77 wrote: I am trying to write simple recursive function to build a list: def rec(n,alist=[]): _nl=alist[:] print n,_nl if n == 0: print n,_nl return _nl else: _nl=_nl+[n] rec(n-1,_nl) should be return rec(n-1,_nl) >>> def rec(n,alist=

Re: yield_all needed in Python

2005-03-01 Thread Isaac To
> "Isaac" == Isaac To <[EMAIL PROTECTED]> writes: def gen_all(gen): for e in gen: yield e def foogen(arg1): def foogen1(arg2): # Some code here # Some code here gen_all(arg3) ^ I mean foogen1(arg3), obviously, and similar for below # Some code h

Re: yield_all needed in Python

2005-03-01 Thread Isaac To
> "Douglas" == Douglas Alan <[EMAIL PROTECTED]> writes: Douglas> If you'll reread what I wrote, you'll see that I'm not Douglas> concerned with performance, but rather my concern is that Douglas> I want the syntactic sugar. I'm tired of writing code Douglas> that looks like

Re: Help- Simple recursive function to build a list

2005-03-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, actuary77 <[EMAIL PROTECTED]> wrote: > I am trying to write simple recursive function to build a list: > > > def rec(n,alist=[]): > _nl=alist[:] > print n,_nl > if n == 0: > print n,_nl > return _nl > else: > _nl=_nl

Help- Simple recursive function to build a list

2005-03-01 Thread actuary77
I am trying to write simple recursive function to build a list: def rec(n,alist=[]): _nl=alist[:] print n,_nl if n == 0: print n,_nl return _nl else: _nl=_nl+[n] rec(n-1,_nl) _nl=[] _nl=rec(4) print _nl ### shouldn't this work? _nl=rec(4) The output

Re: Closing dialog window in Tkinter

2005-03-01 Thread Harlin Seritt
You can add this: button = Button(top, text="Close Me", command=top.destroy) button.pack() That will kill the Toplevel window. Cheers, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster way to do this...

2005-03-01 Thread Robert Kern
Harlin Seritt wrote: Roy, I like what you showed: nums = [a for a in range(100)] . My mistake for not expressing my question as well as I should have. Not only am I looking for a way to fill in 100 spots (more or less) in an array er... list, but I'd like to be able to do it in intervals of 2,

Re: Hardware specs gathering? - platform independant

2005-03-01 Thread mh
The Spike Asset Manager reports on the cpu speed and amount of memory for linux, macosx, windows and solaris. http://spike-asset-mgr.spikesource.com/ matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster way to do this...

2005-03-01 Thread Harlin Seritt
Excellent point Warren. I have been working with Python for about 3 years in all, but only really seriously for about a year. I am still utterly amazed that near everything that takes me about 5 to 20 lines of code can be done in 1, 2 or 3 lines of Python code (when done correctly). It is very frus

Re: ListMixin (WAS: How do you control _all_ items added to a list?)

2005-03-01 Thread Raymond Hettinger
[Nick Coghlan] > > Hmm, it might be nice if there was a UserList.ListMixin that was the > > counterpart to UserDict.DictMixin [Steven Bethard] > I've thought this occasionally too. One of the tricky issues though is > that often you'd like to define __getitem__ for single items and have > ListM

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steven Bethard <[EMAIL PROTECTED]> writes: > I'm guessing the * syntax is pretty unlikely to win Guido's > approval. There have been a number of requests[1][2][3] for syntax > like: > x, y, *rest = iterable Oh, it is so wrong that Guido objects to the above. Python needs fully destructurin

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Mar 1)

2005-03-01 Thread Robert Kern
Cameron Laird wrote: Also, has anyone indexed Python bloggers (that is, webloggers of things Pythonic)? Certainly. http://mechanicalcat.net/pyblagg.html http://planetpython.org/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to d

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

2005-03-01 Thread Douglas Alan
"John Machin" <[EMAIL PROTECTED]> writes: >> In Python, >>longString + "" is longString >> evaluates to True. I don't know how you can do nothing more >> gracefully than that. > And also "" + longString is longString > The string + operator provides those graceful *external* results by >

Re: yield_all needed in Python

2005-03-01 Thread Steven Bethard
Douglas Alan wrote: In this case, that is great, since I'd much prefer yield *gen1(arg) than yield_all gen1(arg) I'm guessing the * syntax is pretty unlikely to win Guido's approval. There have been a number of requests[1][2][3] for syntax like: x, y, *rest = iterable for unpacking a va

Jigsaw solver

2005-03-01 Thread bearophileHUGS
This can be interesting: http://science.slashdot.org/science/05/03/01/2340238.shtml Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Hardware specs gathering? - platform independant

2005-03-01 Thread Peter Hansen
Nicky Kotze wrote: I'm trying to figure out if there's a way to gather the computer's specs. At the end it will be scripted into Blender. Does Python have such direct hardware access methods that would be platform indepandant? Define "specs". Specifically, please. :-) Python has access to some t

Re: Communication between python scripts

2005-03-01 Thread Peter Hansen
Do Re Mi chel La Si Do wrote: A socket (TCP) server is more simplist than XML-RPC, and 30 x faster. Is it "more simplist" in terms of reliability? Generally most people writing low-level socket code, even in Python, do an absymal job of it. Far better to avoid reinventing the wheel and use someth

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I found out that doing a re.findall will split up the results into an array, or rather something called a list (looks like an array to me). It may look like an array to you, but it's a list. Python doesn't have arrays, unless you count something like the numarray/Numeric e

Software Developer & Analog IC Engineer Jobs

2005-03-01 Thread jobs
SOFTWARE DEVELOPER Responsibilities: You will be a key member of a project team to develop and deliver core modules of a breakthrough product in a venture capital backed start-up company. You will be responsible for defining, designing and implementing complex software and participate in the deci

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Steve Holden <[EMAIL PROTECTED]> writes: > Guido has generally observed a parsimony about the introduction of > features such as the one you suggest into Python, and in particular > he is reluctant to add new keywords - even in cases like decorators > that cried out for a keyword rather than the u

Re: Non-blocking input on windows, like select in Unix

2005-03-01 Thread Paul Rubin
Jonathan Fine <[EMAIL PROTECTED]> writes: > My question is this: Under Windows, is it possible > to read as many bytes as are available from stdout, > without blocking? I think Windows implements non-blocking i/o calls. However the traditional (to some) Python or Java approach to this problem is

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

2005-03-01 Thread John Machin
Douglas Alan wrote: > "John Machin" <[EMAIL PROTECTED]> writes: > > >>lines = (partialLine + charsJustRead).split(newline) > > > The above line is prepending a short string to what will typically be a > > whole buffer full. There's gotta be a better way to do it. > > If there is, I'm all e

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 1)

2005-03-01 Thread Cameron Laird
Editor's note: "Python-URL!" is minimal. It doesn't support advertisements, we never allow the subscribers' addresses to be used for other purposes, we don't claim infallibility, and we even take a couple weeks off some years. Occasionally, though--not as often as the US enters a shooting war, sa

Re: What's the cost of using hundreds of threads?

2005-03-01 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: . . . >> I've read somewhere (I cann't recall where, though, was it MSDN?) that >> Windows is not well suited to run more than 32 threads per process. Mo

Re: Communication between python scripts

2005-03-01 Thread Do Re Mi chel La Si Do
Hi ! A socket (TCP) server is more simplist than XML-RPC, and 30 x faster. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Communication between python scripts

2005-03-01 Thread Do Re Mi chel La Si Do
Hi ! A socket (TCP) server is very easy, and 30 x faster than XML-RPC. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Anthra Norell
  - Original Message - From: "André Søreng" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Tuesday, March 01, 2005 8:46 PM Subject: Regular Expressions: large amount of or's > > Hi!> > Given a string, I want to find all ocurrences of> certain prede

Re: os.stat('')[stat.ST_INO] on Windows

2005-03-01 Thread "Martin v. Löwis"
Tim Roberts wrote: Are inodes supported on Windows NTFS, FAT, FAT32? No. Inodes are strictly a Unix filesystem concept. I disagree. NTFS MFT records are so similar to inodes that their numbers could well be used in st_ino (except that they are 64-bit quantities, whereas st_ino typically has only

Re: [Python-Dev] Re: python-dev Summary for 2005-01-16 through 2005-01-31

2005-03-01 Thread "Martin v. Löwis"
Steve Holden wrote: Now, the reason for this specific rant is this: I can tell a cry for help when I see one. Brett has done a magnificent job of providing python-dev summaries since Andrew decided he'd had enough, and he is to be congratulated for it. I managed to offload another bunch of work

Re: Validating A User/Password Pair + Getting Groups On Unix

2005-03-01 Thread Kanenas
On Tue, 1 Mar 2005 09:45:26 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: >>> 1) Validate that the password is correct for that user *without >>>actually logging in*. >>> >Kanenas> The 'pwd' module probably won't be able (and won't try) to read >Kanenas> the shadow pass

Make easy money!! NO SCAM!! Please Read!

2005-03-01 Thread sulliman24
NEED QUICK EASY CASH??? Turn $6.00 into $60,000...read this to find out how!!! READING THIS COULD CHANGE YOUR LIFE!!! I found this on a bulletin board like this one and decided to try it. A little while back, I was browsing through a newsgroup, just like you are now, and came across an article simi

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread M.E.Farmer
Your welcome for the help , be sure to pass it on ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some simple coding help

2005-03-01 Thread Steven Bethard
mx2k wrote: Hello @ all, we have written a small program (code below) for our own in-developement rpg system, which is getting values for 4 RPG-Characters and doing some calculations with it. now we're trying hard to find out how to get it working with 'n' Characters, so you will be asked to enter

Re: yield_all needed in Python

2005-03-01 Thread Steve Holden
Douglas Alan wrote: David Eppstein <[EMAIL PROTECTED]> writes: In article <[EMAIL PROTECTED]>, Douglas Alan <[EMAIL PROTECTED]> wrote: Cetainly, if == , I don't see how anything is gained except for a few keystrokes. What's gained is making one's code more readable and maintainable, which is t

Non-blocking input on windows, like select in Unix

2005-03-01 Thread Jonathan Fine
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine under Linux, using select(). But Windows does not support select for files. Only for sockets. Here's a google se

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread [EMAIL PROTECTED]
dir(*) !!! That's beautiful! I was just wanting to know what was available to an object. I was thinking, if there was just something that quickly told me that info I could look through the documentation quicker :D I found the len(*) obscurely mentioned on someones webpage. Thanks for the dir(*) po

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread Steve Holden
[EMAIL PROTECTED] wrote: I found out that doing a re.findall will split up the results into an array, or rather something called a list (looks like an array to me). I'd be set if i could just count the elements in the array but I can't seem to find anything in the documentation on how to : / ... $

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread M.E.Farmer
[EMAIL PROTECTED] wrote: > I found out that doing a re.findall will split up the results into an > array, or rather something called a list (looks like an array to me). > I'd be set if i could just count the elements in the array but I can't > seem to find anything in the documentation on how to :

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
David Eppstein <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Douglas Alan <[EMAIL PROTECTED]> wrote: >> > Cetainly, if > > iterator> == , I don't see how anything >> > is gained except for a few keystrokes. >> What's gained is making one's code more readable and maintainable,

Re: Need help

2005-03-01 Thread Steve Holden
brian wrote: When you say tools, can you give me one in particular that I can install on my server to do what you were mentioning? Good grief, man, are we to believe you are charging people money for running this web server? Do you even know where IIS keeps its logs? I take it you know what code

Re: yield_all needed in Python

2005-03-01 Thread Douglas Alan
Francis Girard <[EMAIL PROTECTED]> writes: > Therefore, the suggestion you make, or something similar, would have > actually ease my learning, at least for me. Yes, I agree 100%. Not having something like "yield_all" hurt my ability to learn to use Python's generators quickly because I figured t

Re: What's the cost of using hundreds of threads?

2005-03-01 Thread Aahz
In article <[EMAIL PROTECTED]>, =?ISO-8859-2?Q?Przemys=B3aw_R=F3=BFycki?= <[EMAIL PROTECTED]> wrote: > >I have written some code, which creates many threads for each connection >('main connection'). The purpose of this code is to balance the load >between several connections ('pipes'). The numb

Re: What's the cost of using hundreds of threads?

2005-03-01 Thread Steve Holden
Jarek Zgoda wrote: Przemysław Różycki napisał(a): - Is there any 'upper boundary' that limits the number of threads? (is it python / OS related) - Is that the sign of 'clumsy programming' - i.e. Is creating so many threads a bad habit? (I must say that it simplified the solution of my problem ve

Re: Noob can't make threads work

2005-03-01 Thread Steve Holden
Grant Edwards wrote: On 2005-03-01, Steve Horsley <[EMAIL PROTECTED]> wrote: t1 = threading.Thread(target=fiddle()) t2 = threading.Thread(target=fiddle()) t1 = threading.Thread(target=fiddle) t2 = threading.Thread(target=fiddle) Doh! Slap that forehead! Of course, I was calling fiddle() and usi

Re: reuse validation logic with descriptors

2005-03-01 Thread Steve Holden
David S. wrote: Steven Bethard gmail.com> writes: David S. wrote: I am looking for a way to implement the same simple validation on many instance attributes and I thought descriptors (http://users.rcn.com/python/download/Descriptor.htm) looked like the right tool. Looks like you're trying to

Re: yield_all needed in Python

2005-03-01 Thread Francis Girard
Oops. I meant "without having" instead of "with having" which is a syntax error. Regards Le mardi 1 Mars 2005 22:53, Francis Girard a ÃcritÂ: > No, this won't do. What is needed is a way to yield the results of a > generator from inside another generator with having to do a for-yield-loop > insi

Re: Module RE, Have a couple questions

2005-03-01 Thread [EMAIL PROTECTED]
Why Microsoft and Windows ? B/c it was actually in the data I was trying to parse (though not something I was needing to parse), I obscured everything except my test search terms *shrugs* I saw something on this group about 'to many "or's"' so I figured it was an option. Thanks for the .splitline

Re: yield_all needed in Python

2005-03-01 Thread Francis Girard
Hi, No, this won't do. What is needed is a way to yield the results of a generator from inside another generator with having to do a for-yield-loop inside the outter generator. Regards, Francis Girard Le mardi 1 Mars 2005 22:35, Adam Przybyla a ÃcritÂ: > ... mayby that way: > ython 2.

Re: Module RE, Have a couple questions

2005-03-01 Thread Francis Girard
Hi, Le mardi 1 Mars 2005 22:15, [EMAIL PROTECTED] a écrit : > Now I don't know this stuff very well but I dont think the code > > > [line for line in document if (line.find('word') != -1 \ > >         and line.find('wordtwo') != -1)] > > would do this as it answers the question in how you thought

Re: Identify and perform actions to data within stated limits

2005-03-01 Thread [EMAIL PROTECTED]
I found out that doing a re.findall will split up the results into an array, or rather something called a list (looks like an array to me). I'd be set if i could just count the elements in the array but I can't seem to find anything in the documentation on how to : / ... -- http://mail.python.or

Re: yield_all needed in Python

2005-03-01 Thread Adam Przybyla
Douglas Alan <[EMAIL PROTECTED]> wrote: > While writing a generator, I was just thinking how Python needs a > "yield_all" statement. With the help of Google, I found a > pre-existing discussion on this from a while back in the Lightweight > Languages mailing list. I'll repost it here in order to

Re: Need help

2005-03-01 Thread brian
When you say tools, can you give me one in particular that I can install on my server to do what you were mentioning? -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Kent Johnson
André Søreng wrote: Hi! Given a string, I want to find all ocurrences of certain predefined words in that string. Problem is, the list of words that should be detected can be in the order of thousands. With the re module, this can be solved something like this: import re r = re.compile("word1|word2

Hardware specs gathering? - platform independant

2005-03-01 Thread Nicky Kotze
Good day I'm trying to figure out if there's a way to gather the computer's specs. At the end it will be scripted into Blender. Does Python have such direct hardware access methods that would be platform indepandant? Thanks Nicky -- http://mail.python.org/mailman/listinfo/python-list

Re: reuse validation logic with descriptors

2005-03-01 Thread David S.
Steven Bethard gmail.com> writes: > > P.S. If you haven't already, you should read > http://users.rcn.com/python/download/Descriptor.htm a couple of times. > It took me until about the third time I read it to really understand > what descriptors were doing. The big thing to remember is that

Re: Module RE, Have a couple questions

2005-03-01 Thread Francis Girard
Hi, This might even be faster since using re.search, we don't need to parse the whole line. Regards, Francis Girard === BEGIN SNAP ## rewords.py import re import sys def iWordsMatch(lines, word, word2): reWordOneTwo = re.compile(r"((%s.*%s)|(%s.*%s))" % (word,

Re: Need help

2005-03-01 Thread Peter Hansen
brian wrote: I totally agreebut that being said...I want to make sure its not something on my server causing the problem. Im on a windows 2003 server. Python runs fine on a Windows 2003 server. Maybe they can package up a stripped version of the code that still reproduces the problem and you c

Re: Module RE, Have a couple questions

2005-03-01 Thread [EMAIL PROTECTED]
I'm still very new to python (my 2nd day atm) but this is what I come up with. First note, I wasn't clear (I reread what I wrote) about my 'word' 'wordtwo' problem. Both words do Not need to be on the same line. But rather say there was Line 4: This is a line Line 5: Yet another one Line 6: its a

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Bill Mill
On Tue, 01 Mar 2005 22:04:15 +0100, André Søreng <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: > > André Søreng wrote: > > > >> > >> Hi! > >> > >> Given a string, I want to find all ocurrences of > >> certain predefined words in that string. Problem is, the list of > >> words that should be dete

Re: Communication between python scripts

2005-03-01 Thread Heiko Wundram
Am Dienstag, 1. März 2005 21:54 schrieb Chris: > Is there a preferred method for having different scripts on different > computers communicate with each other? You have several options at your disposal. 1) Use mail-communication (like you said, a combination of smtplib and poplib/imaplib), 2) h

Re: Communication between python scripts

2005-03-01 Thread André Søreng
Chris wrote: Is there a preferred method for having different scripts on different computers communicate with each other? For example, script A could tell script B that it is done with a certain process. I know how to do this using e-mail, but I would like a more direct method if possible. If

Re: Need help

2005-03-01 Thread brian
I totally agreebut that being said...I want to make sure its not something on my server causing the problem. Im on a windows 2003 server. Let me also throw this into the mixbefore we went down the HTTP post route we first tried to post data directly into MSSQL, but we were getting connecti

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Francis Girard
Le mardi 1 Mars 2005 22:04, André Søreng a écrit : > That is not exactly what I want. It should discover if some of > the predefined words appear as substrings, not only as equal > words. For instance, after matching "word2sgjoisejfisaword1yguyg", word2 > and word1 should be detected. Hi, A lexer

Re: Need help

2005-03-01 Thread Heiko Wundram
Am Dienstag, 1. März 2005 21:53 schrieb brian: > They tell me the error is Recv Timed Out. This sounds like a socket level (TCP/IP stack) error, which might be caused by a malfunctioning gateway or network device (likely), an error in the operating system or network device driver they use (unlik

Re: Communication between python scripts

2005-03-01 Thread Peter Hansen
Chris wrote: Is there a preferred method for having different scripts on different computers communicate with each other? For example, script A could tell script B that it is done with a certain process. I know how to do this using e-mail, but I would like a more direct method if possible. If

Re: Communication between python scripts

2005-03-01 Thread Chris Grebeldinger
There are many ways, for instance you could use SimpleXMLRPCServer and have one app expose a done_process() function, and use that to synchronize. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: large amount of or's

2005-03-01 Thread André Søreng
Kent Johnson wrote: André Søreng wrote: Hi! Given a string, I want to find all ocurrences of certain predefined words in that string. Problem is, the list of words that should be detected can be in the order of thousands. With the re module, this can be solved something like this: import re r = re.

Re: Need help

2005-03-01 Thread Peter Hansen
brian wrote: They tell me the error is Recv Timed Out. It would probably go much faster if "they" were the ones asking the questions and describing their situation. Otherwise it sounds like a case of the blind leading the blind. You don't know the specifics of their situation, and troubleshooting i

Re: Is it possible to specify the size of list at construction?

2005-03-01 Thread Michael Spencer
Anthony Liu wrote: Yes, that's helpful. Thanks a lot. But what if I wanna construct an array of arrays like we do in C++ or Java: myArray [][] Basically, I want to do the following in Python: myArray[0][1] = list1 myArray[1][2] = list2 myArray[2][3] = list3 here you have to be careful to create N

Re: Is it possible to specify the size of list at construction?

2005-03-01 Thread Steven Bethard
Anthony Liu wrote: Yes, that's helpful. Thanks a lot. But what if I wanna construct an array of arrays like we do in C++ or Java: myArray [][] Basically, I want to do the following in Python: myArray[0][1] = list1 myArray[1][2] = list2 myArray[2][3] = list3 How to do this, gurus? You might be able

Communication between python scripts

2005-03-01 Thread Chris
Is there a preferred method for having different scripts on different computers communicate with each other? For example, script A could tell script B that it is done with a certain process. I know how to do this using e-mail, but I would like a more direct method if possible. If my ISP's mail

Re: Module RE, Have a couple questions

2005-03-01 Thread Francis Girard
Le mardi 1 Mars 2005 21:38, Marc Huffnagle a écrit : > My understanding of the second question was that he wanted to find lines > which contained both words but, looking at it again, it could go either > way.  If he wants to find lines that contain both of the words, in any > order, then I don't th

Re: Need help

2005-03-01 Thread brian
They tell me the error is Recv Timed Out. -- http://mail.python.org/mailman/listinfo/python-list

Re: list of all type names

2005-03-01 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Klaus Neuner wrote: > In order to avoid problems in the future, I tried to get the list of > all those names, but I could not find it. Typing ``dir(__builtins__)`` in the interpreter was already mentioned. Next advice is: make sure all those names are highlighted in your

Re: Is it possible to specify the size of list at construction?

2005-03-01 Thread Steven Bethard
Michael Spencer wrote: Anthony Liu wrote: I cannot figure out how to specify a list of a particular size. For example, I want to construct a list of size 10, how do I do this? A list does not have a fixed size (as you probably know) But you can initialize it with 10 somethings > >>> [None]*10 [N

Re: Is it possible to specify the size of list at construction?

2005-03-01 Thread Anthony Liu
Yes, that's helpful. Thanks a lot. But what if I wanna construct an array of arrays like we do in C++ or Java: myArray [][] Basically, I want to do the following in Python: myArray[0][1] = list1 myArray[1][2] = list2 myArray[2][3] = list3 How to do this, gurus? --- Michael Spencer <[EMAIL P

Re: Importing from upper packages

2005-03-01 Thread Henning Kage
Am Tue, 01 Mar 2005 21:45:17 +0100 schrieb Henning Kage: > import library > > class ClassTest( libor.gui.Interface): >pass Sorry, a small mistake: class ClassTest( library.gui.Interface): pass -- http://mail.python.org/mailman/listinfo/python-list

Re: memory leaks with ctypes LoadLibrary ?

2005-03-01 Thread Chris Grebeldinger
So, am I misinterpreting what gc.collect is printing, and there is actually no memory leak? Or if I'm not and there actually is a problem, Is there a better way to use ctypes so that I don't have to modify the module? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >