breaking from loop

2006-02-09 Thread Ritesh Raj Sarraf
Hi, Following is the code: def walk_tree_copy(sRepository, sFile, sSourceDir, bFound = None): try: if sRepository is not None: for name in os.listdir(sRepository): path = os.path.join(sRepository, name) if os.path.isdir(path):

Re: Question about idioms for clearing a list

2006-02-09 Thread Alex Martelli
Bryan Olson <[EMAIL PROTECTED]> wrote: ... > > I agree that emptying is logically the same thing for all of these > > types. Beyond that, they don't seem to have a lot in common. It's ... > > Do you really have a usecase for this? It seems to me that your > > argument is pretty hollow. > > S

Re: Parsing XML scheme (xsd) to python objects

2006-02-09 Thread Chris McDonough
You don't just want to parse the XSD data because there lots of XML parsers for Python. You want to validate documents against the schema, right? I haven't yet seen a good XML schema validator for Python. libxml2 has good bindings for validating XML against RelaxNG schemas. - C Bizarro-02 wr

Re: representing physical units

2006-02-09 Thread Michael Amrhein
Russ schrieb: > I know that python packages are available for representing physical > units, but I am getting frustrated trying to find them and determine > which is the best. > > Rather than just using conventional dimensionless numbers with implicit > units, I would like to have a way to explici

Re: Simple Tkinter app works in Linux, not in Windows

2006-02-09 Thread James Stroud
[EMAIL PROTECTED] wrote: >>I'm inclined to think that its your python installation. It worked for >>me with both the cygwin python (both in the console and in an xterm) and >>it also worked for me with idle using enthought python. I haven't tried >>the active state python. > > > Thanks for giving

Re: Fuzzy Lookups

2006-02-09 Thread name
Gregory Piñero ha scritto: > Wow, that looks excellent. I'll definately try it out. I'm assuming > this is an existing project, e.g. you didn't write it after reading > this thread? Yes it is an existing projects of course ;) Right now I've no time to improve it. I hope that later this summer I

Re: Simple Tkinter app works in Linux, not in Windows

2006-02-09 Thread john . orlando
> I'm inclined to think that its your python installation. It worked for > me with both the cygwin python (both in the console and in an xterm) and > it also worked for me with idle using enthought python. I haven't tried > the active state python. Thanks for giving it a shot. I just checked the

Re: Is Python good for web crawlers?

2006-02-09 Thread Alex Martelli
John J. Lee <[EMAIL PROTECTED]> wrote: ... > I wonder if that little outfit has considered open-sourcing any of > their web client code? What they've open-sourced so far is listed at -- of these, the only crawl/spider is Könguló, so far. Alex -- http://

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Jan Niklas Fingerle <[EMAIL PROTECTED]> wrote: > ...Super is a good tool to use, when dealing with > diamond shape inheritance. In any other case I would use the direct > calls to the base classes. In fact, i've yet to find a non-textbook-case > where I really need

Re: random playing soundfiles according to rating.

2006-02-09 Thread kpp9c
I've been looking at some of the suggested approaches and looked a little at Michael's bit which works well bisect is a module i always struggle with (hee hee) I am intrigued by Ben's solution and Ben's distilled my problem quite nicely, but, welli don't understand what "point" is doing wi

Re: Hi reliability files, writing,reading,maintaining

2006-02-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, John Pote <[EMAIL PROTECTED]> wrote: . . . >The motivation to look at http: is the widespread avaiability of internet >connections and standard servers able to run CGI scripts. In particular the

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Steven Bethard
Jan Niklas Fingerle wrote: > Steven Bethard <[EMAIL PROTECTED]> wrote: >> Personally, I'd call the lack of the super calls in threading.Thread and >> Base bugs. > > It can't be a bug since it wasn't a bug before super was introduced and > you don't wan't to break working Python-2.x-code. Just

Re: read-only attributes

