Re: How to determine that if a folder is empty?

2005-08-09 Thread Scott David Daniels
could ildg wrote: > I want to know this because I want to zip a directory and all of its > sub-files and sub-directories to a zip file. zipfile module of python > will not automatically include the empty directories, so I have to > check if a dir is empty and do this manually Can you make work

Re: MainThread blocks all others

2005-08-09 Thread Bryan Olson
Nodir Gulyamov wrote: > Hello All! > I met some strange situation. In MainThread my program wating changes of > some variable. This variable should be changed in another thread, but loop, > which wait changing variable blocks all other threads. > Code below: > > class class1: > def __ini

Re: MainThread blocks all others

2005-08-09 Thread Bryan Olson
I wrote: > Make self.counter a semaphore. Untested code: A little clean-up. Still untested: import threading class class1: def __init__(self): self.counter = threading.semaphore(0) result = self.doSomeJob() def increaseCounter(self): self.counter.release()

Python supports LSP, does it?

2005-08-09 Thread Andy Leszczynski
wikipedia (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) says: """ Python's support for object oriented programming paradigm is vast. It supports polymorphism [...] fully in the Liskov substitution principle-sense for all objects. """ Just wondering if

Re: Putting function references in a Queue

2005-08-09 Thread Bryan Olson
Richard Townsend wrote: > I've been experimenting putting a reference to a function into a Queue > object and was wondering what actually gets put in the Queue - is it the > function's code object? It's a Python-internal-reference-thingy. > If I read from the Queue in a different module, it a

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Christopher Subich
Grant Edwards wrote: > That would just be sick. I can't imagine anybody on an 8-bit > CPU using FP for a phone number. Nobody on an 8-bit CPU would have a FPU, so I'll guarantee that this is done using only 8 or 16-bit (probably 8) integer math. -- http://mail.python.org/mailman/listinfo/python

Re: Recommendations for CVS systems

2005-08-09 Thread jussij
> I was wondering if anyone could make recomendations/comments > about CVS systems Amoung other things the Zeus for Windows programmer's editor/IDE comes with integrated CVS support: http://www.zeusedit.com/features.html > Most of the developement is Python, but some C, Javascript, > HTML, e

Retaining an object

2005-08-09 Thread sysfault
Hello, I have a function which takes a program name, and I'm using os.popen() to open that program via the syntax: os.popen('pidof var_name', 'r'), but as you know var_name is not expanded within single quotes, I tried using double quotes, and such, but no luck. I was looking for a way to have var_

Re: Creating a virtual file system

2005-08-09 Thread Bryan Olson
Atila Olah wrote: > My question is: How do I implement a virtual partition that acts like a > real file-system and is compleatly transparent to other programs? > Should I make a virtual file allocation table for a FAT32 partition or > simulate an NTFS? Or even further: How do I create a juncti

Re: Retaining an object

2005-08-09 Thread gry
sysfault wrote: > Hello, I have a function which takes a program name, and I'm using > os.popen() to open that program via the syntax: os.popen('pidof var_name', > 'r'), but as you know var_name is not expanded within single quotes, I > tried using double quotes, and such, but no luck. I was lookin

Re: python for microcontrollers

