Re: Why do descriptors (and thus properties) only work on attributes.

2005-03-01 Thread Steve Holden
Steven Bethard wrote: Steve Holden wrote: Steven Bethard wrote: Antoon Pardon wrote: Can anyone explain why descriptors only work when they are an attribute to an object or class. I think a lot of interesting things one can do with descriptors would be just as interesting if the object stood on

Re: wxPython/IEHtmlWindow documentation (what events are available ?)

2005-03-01 Thread Thomas Ganss
Richard Shea schrieb: 'DOCUMENTCOMPLETE' seems fairly self-explanatory but others such as 'BEFORENAVIGATE2' and 'STATUSTEXTCHANGE' are less guessable. I've looked at (what I think is) the MS documentation but I cannot find references to any of these events - can anyone point me information please

Re: Google Technology

2005-03-01 Thread David Fraser
[EMAIL PROTECTED] wrote: I am just wondering which technologies google is using for gmail and Google Groups??? The short answer: They use computer technology!!! :-) David -- http://mail.python.org/mailman/listinfo/python-list

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

2005-03-01 Thread wes weston
Przemysaw Rycki wrote: Hello, 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 number of spawned threads depends on how many pipes I create (= 2*n+2, where n

Vancouver Python User Group Reminder

2005-03-01 Thread Paul Prescod
Tuesday March 1st is the first Tuesday of the month and the Vancouver Python, Zope and Plone user's group will have its monthly meeting at ActiveState (580 Granville) at 7:00. The topic is GNU Radio and Python. GNU Radio is a free software implementation of Software Defined Radio. Imagine if

Noob can't make threads work

2005-03-01 Thread Steve Horsley
I am trying to start two threads to do some time consuming work. This is my first stab at threading, and it isn't working as I expect. Instead of the threads starting when I call start(), they seem to run the target code as part of the constructor call. Here is my test code... #!/usr/bin/python

Re: yield_all needed in Python

2005-03-01 Thread Jeremy Bowers
On Tue, 01 Mar 2005 12:42:51 -0600, Skip Montanaro wrote: yield expr yield *expr (Mu-hu-ha-ha-ha!) -- http://mail.python.org/mailman/listinfo/python-list

Need some simple coding help

2005-03-01 Thread mx2k
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 a number

Re: Noob can't make threads work

2005-03-01 Thread Grant Edwards
On 2005-03-01, Steve Horsley [EMAIL PROTECTED] wrote: I am trying to start two threads to do some time consuming work. This is my first stab at threading, and it isn't working as I expect. Instead of the threads starting when I call start(), they seem to run the target code as part of the

Re: yield_all needed in Python

2005-03-01 Thread Francis Girard
Hi, You absolutely and definitively have my vote. When I first learned the generators , I was even wondering if there was something wrong in what I do when faced with the sub-generators problem you describe. I was wondering why am I doing this extra for-loop ? Is there something wrong ? Can

Re: class factory example needed (long)

2005-03-01 Thread Kent Johnson
Gary Ruben wrote: OK, I've managed to get this to work with Rainer's method, but I realised it is not the best way to do it, since the methods are being added by the constructor, i.e. they are instance methods. This means that every time a foo object is created, a whole lot of code is being

Re: reuse validation logic with descriptors

2005-03-01 Thread David S.
Steven Bethard steven.bethard at 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

Regular Expressions: large amount of or's

2005-03-01 Thread André Søreng
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: yield_all needed in Python

2005-03-01 Thread Mike C. Fletcher
Skip Montanaro wrote: ... If this idea advances I'd rather see extra syntactic sugar introduced to complement the current yield statement instead of adding a new keyword. It's a bit clumsy to come up with something that will work syntactically since the next token following the yield keyword can

Why does interpreter flub

2005-03-01 Thread syed_saqib_ali
I have a file named testPython.py as shown below. I have shown a trace of the Interpreter Session in which I import the modules from this file using the command: from testPython import * When I do this, and modify a global variable from within a function, it seems that the interpreter is

Re: Module RE, Have a couple questions

2005-03-01 Thread Francis Girard
Le mardi 1 Mars 2005 16:52, Marc Huffnagle a écrit : [line for line in document if (line.find('word') != -1 \ and line.find('wordtwo') != -1)] Hi, Using re might be faster than scanning the same line twice : === begin snap ## rewords.py import re import sys def iWordsMatch(lines,

Re: Regular Expressions: large amount of or's

2005-03-01 Thread Tim Peters
[André Søreng] 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: yield_all needed in Python

2005-03-01 Thread Steven Bethard
Mike C. Fletcher wrote: ... it nicely encapsulates the learning of generators so that when you see yield up front you know something generatish is going on. +1 for generatish as VOTW (Vocabulation of the Week). =) STeVe -- 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 =

Closing dialog window in Tkinter

2005-03-01 Thread Svennglenn
Hi I'm creating a program in Tkinter and I would need help to create a close button for dialog windows. One of my typical dialog windows look like this: def show_window(self): top = Toplevel() Label(top, text=Some text).pack() Label(top, text=Some more text).pack()

Identify and perform actions to data within stated limits