2006-02-09 Thread limodou
On 2/10/06, john peter <[EMAIL PROTECTED]> wrote: > while reading the lib manual, i came across mentions of read-only > attributes. > for example, a method has a read-only attribute (called _im_self ?) for > binding > a class instance to the method. is such a facility available to custom > applic

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
No problem. There are, in fact, ugly class-based methods of doing this. You could assign to an instance's __dict__ dictionary, or -- if the class is a new-style class -- you can call the __setattr__(self, name, value) method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Tkinter app works in Linux, not in Windows

2006-02-09 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hello, > I'm a newbie to Python (literally, within the last two weeks), and I am > playing around with Tkinter to build some simple GUIs. I am attempting > to build a simple class that displays a GIF. Here is the code: > > #start of code > from Tkinter import * > > cl

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Ben Wilson
That's it. I should spend more time R-ingTFM. I kept looking for some class-based solution and there was a built in. Perfectly logical. Thanks, Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
Take a look at the built-in function setattr: http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64 -- http://mail.python.org/mailman/listinfo/python-list

Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Ben Wilson
I would like to dynamically assign object attributes: dict = { a : 1, b : 2, } for key,val in dict : obj.key = val To get: print obj.a 1 I've googled to no effect, or maybe I'm needing to be hit with the appropriately sized clue-by-four. Any assistance would be appreciated. Regards, Ben

read-only attributes

2006-02-09 Thread john peter
while reading the lib manual, i came across mentions of read-only attributes. for example, a method has a read-only attribute (called _im_self ?) for binding a class instance to the method. is such a facility available to custom application code? if so, what do i have to do if i want my applicat

Re: pythonic exec* spawn*

2006-02-09 Thread Rene Pijlman
Daniel Nogradi: >> os.fork() does that (on Mac and Unix). > >Okay, but how? Sorry, fork() is implemented strictly on a 'need to know' basis :-) >It seems to me that if the process which issued os.fork() ends, then >the forked process also ends. No, no, they're not a quantum mechanic photon pair

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread [EMAIL PROTECTED]
Jack Diederich wrote: > liberally snipped out parts > On Thu, Feb 09, 2006 at 03:25:18PM -0800, [EMAIL PROTECTED] wrote: > > Jack Diederich wrote: > > > > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > > > > > > > > > > I've got a reasonably sized list of objects that I'd like to

Re: Question about idioms for clearing a list

2006-02-09 Thread Bryan Olson
Magnus Lycka wrote: > Bryan Olson wrote: > >> The original question was about idioms and understanding, but >> there's more to the case for list.clear. Python is "duck typed". >> Consistency is the key to polymorphism: type X will work as an >> actual parameter if and only if X has the required me

Re: random playing soundfiles according to rating.

2006-02-09 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > But i am stuck on how to do a random chooser that works according to my > idea of choosing according to rating system. It seems to me to be a bit > different that just choosing a weighted choice like so: ... > And i am not sure i want to have to go through what will be

Re: python spawn new process, rout stdin/out

2006-02-09 Thread Farshid Lashkari
Sounds like the popen2 module should suffice. Take a look at the documentation for the module here: http://www.python.org/doc/lib/module-popen2.html -Farshid -- http://mail.python.org/mailman/listinfo/python-list

Re: spell check code

2006-02-09 Thread skip
>> What is the most common way to spell check comments in code? Are >> there any idle plugins or modules that do this? Jason> In Emacs you can use "flyspell-prog-mode" to check strings and Jason> comments automagically. They also both have spell-check menu items that allow you to

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Jack Diederich
liberally snipped out parts On Thu, Feb 09, 2006 at 03:25:18PM -0800, [EMAIL PROTECTED] wrote: > Jack Diederich wrote: > > > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > > > > > > > > I've got a reasonably sized list of objects that I'd like to pull out > > > > > all combination

Re: What editor shall I use?

2006-02-09 Thread Peter Milliken
You might want to have a look at the Python Wiki - it has lots of good information. One topic of interest is on what editors you can use with Python http://wiki.python.org/moin/PythonEditors Otherwise asking a question like "what editor should I use" will invariably generate a response based on wh