2005-08-09 Thread Peter Hansen
Evil Bastard wrote: > Paul Rubin wrote: >> Pick a different language. > > Maybe I should clean up my forth compiler instead, and get it ready for > the prime time. In searching for an existing Lua virtual machine** for the PIC, following on my previous posting, I came across several references t

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Grant Edwards
On 2005-08-09, Christopher Subich <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> That would just be sick. I can't imagine anybody on an 8-bit >> CPU using FP for a phone number. > > Nobody on an 8-bit CPU would have a FPU, so I'll guarantee that this is > done using only 8 or 16-bit (probab

Re: Import question

2005-08-09 Thread ncf
Hmm...thanks for the replies. Judging by this, it looks like I might still be in a slight perdiciment with doing it all, but time will tell. I wish there were a way I could reference across multiple modules. Well, thanks for your help. Hopefully I'll be able to work out some *simple* solution for

Re: PyQt: Problem finding and showing a record in a QDataBrowser

2005-08-09 Thread Jorge Godoy
Jorge Godoy wrote: > I have created an interface where I have a QDataBrowser and all of its > editing and navigating controls and one of the displayed controls is in a > QSpinBox. > > I have the navigation from current to next and previous records working > fine if I only use the data browser con

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Christopher Subich
Grant Edwards wrote: > And I'll guarantee that the difference between 333- and > 666- has to be more than 1-bit. There's no way that can be > the correct data unless it's something like an index into a > different table or a pointer or something along those lines. Absolutely. I hadn't ev

Module Extension C/CPI Question

2005-08-09 Thread Jeremy Moles
Just a quick question before I waste time doing something that will immediately be disregarded as unacceptable code... :) When using the C API and writing extension modules, how do you normally pass a structure up into the python module? For instance, if I have a structure: typedef struct Foo {

Re: Import question

2005-08-09 Thread Christopher Subich
ncf wrote: > Hmm...thanks for the replies. Judging by this, it looks like I might > still be in a slight perdiciment with doing it all, but time will tell. > I wish there were a way I could reference across multiple modules. > > Well, thanks for your help. Hopefully I'll be able to work out some >

Re: zipped socket

2005-08-09 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > As far as I know, there is not a prefabbed solution for this problem. One > issue that you must solve is the issue of buffering (when must some data you've > written to the compressor really go out to the other side) and the issue of > what to do when a read() or

Re: Retaining an object

2005-08-09 Thread Leif K-Brooks
sysfault wrote: > I'm using os.popen() to open that program via the syntax: > os.popen('pidof var_name', 'r'), but as you know var_name is not > expanded within single quotes, os.popen('pidof %s' % var_name, 'r') -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendations for CVS systems

2005-08-09 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I was wondering if anyone could make recomendations/comments about CVS > systems, their experiences and what perhaps the strengths of each. Perforce. it costs money, but it's worth it. My current client uses subversion, and I generally wind up cursing at it at least on

Re: Import question

2005-08-09 Thread ncf
I've got multiple instances I want globally available in the secondary modules, which can't easily be passed around with every function call without driving me nuts, so I wish to have all variables from the Main module passed to each of the other modules it creates. One such example would be in Ma

Re: Recommendations for CVS systems

2005-08-09 Thread Erik Max Francis
Mike Meyer wrote: > Perforce. it costs money, but it's worth it. My current client uses > subversion, and I generally wind up cursing at it at least once a > day. Perforce is much smarter about merges and dealing with > branches. Also, if you like using Unix tools to do things like search > your s

Re: Import question

2005-08-09 Thread ncf
Crap. Forgot to mention that in some instances, I do want the class definitions to create new instances and such. Sorry :) -- http://mail.python.org/mailman/listinfo/python-list

MultiFile object does not iterate

2005-08-09 Thread David Isaac
Why is a MultiFile object not an iterator? For example if mfp = multifile.MultiFile(fp)I cannot dofor line in mfp: do_somethingRelated:MultiFile.next seems badly named.(Something like next_section would be better.)Is this just historical accident or am I missing the point?Thanks,Alan Isaac -- ht

Re: Recommendations for CVS systems

2005-08-09 Thread François Pinard
[Mike Meyer] > [...] I generally wind up cursing at [subversion] at least once a day. Would you accept elaborating a bit on the motivations of the cursing? Your message says Perforce does nice things, one might fuzzily imply that Subversion is bad or misbehaves on the same, but I do not read any

Re: Python supports LSP, does it?

2005-08-09 Thread Mike Meyer
Andy Leszczynski writes: > wikipedia > (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) > says: > """ > Python's support for object oriented programming paradigm is vast. It > supports polymorphism [...] fully in the Liskov substitution > principle-sense for a

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-09 Thread Ron Adam
[EMAIL PROTECTED] wrote: > I've heard 2 people complain that word 'global' is confusing. > > Perhaps 'modulescope' or 'module' would be better? > > Am I the first peope to have thought of this and suggested it? > > Is this a candidate for Python 3000 yet? > > Chris After reading though some o

Re: Creating a virtual file system

2005-08-09 Thread Jeff Schwab
Bryan Olson wrote: > > Atila Olah wrote: > > My question is: How do I implement a virtual partition that acts like a > > real file-system and is compleatly transparent to other programs? > > Should I make a virtual file allocation table for a FAT32 partition or > > simulate an NTFS? Or even fu

problem with email

2005-08-09 Thread Aubrey Limerick
everytime i log in to my email another site keeps popping up. the same site _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- http://mail

Re: Recommendations for CVS systems

2005-08-09 Thread Mike Meyer
In <[EMAIL PROTECTED]>, François Pinard <[EMAIL PROTECTED]> typed: > [Mike Meyer] > > > [...] I generally wind up cursing at [subversion] at least once a day. > Would you accept elaborating a bit on the motivations of the cursing? > Your message says Perforce does nice things, one might fuzzily im

Is there a way of executing a command in a string?

2005-08-09 Thread Jerry He
Hi, suppose I have the following string cmdstr = "b = lambda s: s*s" Is there a way to execute this string other than copying it onto a file and then importing it? thanks in advance, Jerry __ Do You Yahoo!? Tired of spam? Yahoo! Mail has

Re: Recommendations for CVS systems

2005-08-09 Thread Jeff Schwab
Mike Meyer wrote: > Well, the only thing that subversion does that I'd call bad is leave > turds in my development directory. I'm tired of having to tell > commands to ignore .svn files. Of course, Perforce is the only source > control system I know of that doesn't do this. ClearCase is really goo

Re: Is there a way of executing a command in a string?

2005-08-09 Thread Jeff Schwab
Jerry He wrote: > Hi, > suppose I have the following string > > cmdstr = "b = lambda s: s*s" > > Is there a way to execute this string other than > copying it onto a file and then importing it? >>> exec "b = lambda s: s*s" >>> b at 0x4d69cc> -- http://mail.python.org/mailman/listinfo/p

Re: Creating a virtual file system

2005-08-09 Thread Bryan Olson
Jeff Schwab wrote: > You don't have to pay Microsoft to develop a Windows-compatible > filesystem. See http://ubiqx.org/cifs/. That's a different usage of "filesystem" than what is at issue here. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Bizarre error from help()

2005-08-09 Thread Roy Smith
Can anybody explain this bizarre behavior: - Roy-Smiths-Computer:play$ py Python 2.3.4 (#3, Jun 29 2004, 21:48:03) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> help (isinstance) foos b

Re: Python supports LSP, does it?

2005-08-09 Thread Roy Smith
Andy Leszczynski writes: > Is not LSP more a quality of the desing of class hierachy rather then > language itslef? Comments? I do agree that LSP is more a class hierarchy thing than a language thing. For example, it's easy in Python to write a LSP-violating set of classes: class base: de

RE: Bizarre error from help()

2005-08-09 Thread Delaney, Timothy (Tim)
Roy Smith wrote: > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site.py", line 307, in __call__ > import pydoc > File "/usr/local/lib/python2.3/pydoc.py", line 49, in ? > from string import expandtabs, find, join, lower, split, strip, >

Re: Recommendations for CVS systems

2005-08-09 Thread Roy Smith
Mike Meyer <[EMAIL PROTECTED]> wrote: > My current client uses subversion, and I generally wind up cursing at it > at least once a day. What makes you curse at it? I've never actually used it, just been watching the project for several years. I'd be interested to hear your experiences. -- ht

Re: Recommendations for CVS systems

2005-08-09 Thread Roy Smith
Mike Meyer <[EMAIL PROTECTED]> wrote: > Well, the only thing that subversion does that I'd call bad is leave > turds in my development directory. I'm tired of having to tell > commands to ignore .svn files. Of course, Perforce is the only source > control system I know of that doesn't do this. My

Re: Bizarre error from help()

2005-08-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > Traceback (most recent call last): > > File "", line 1, in ? > > File "/usr/local/lib/python2.3/site.py", line 307, in call > > import pydoc > > File "/usr/local/lib/python2

Re: Recommendations for CVS systems

2005-08-09 Thread Terry Reedy
"Jeffrey E. Forcier" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thirding the Subversion/SVN suggestions. It's generally a newer, better > CVS with some new features and a lot less of the negative features/lack > thereof, of the older system. For what it is worth, the Python de

Re: Bizarre error from help()

2005-08-09 Thread Roy Smith
Roy Smith <[EMAIL PROTECTED]> wrote: > No, that works fine. But, now I can't even reproduce the error I reported > earlier (when I try, I get the help message as expected). And, yes, that > was with a brand new interpreter session. Strange. I got it now! Oh, this is funny. I've got a directo

Re: Bizarre error from help()

2005-08-09 Thread Leif K-Brooks
Roy Smith wrote: > No, that works fine. But, now I can't even reproduce the error I reported > earlier (when I try, I get the help message as expected). And, yes, that > was with a brand new interpreter session. Strange. Perhaps you were running Python from a directory with a file called strin

RE: Recommendations for CVS systems

2005-08-09 Thread Delaney, Timothy (Tim)
Roy Smith wrote: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> Well, the only thing that subversion does that I'd call bad is leave >> turds in my development directory. I'm tired of having to tell >> commands to ignore .svn files. Of course, Perforce is the only source >> control system I know of th

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Bengt Richter
On Tue, 09 Aug 2005 21:50:06 -, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2005-08-09, Scott David Daniels <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: Ex #1) 333- Hex On disk: 00 00 00 80 6a 6e 49 41 Ex #2) 666- Hex On disk: 00 00 00 80 6a 6e 59 41 >>>

Re: Bizarre error from help()

2005-08-09 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> wrote: > I've got a directory where I keep all sorts of little snippets of > python code for testing. When I start up python in that directory, > I get the error I reported. It turns out, I've got a file called > "string.py" in it [...] > > something in the help sys

Re: namespaces

2005-08-09 Thread Simon Burton
I've been needing a module level __getattr__ for some c library wrapping. This has solved the problem: # mymod.py: import sys from new import module class ModuleProxy(module): def __init__( self, name, master ): module.__init__( self, name ) self._master = master self.__dict__["__all

Re: Python supports LSP, does it?

2005-08-09 Thread Jules Dubois
On Tuesday 09 August 2005 17:36, Andy Leszczynski <> (<[EMAIL PROTECTED]>) wrote: > wikipedia > (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) > says: > """ > Python's support for object oriented programming paradigm is vast. It > supports polymorphism [...

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Terry Reedy
"Gregory Piñero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > how references work in Python 'references' are an implementation detail and a metaconcept used to talk about Python but are not part of the language spec itself. > when passing arguments into functions? Python does

Re: Creating a virtual file system

2005-08-09 Thread Jeff Schwab
Bryan Olson wrote: > Jeff Schwab wrote: > > You don't have to pay Microsoft to develop a Windows-compatible > > filesystem. See http://ubiqx.org/cifs/. > > That's a different usage of "filesystem" than what is at issue > here. I agree that you & I are probably discussing different things, but

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Bengt Richter
On Wed, 10 Aug 2005 03:47:06 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >On Tue, 09 Aug 2005 21:50:06 -, Grant Edwards <[EMAIL PROTECTED]> wrote: > >>On 2005-08-09, Scott David Daniels <[EMAIL PROTECTED]> wrote: >>> Grant Edwards wrote: >Ex #1) 333- >Hex On disk: 00 00 00 80 6

Re: Does any one recognize this binary data storage format

2005-08-09 Thread John Machin
Bengt Richter wrote: > On Tue, 09 Aug 2005 21:50:06 -, Grant Edwards <[EMAIL PROTECTED]> wrote: > > >>On 2005-08-09, Scott David Daniels <[EMAIL PROTECTED]> wrote: >> >>>Grant Edwards wrote: >>> >Ex #1) 333- >Hex On disk: 00 00 00 80 6a 6e 49 41 > >Ex #2) 666- >H

Re: Passing arguments to function - (The fundamentals are confusingme)

2005-08-09 Thread Terry Reedy
"Christopher Subich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dennis Lee Bieber wrote: >> In a more simplistic view, I'd reverse the phrasing... The name >> "x" is assigned to the object "y" (implying it is no longer attached to >> whatever used to have the name) I agree tha

Re: Passing arguments to function - (The fundamentals are confusingme)

2005-08-09 Thread Terry Reedy
"Gregory Piñero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >Ahh, so it's a mutable thing. That makes sense that I can't change a >mutable object and thus can't affect it outside of the function. You of course meant immutable, but this is still confused. It is a name-binding

Re: python for microcontrollers

2005-08-09 Thread Evil Bastard
Peter Hansen wrote: > So while it would probably make an > interesting project, and I'm pretty sure it's quite feasible, grabbing > an off the shelf Forth might be a more productive use of your time. Heh, methinks one might be misunderstanding the Forth culture. Forth compilers are like poetry, i

Re: python for microcontrollers

2005-08-09 Thread Evil Bastard
Peter Hansen wrote: > So while it would probably make an > interesting project, and I'm pretty sure it's quite feasible, grabbing > an off the shelf Forth might be a more productive use of your time. Heh, methinks one might be misunderstanding the Forth culture. Forth compilers are like poetry, i

Re: Oreilly CodeZoo

2005-08-09 Thread richard
Jorge Godoy wrote: > A subtree with version numbers could solve the problem of storing > information for old versions when a new one is added. > > With regards to 4, I'd like to see the "Topic" category in the beginning > of the page -- this is what most people search, I guess -- and not at the >

Re: Adding and attribute to an instance

2005-08-09 Thread Jeremy Moles
Hmmm--I would also be interested in knowing the answer to this. I get the exact same behavior as the OP (probably because it's the intended behavior?) On Tue, 2005-08-09 at 14:38 -0700, J wrote: > Hi, > > > I am trying to add new data attributes to my extension classes from > within a script. I

Re: Creating a virtual file system

2005-08-09 Thread Bryan Olson
Jeff Schwab wrote: > I agree that you & I are probably discussing different things, but I > think this is exactly what the OP was seeking. He said: > > > I'm working on a project to implement a simple cross-platform file > > sharing protocol (using Python) that is similar to HTTP, and I >

[no subject]

2005-08-09 Thread barry
The original message was received at Wed, 10 Aug 2005 09:14:22 +0300 from python.org [82.194.226.158] - The following addresses had permanent fatal errors - - Transcript of session follows - ... while talking to python.org.: >>> DATA <<< 400-aturner; -RMS-E-CRE, ACP file create

Re: Oreilly CodeZoo

2005-08-09 Thread Jorge Godoy
richard wrote: > That's a good idea. Unfortunately, changing the sorting of the classifiers > will be fun. Could I ask you to submit an RFE "bug" via the link on the > pypi page? I'll do that tomorrow morning. > Yep, this is related to your other comment regarding my 6th point. Also, I > don't b

Catching stderr output from graphical apps

2005-08-09 Thread Bryan Olson
Here's a module to show stderr output from console-less Python apps, and stay out of the way otherwise. I plan to make a ASPN recipe of it, but I thought I'd run it by this group first. To use it, import the module. That's it. Upon import it will assign sys.stderr. In the normal case, your code

Re: gettext again

2005-08-09 Thread stasz
On Tue, 09 Aug 2005 23:59:26 +0200, cantabile wrote: > stas a écrit : > >> As a reminder, make sure that you install gettext in the namespace >> of your toplevel module. [] > Noticed something : > I must import test2.py AFTER gettext.install('test1') and even then, if > test3.py imports test

<    1   2