2005-03-01 Thread [EMAIL PROTECTED]
Hi, I've only been using python for two days now but I'm working on it. I have the following text: selectoption/optionoption/option/selectselectoption/option/select My question is how can I specify to only work with the first instance of select.../select via any sort of substitute. If that isn't

Re: Noob can't make threads work

2005-03-01 Thread Steve Horsley
Grant Edwards wrote: On 2005-03-01, Steve Horsley [EMAIL PROTECTED] wrote: I am trying to start two threads to do some time consuming work. This is my first stab at threading, and it isn't working as I expect. Instead of the threads starting when I call start(), they seem to run the target code

Re: Why does interpreter flub

2005-03-01 Thread Peter Hansen
[EMAIL PROTECTED] wrote: from testPython import * When I do this, and modify a global variable from within a function, it seems that the interpreter is unaware of the updated value! Uh... don't do this then. Beginners to Python should never use the from xxx import * form, as this is just one of

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

2005-03-01 Thread Michael Spencer
Steven Bethard wrote: Nick Coghlan wrote: Hmm, it might be nice if there was a UserList.ListMixin that was the counterpart to UserDict.DictMixin 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

Re: yield_all needed in Python

2005-03-01 Thread David Eppstein
In article [EMAIL PROTECTED], Douglas Alan [EMAIL PROTECTED] wrote: Cetainly, if yield_all iterator == for i in iterator: yield i, 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 the one of the

Re: Why does interpreter flub

2005-03-01 Thread Steve Holden
[EMAIL PROTECTED] wrote: I have a file named testPython.py as shown below. I have shown a trace of the Interpreter Session in which I import the modules from this file using the command: from testPython import * When I do this, and modify a global variable from within a function, it seems that

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

2005-03-01 Thread Jarek Zgoda
Przemysaw Rycki 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 very much). I've read

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

2005-03-01 Thread Anthony Liu
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? __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail

Re: reuse validation logic with descriptors

2005-03-01 Thread Michael Spencer
David S. wrote: This still fails to work for instances variables of the class. That is if I use your property in the following: py ...class Flags(object): ...def __init__(self): ... a = singlechar ... you should write that as: class Flags(object): a = singlechar def

Re: Tkinter and Text() widget interactivity ?

2005-03-01 Thread Pierre Quentel
Tonino a écrit : Hi, I have a small Tkinter app that gets data from a socket connection to a server. The app has a Text() widget to display the info that it gets from the socket connection. I have the ability to stop the text at any point. What I want to be able todo is select a line from the

Need help

2005-03-01 Thread brian
I am working with a 3rd party credit card company that is using Python version 2.2.2. They are using the httplib module to post data to my server which is a dedicated server with no firewall or any rate-limiting or DDoS prevention. Every time they try, the first 2 posts are successful and it

Re: Noob can't make threads work

2005-03-01 Thread Grant Edwards
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 using the return

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

2005-03-01 Thread Michael Spencer
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 [None, None, None, None,

Re: memory leaks with ctypes LoadLibrary ?

2005-03-01 Thread Thomas Heller
chris [EMAIL PROTECTED] writes: What is the proper way to use ctypes to access an exported Function in a dll file on windows? I must be missing something because I get memory leaks when I use it: import ctypes import gc gc.enable() gc.set_debug(gc.DEBUG_LEAK) lib =

Re: memory leaks with ctypes LoadLibrary ?

2005-03-01 Thread Thomas Heller
chris [EMAIL PROTECTED] writes: What is the proper way to use ctypes to access an exported Function in a dll file on windows? I must be missing something because I get memory leaks when I use it: import ctypes import gc gc.enable() gc.set_debug(gc.DEBUG_LEAK) lib =

Re: reuse validation logic with descriptors

2005-03-01 Thread Steven Bethard
David S. wrote: Steven Bethard steven.bethard at gmail.com writes: Looks like you're trying to reinvent the property descriptor. Try using the builtin property instead: py def getchar(self): ... if not hasattr(self, '_char'): ... self._char = None ... return self._char ... py

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

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

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

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

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 is

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

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

Re: Communication between python scripts

2005-03-01 Thread Andr Sreng
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 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)

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 detected can be in the order

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

Re: reuse validation logic with descriptors

2005-03-01 Thread David S.
Steven Bethard steven.bethard at 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

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

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

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 I

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.2.3 (#1,

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

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 inside the

Re: reuse validation logic with descriptors

2005-03-01 Thread Steve Holden
David S. wrote: Steven Bethard steven.bethard at 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

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

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

2005-03-01 Thread Steve Holden
Jarek Zgoda wrote: Przemysaw Rycki 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 very

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 number of

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 that

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 yield_all iterator == for i in iterator: yield i, I don't see how anything is gained except for a few keystrokes. What's gained is making one's code more readable

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: 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 [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(*)

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

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 yield_all iterator == for i in iterator: yield i, I don't see how anything is gained except for a few keystrokes. What's gained is making one's code

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

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

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 password file, so

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: os.stat('filename')[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: 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: python-list@python.org 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 predefined

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: 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: 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. Most of

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 to

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

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

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

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

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

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

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 ugly special-case

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

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 destructuring

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 ListMixin

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

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

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: 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+[n]

<    1   2   3   >