Re: pythonic exec* spawn*

2006-02-09 Thread Daniel Nogradi
> >I would like to pass the whole object at once to the second python > >program which should start doing its thing with it while the original > >program should keep running. > > os.fork() does that (on Mac and Unix). > Okay, but how? It seems to me that if the process which issued os.fork() ends,

Simple Tkinter app works in Linux, not in Windows

2006-02-09 Thread john . orlando
Hello, I'm a newbie to Python (literally, within the last two weeks), and I am playing around with Tkinter to build some simple GUIs. I am attempting to build a simple class that displays a GIF. Here is the code: #start of code from Tkinter import * class DisplayPict(Frame): def __init__(s

Re: Determining an operating system's default browser

2006-02-09 Thread [EMAIL PROTECTED]
Larry Bates wrote: > You don't have to determine it. Just os.startfile('page1.html') > and let the OS figure it out. Note that this only works on Windows. -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining an operating system's default browser

2006-02-09 Thread John McMonagle
On Thu, 2006-02-09 at 17:53 -0600, Larry Bates wrote: > You don't have to determine it. Just os.startfile('page1.html') > and let the OS figure it out. Works great for Windows - not available on Unix though. -- This message has been scanned for viruses and dangerous content by MailScanner, an

Re: spell check code

2006-02-09 Thread Jason Earl
rtilley <[EMAIL PROTECTED]> writes: > What is the most common way to spell check comments in code? Are > there any idle plugins or modules that do this? In Emacs you can use "flyspell-prog-mode" to check strings and comments automagically. Just a bit of editor elitism... Jason -- http://mail.p

Re: re.match versus re.findall

2006-02-09 Thread Peter Hansen
JerryB wrote: > I have a string like this: > > invalidStr = "192.168.*.1" > > I want to be sure I don't get a * followed by a number, i.e. I want > invalidStr to be invalid. So I do: > > numberAfterStar = re.compile(r'\*.*\d') > > Now, here's the fun: > > If I run: > if numberAfterStar.findall

Re: Determining an operating system's default browser

2006-02-09 Thread Larry Bates
You don't have to determine it. Just os.startfile('page1.html') and let the OS figure it out. -Larry Bates John McMonagle wrote: > Is there a python module which can determine an operating system's > default web browser application. > > I would like to use it in the following context: I have

Help with os.spawnv

2006-02-09 Thread IamIan
I've had to migrate back to Python 2.1 and am now trying to use os.spawnv to get around a memory leak (either in Python or ArcGIS or both) in a geoprocessing script. This script (Second Script) gets each Ascii file in the workspace, converts it to a raster, sets the spatial reference, and hillshad

Re: Hi reliability files, writing,reading,maintaining

2006-02-09 Thread John Pote
Thanks for all the replies, > > Also, the whole idea of basing reliability on HTTP uploads of 50 bytes > at a time sounds to me a bit ... strained. There *must* be simpler > ways--and simpler goes a long way in the direction of trustworthy. > The motivation to look at http: is the widespread av

Determining an operating system's default browser

2006-02-09 Thread John McMonagle
Is there a python module which can determine an operating system's default web browser application. I would like to use it in the following context: I have a GUI application where all the documentation is written as html pages. I wish to have these html help pages open in the default browser whe

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread [EMAIL PROTECTED]
Jack Diederich wrote: > On Thu, Feb 09, 2006 at 10:23:12AM -0800, [EMAIL PROTECTED] wrote: > > Jack Diederich wrote: > > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > > Hi there, > > > > > > > > I've got a reasonably sized list of objects that I'd like to pull out > > > > all co

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread [EMAIL PROTECTED]
Magnus Lycka wrote: > [EMAIL PROTECTED] wrote: > > Fredrik Lundh wrote: > >>Windows don't support C ? that was a new one. > > > > > > Windows comes with a C compiler? That's news to me. > > It doesn't come with Python either. Both Python and > the compiler etc that you need can be freely download

Re: Tkinter, X-windows and ebay

2006-02-09 Thread Adonis
Bob Greschke wrote: > When you post something on eBay (and other places) you can use a 'browse' > button on a web page to send a picture file from your hard drive to them for > inclusion in your listing. Can the same kind of thing (not the same exact > thing, of course) be done with a Python/Tk

Re: pythonic exec* spawn*

2006-02-09 Thread Rene Pijlman
Daniel Nogradi: >I would like to pass the whole object at once to the second python >program which should start doing its thing with it while the original >program should keep running. os.fork() does that (on Mac and Unix). -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: representing physical units

2006-02-09 Thread Ziga Seilnacht
Russ wrote: > I know that python packages are available for representing physical > units, but I am getting frustrated trying to find them and determine > which is the best. > Where can I find a good package that does this? Thanks. Unum is a special package just for this purpose: http://home.tisc

Re: pythonic exec* spawn*

2006-02-09 Thread dwelch
[EMAIL PROTECTED] wrote: > You could possibly pickle an object and send it, but that could be a > bit messy... > pickle it (or shelve?) and then pass the pickle/shleve filename to the other process as a command line parameter? Not sure if this would work or not, but that's where I would start.

Re: Natural Language Date Processing.

2006-02-09 Thread John McMonagle
On Thu, 2006-02-09 at 09:47 +0100, Michael Amrhein wrote: > Andrew Gwozdziewycz schrieb: > >> You may take a look at http://labix.org/python-dateutil > >> Have fun > >> Michael > >> > > > > Looks like it does a good job parsing dates, but doesn't seem to do > > english dates. I found a javascript

re.match versus re.findall

2006-02-09 Thread JerryB
Hi, I have a string like this: invalidStr = "192.168.*.1" I want to be sure I don't get a * followed by a number, i.e. I want invalidStr to be invalid. So I do: numberAfterStar = re.compile(r'\*.*\d') Now, here's the fun: If I run: if numberAfterStar.findall(invalidStr): print "Found it wi

Re: creat a DOM from an html document

2006-02-09 Thread Xavier Morel
Mark Harrison wrote: > I thought I saw a package that would create a DOM from html, with > allowances that it would do a "best effort" job to parse > non-perfectly formed html. > > Now I can't seem to find this... does anybody have a recommendation > as to a good package to look at? > > Many TIA!

python spawn new process, rout stdin/out

2006-02-09 Thread kmkz89
Hi, I'm trying to make a program that acts as an intermediate between the user and another executable. When my python program is executed, I would like another .exe to be spawned within the python program, and the stdin/stdout to be routed from the user to the program. So if my program is booted i

Re: pythonic exec* spawn*

2006-02-09 Thread Jeremiah
you can use the threads commands -- http://mail.python.org/mailman/listinfo/python-list

Re: jump into the interpreter in a script

2006-02-09 Thread Fredrik Lundh
Carl Friedrich Bolz wrote: > Yes. The "code" module of the stdlib is what you want. put > > import code > code.interact(local=locals()) > > into a point where you would like to have an interpreter prompt. or, as a reusable function: http://effbot.org/librarybook/code.htm (see the third exam

Re: Tkinter, X-windows and ebay

2006-02-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bob Greschke <[EMAIL PROTECTED]> wrote: >When you post something on eBay (and other places) you can use a 'browse' >button on a web page to send a picture file from your hard drive to them for >inclusion in your listing. Can the same kind of thing (not the same ex

Re: get output of cmd-line command under MS windows

2006-02-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bernard Lebel <[EMAIL PROTECTED]> wrote: >You should give a go to os.popen( ). Article >6.1.2 and 6.1.3 in the Python Library doc. > >I recently wrote a program that would create a pipe using the popen() >method, and would enter a while loop. At each iteration, it

Re: Hi reliability files, writing,reading,maintaining

2006-02-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Martin P. Hellwig <[EMAIL PROTECTED]> wrote: >John Pote wrote: > >> So my request: >> 1. Are there any python modules 'out there' that might help in securely >> writing such files. >> 2. Can anyone suggest a book or two on this kind of file management. (These >> kind

Re: pythonic exec* spawn*

2006-02-09 Thread kmkz89
You could possibly pickle an object and send it, but that could be a bit messy... -- http://mail.python.org/mailman/listinfo/python-list

Re: jump into the interpreter in a script

2006-02-09 Thread Carl Friedrich Bolz
Brian Blais wrote: > I was wondering if there is a way to, within a script, jump into the > interpreter. > What I mean is something like the "keyboard" command in Matlab, where the > script > pauses and you get an interpreter prompt, where you can look at variables, > change > their values, etc.

Re: creat a DOM from an html document

2006-02-09 Thread Paul Boddie
John J. Lee wrote: > Mark Harrison <[EMAIL PROTECTED]> writes: > > > Ahh, it's BeautifulSoup... > > Strictly that's not THE DOM, just A document object model. The DOM > proper is a standardised interface, which BeautifulSoup does not > implement. You could build a DOM using BeautifulSoup, though.

Re: Threads and Interpreter death

2006-02-09 Thread Bryan Olson
Rene Pijlman wrote: > Carl J. Van Arsdall: > >>I've been toying with threads a lot lately and I've noticed that if a >>scripting error occurs in a thread the thread dies, but not the process >>that spawned the thread. >> >>Is python supposed to behave this way or is this type of behavior >>acci

Re: ftp: get list of files

2006-02-09 Thread Paul Watson
Lawrence Oluyede wrote: > "eels" <[EMAIL PROTECTED]> writes: > > >>With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I >>need this information at variable yyy. >>How can I resolve this problem? > > > As written in the doc retrlines has an optional parameter (a callback > funct

pythonic exec* spawn*

2006-02-09 Thread Daniel Nogradi
Is it possible to pass a python object to a python program as argument? In my program I would like to start executing an other python program and don't wait until that finishes, only launch it and keep running the original program. The obvious way I can think of it is using the exec* or spawn* fun

Re: CLI

2006-02-09 Thread Carl Cerecke
mwt wrote: > I want to do programmatic terminal commands on unix with python - i.e. > I want my program to issue commands to start and stop scripts, other > programs, etc. I'm sure this must be fairly straightforward, but > haven't been able to find a reference for it. Any help? > Try: pexpect.s

Mental Abuse

2006-02-09 Thread medicaldevicetragedy
My abuser has been using the medical device to harass me the last 4-5 years. I have no idea what type of a device is being used on me. I believe the device is only available to licensed pharmacist(s). I am not very familiar with the intend usage of the device. As I understand, the device can be use

Re: New editions of several Python books.

2006-02-09 Thread David Reed
On Feb 9, 2006, at 3:59 PM, James Stroud wrote: > Magnus Lycka wrote: >> Programming Python, 3rd edition >> by Mark Lutz (Paperback - July 2006) >> >> Never a favourite of mine really, but a popular book... > > This one is like broccoli. Its good for you but it doesn't have > much flavor. > --

Mental Abuse

2006-02-09 Thread khaccountant
My abuser has been using the medical device to harass me the last 4-5 years. I have no idea what type of a device is being used on me. I believe the device is only available to licensed pharmacist(s). I am not very familiar with the intend usage of the device. As I understand, the device can be use

Re: Fuzzy Lookups

2006-02-09 Thread Gregory Piñero
Wow, that looks excellent. I'll definately try it out. I'm assuming this is an existing project, e.g. you didn't write it after reading this thread? -Greg On 2/9/06, name <[EMAIL PROTECTED]> wrote: > Gregory Piñero ha scritto: > : > > If anyone would be kind enough to improve it I'd love to ha

Re: Threads and Interpreter death

2006-02-09 Thread Rene Pijlman
Carl J. Van Arsdall: >I've been toying with threads a lot lately and I've noticed that if a >scripting error occurs in a thread the thread dies, but not the process >that spawned the thread. > >Is python supposed to behave this way or is this type of behavior >accidental? "start_new_thread(func

Re: New editions of several Python books.

2006-02-09 Thread James Stroud
Magnus Lycka wrote: > Programming Python, 3rd edition > by Mark Lutz (Paperback - July 2006) > > Never a favourite of mine really, but a popular book... This one is like broccoli. Its good for you but it doesn't have much flavor. -- http://mail.python.org/mailman/listinfo/python-list

representing physical units

2006-02-09 Thread Russ
I know that python packages are available for representing physical units, but I am getting frustrated trying to find them and determine which is the best. Rather than just using conventional dimensionless numbers with implicit units, I would like to have a way to explicitly represent the units. I

Re: Too Many if Statements?

2006-02-09 Thread slogging_away
It appears it may not be a 'if' statment limitation at all. This is because I added another 800 element array in which to store the various error messages generated when a configuration file error is deteceted based on their severity level. The simple addition of the array caused the same symptom

Re: Fuzzy Lookups

2006-02-09 Thread name
Gregory Piñero ha scritto: : > If anyone would be kind enough to improve it I'd love to have these > features but I'm swamped this week! > > - MD5 checking for find exact matches regardless of name > - Put each set of duplicates in its own subfolder. Done? http://pyfdupes.sourceforge.net/ Bye, l

RE: Too Many if Statements?

2006-02-09 Thread Delaney, Timothy (Tim)
slogging_away wrote: > Delaney, Timothy (Tim) wrote: > >> I'm pretty sure the OP has hit the python script line limit (32767?). > > The script is 4903 lines long. Well blow that idea out of the water. I was then going to suggest looping over tests, but noticed someone else already had. > Sligh

Re: CLI

2006-02-09 Thread Rene Pijlman
mwt: >I want to do programmatic terminal commands on unix with python - i.e. >I want my program to issue commands to start and stop scripts, other >programs, etc. I'm sure this must be fairly straightforward, but >haven't been able to find a reference for it. Any help? http://www.python.org/doc/2.

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Jan Niklas Fingerle
Steven Bethard <[EMAIL PROTECTED]> wrote: > Personally, I'd call the lack of the super calls in threading.Thread and > Base bugs. It can't be a bug since it wasn't a bug before super was introduced and you don't wan't to break working Python-2.x-code. > But __init__() is definitely a tricky c

Re: What editor shall I use?

2006-02-09 Thread Colin J. Williams
Lad wrote: > What editor shall I use if my Python script must contain utf-8 > characters? > I use XP > Thank you for reply > l.b. > I like PyScripter, although it's much more than an editor. http://mmm-experts.com/Products.aspx?ProductId=4 Colin W -- http://mail.python.org/mailman/listinfo/p

Re: What editor shall I use?

2006-02-09 Thread Peter Maas
Lad schrieb: > What editor shall I use if my Python script must contain utf-8 > characters? > I use XP An extremely capable, easy to use and small editor is Neil Hodgson's SciTE. It's my favorite editor on Windows and Linux. There is a Windows installer at http://users.hfx.eastlink.ca/~gisdev/sci

RE: by reference

2006-02-09 Thread Delaney, Timothy (Tim)
Rene Pijlman wrote: > dirvine: >> I would like to create a dictionary based on a variable [...] > > And what seems to be the problem? He forgot to read http://www.catb.org/~esr/faqs/smart-questions.html. And *you* forgot to point him to it ;) Tim Delaney -- http://mail.python.org/mailman/list

Re: Is Python good for web crawlers?

2006-02-09 Thread John J. Lee
[EMAIL PROTECTED] (Alex Martelli) writes: > Magnus Lycka <[EMAIL PROTECTED]> wrote: >... > > I dunno, but there are these two guys, Sergey Brin and Lawrence Page, > > who wrote a web crawler in Python. As far as I understood, they were > > fairly successful with it. I think they called their s

Re: creat a DOM from an html document

2006-02-09 Thread John J. Lee
Mark Harrison <[EMAIL PROTECTED]> writes: > Mark Harrison <[EMAIL PROTECTED]> wrote: > > Now I can't seem to find this... does anybody have a recommendation > > as to a good package to look at? > > Ahh, it's BeautifulSoup... Strictly that's not THE DOM, just A document object model. The DOM pro

Re: New editions of several Python books.

2006-02-09 Thread Magnus Lycka
Aahz wrote: > If you can have _Borland C++ for Dummies_, _Python for Dummies_ makes a > lot more sense. :-/ Well, I guess Borland C++ for Dummies has a genuine purpose, but it could be a very short book. One page where is says: "Don't!" ;^) I guess it's a seal of mainstream approval to get a Dum

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: >>Windows don't support C ? that was a new one. > > > Windows comes with a C compiler? That's news to me. It doesn't come with Python either. Both Python and the compiler etc that you need can be freely downloaded from the internet. I suggest you

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > > [EMAIL PROTECTED] wrote: > > > > > > It is a C extension that does permutations & combinations and is > > > > about 10x faster than doing it in pure python [I'm the author]. > > > > It is also the 3rd result for "python combination" and 5th for >

Re: sys.path and unicode folder names

2006-02-09 Thread Nir Aides
Martin v. Löwis wrote: > Nir Aides wrote: >> If few people use file names not in their respective CP_ACP as you say, >> why did Microsoft bother to make Windows XP a unicode OS? > > Because it simplifies their implementation, in the long run. > >> It is because of this situation that people in no

Re: cursesw+setlocale fixes it!

2006-02-09 Thread Ian Ward
Martin v. Löwis wrote: > That's very easy. Contribute a working patch. That patch should support > all possible situations (e.g. curses is ncurses, and ncursesw is > available, curses is ncurses, and ncursesw is not available, curses > is not ncurses), and submit that patch to sf.net/projects/pytho

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > > It is a C extension that does permutations & combinations and is > > > about 10x faster than doing it in pure python [I'm the author]. > > > It is also the 3rd result for "python combination" and 5th for > > > "python permutaiton" but every m

Re: New editions of several Python books.

2006-02-09 Thread Aahz
In article <[EMAIL PROTECTED]>, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >There is also a "Python for Dummies" on its way at last. (I'm not >sure Python *is* for dummies though. Despite being so easy to learn >and use, it mainly seems to attract smart and experienced people, why >else would Pytho

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Jack Diederich
On Thu, Feb 09, 2006 at 10:23:12AM -0800, [EMAIL PROTECTED] wrote: > Jack Diederich wrote: > > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > > Hi there, > > > > > > I've got a reasonably sized list of objects that I'd like to pull out > > > all combinations of five elements from. Ri

Re: Inserting record with Microsoft Access

2006-02-09 Thread Kelly
"jeffhg582003" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > fields. I am trying to capture the number generated from the insert but > I am not exactly sure how to do that after an insert. Other folks have pointed you to "select @@identity" but I thought I should mention that if you u

Re: Best way of finding terminal width/height?

2006-02-09 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > 2) It also says that it makes sense to continue to read a tty > after you get an EOF. That's not true. Once you get an > EOF on a tty, there's no point in reading it any more: > you'll continue to get an EOF

Re: CLI

2006-02-09 Thread Sybren Stuvel
mwt enlightened us with: > I want to do programmatic terminal commands on unix with python If you want to use a real terminal, search for pty. If you just want to start and stop scripts, check the popen2 module. Sybren -- The problem with the world is stupidity. Not saying there should be a cap

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > It is a C extension that does permutations & combinations and is > > about 10x faster than doing it in pure python [I'm the author]. > > It is also the 3rd result for "python combination" and 5th for > > "python permutaiton" but every month someone posts to c.l.py aski

Re: Pulling all n-sized combinations from a list

2006-02-09 Thread [EMAIL PROTECTED]
Jack Diederich wrote: > On Wed, Feb 08, 2006 at 12:50:19PM -0800, Swroteb wrote: > > Hi there, > > > > I've got a reasonably sized list of objects that I'd like to pull out > > all combinations of five elements from. Right now I have a way to do > > this that's quite slow, but manageable. I know

Re: Test indexers...how do they work?

2006-02-09 Thread [EMAIL PROTECTED]
Raja Raman Sundararajan wrote: > I wanted to know how the algorithm of indexers look like. I have heard > people talking about B-Trees. But this info. is simply know enough. I > would like to know exactly each part of the indexing flow and the > algorightm behind it work. Get the book "Managing Gi

Re: Form1.show()

2006-02-09 Thread Diez B. Roggisch
errmaker schrieb: > hi ! iam newbie on python. > how i can make form1 visible ? form just crated by pyqt > > > > class Form1(QMainWindow): > def __init__(self,parent = None,name = None,fl = 0): > QMainWindow.__init__(self,parent,name,fl) > self.statusBar() > >...

Re: Finding the public callables of self

2006-02-09 Thread Lonnie Princehouse
Ha! I didn't realize that was getmembers' implementation. What a hack ;-) In fact, your way is faster, since getmembers is taking the time to sort its results (presumably so that repeated calls to the same object will yield the same list; I don't think dir has a guaranteed ordering) -- http://

CLI

2006-02-09 Thread mwt
I want to do programmatic terminal commands on unix with python - i.e. I want my program to issue commands to start and stop scripts, other programs, etc. I'm sure this must be fairly straightforward, but haven't been able to find a reference for it. Any help? -- http://mail.python.org/mailman/li

Re: Finding the public callables of self

2006-02-09 Thread Russell Warren
> import inspect > myCallables = [name for name, value in inspect.getmembers(self) if not > name.startswith('_') and callable(value)] Thanks. I forgot about the inspect module. Interestingly, you've also answered my question more than I suspect you know! Check out the code for inspect.getmember

Threads and Interpreter death

2006-02-09 Thread Carl J. Van Arsdall
I've been toying with threads a lot lately and I've noticed that if a scripting error occurs in a thread the thread dies, but not the process that spawned the thread. Is python supposed to behave this way or is this type of behavior accidental? Thanks, Carl -- Carl J. Van Arsdall [EMAIL P

Re: 450 Pound Library Program

2006-02-09 Thread mwt
BTW - I can't find any code examples of how to interrupt a beast like this. A regular ctrl-c doesn't work, since the separate threads just keep executing. Is this a case where you need to iterate through all threads and stop each one individually? How would that look? -- http://mail.python.org/ma

Re: Finding the public callables of self

2006-02-09 Thread bruno at modulix
Sion Arrowsmith wrote: > Russell Warren <[EMAIL PROTECTED]> wrote: (snip) > At first I thought self.__dict__ would do it, but callable methods >>seem to be excluded so I had to resort to dir, and deal with the >>strings it gives me. > > This last sentence suggests to me something like: > > a

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Steven Bethard
Kent Johnson wrote: > Are there any best practice guidelines for when to use > super(Class, self).__init__() > vs > Base.__init__(self) > to call a base class __init__()? > [snip] > > 3. A third fix might be to change both Base and threading.Thread() to > call super(...).__init__(). This mig

Form1.show()

2006-02-09 Thread errmaker
hi ! iam newbie on python. how i can make form1 visible ? form just crated by pyqt class Form1(QMainWindow): def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() if self.MenuBar.findItem(

Re: newbie needs serious help

2006-02-09 Thread Robert Boyd
On 2/9/06, Hunsberger, Joy <[EMAIL PROTECTED]> wrote: > OK. Never used python. I need it to install the Google Sitemap program on > our WindowsServer2003(SE) server. > > I downloaded the Python 2.4.2 msi file, and installed it. > > All went well. Now, I have no idea what to do. > And I tried to

  1   2   >