What is the method for class destroy

2006-01-15 Thread K Satish
Hi All,   Like __init__ which is called when object instatiated, what is the method when object destroys.   Thanks, Satish.Send instant messages to your online friends http://in.messenger.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

ConfigParser: writes a list but reads a string?

2006-01-15 Thread Terry Carroll
It looks like ConfigParser will accept a list to be writing to the *.ini file; but when reading it back in, it treats it as a string. Example: ### import ConfigParser def whatzit(thingname, thing): print thingname, "value:", thing print thingname, "length:", len(

Re: instance attributes not inherited?

2006-01-15 Thread John M. Gabriele
Dennis Lee Bieber wrote: > On Sun, 15 Jan 2006 20:50:59 -0500, "John M. Gabriele" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>Sorry -- that question I wrote looks a little incomplete: what I meant >>to ask was, how does it help this code to work: >> >> code >

Re: how do "real" python programmers work?

2006-01-15 Thread Linsong
Travis E. Oliphant wrote: >bblais wrote: > > >>In Python, there seems to be a couple ways of doing things. I could >>write it in one window, and from a Unix shell call >> python myscript.py >>and be like C++, but then I lose the interactiveness which makes >>prototypi

Re: instance attributes not inherited?

2006-01-15 Thread John M. Gabriele
Dan Sommers wrote: > [snip] > >>How does it help that Parent.__init__ gets called? That call simply >>would create a temporary Parent object, right? I don't see how it >>should help (even though it *does* indeed work). > > > The __init__ method is an *initializer*, *not* a constructor. By the >

Re: Display of JPEG images from Python

2006-01-15 Thread David
Svien and Michel, Thanks for your help. Much appreciated. David Lees -- http://mail.python.org/mailman/listinfo/python-list

Re: On Numbers

2006-01-15 Thread Dan Bishop
Alex Martelli wrote: > Paul Rubin wrote: > > > Mike Meyer <[EMAIL PROTECTED]> writes: > > > I'd like to work on that. The idea would be that all the numeric types > > > are representations of reals with different properties that make them > > > appropriate for different u

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread R. Bernstein
Fernando Perez <[EMAIL PROTECTED]> writes: > I thought a little about this. One possibility ... Thanks. A sibling thread has the code I'm currently using. > Oh, that's because you're using %run, so your code is in complete control. > What I meant about a restriction ... Okay. > If you are int

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread R. Bernstein
"Ziga Seilnacht" <[EMAIL PROTECTED]> writes: > You should check the getFrameInfo function in zope.interface package: > http://svn.zope.org/Zope3/trunk/src/zope/interface/advice.py?rev=25177&view=markup Thanks! Just looked at that. The logic in the relevant part (if I've extracted this correctly):

Re: [ANN] pysqlite 2.1.0 released

2006-01-15 Thread Alex Martelli
Gerhard Häring <[EMAIL PROTECTED]> wrote: ... > An optimized shortcut has been enabled to retrieve Unicode strings for > non-ASCII data, but bytestrings for non-ASCII text: > > con.text_factory = sqlite.OptimizedUnicode I assume you mean "ASCII text" rather than "non-ASCII text" here? At

Re: how do "real" python programmers work?

2006-01-15 Thread Alex Martelli
Scott David Daniels <[EMAIL PROTECTED]> wrote: > bblais wrote: > > How do experienced python programmers usually do it? Is there a > > "usually" about it, or is it up to personal taste? Are there any > > convenient ways of doing these things? > There are a lot of us who use a test-first process:

Re: On Numbers

2006-01-15 Thread Alex Martelli
Paul Rubin wrote: > Mike Meyer <[EMAIL PROTECTED]> writes: > > I'd like to work on that. The idea would be that all the numeric types > > are representations of reals with different properties that make them > > appropriate for different uses. > > 2+3j? Good point, so

Re: Preventing class methods from being defined

2006-01-15 Thread Alex Martelli
David Hirschfield <[EMAIL PROTECTED]> wrote: > Here's a strange concept that I don't really know how to implement, but > I suspect can be implemented via descriptors or metaclasses somehow: Yeah, a custom metaclass will do it, easily. > I want a class that, when instantiated, only defines certai

Re: Can one class have multiple metaclasses?

2006-01-15 Thread Alex Martelli
David Hirschfield <[EMAIL PROTECTED]> wrote: > Is it possible for one class definition to have multiple metaclasses? > > I don't think it is, but I'm just checking to make sure. You're right, it isn't. > From what I know, you can only define "__metaclass__" to set the > metaclass for a class,

Re: Preventing class methods from being defined

2006-01-15 Thread David Hirschfield
I should have explicitly mentioned that I didn't want this particular solution, for a number of silly reasons. Is there another way to make this work, without needing to place an explicit "if allowed" around each method definition? Thanks again, -David Dan Sommers wrote: >On Sun, 15 Jan 2006 1

Re: Preventing class methods from being defined

2006-01-15 Thread Dan Sommers
On Sun, 15 Jan 2006 18:41:02 -0800, David Hirschfield <[EMAIL PROTECTED]> wrote: > I want a class that, when instantiated, only defines certain methods > if a global indicates it is okay to have those methods. So I want > something like: > global allow > allow = ["foo","bar"] > class A: > de

Re: instance attributes not inherited?

2006-01-15 Thread Dan Sommers
On Sun, 15 Jan 2006 20:37:36 -0500, "John M. Gabriele" <[EMAIL PROTECTED]> wrote: > David Hirschfield wrote: >> Nothing's wrong with python's oop inheritance, you just need to know >> that the parent class' __init__ is not automatically called from a >> subclass' __init__. Just change your code t

Re: proposal: another file iterator

2006-01-15 Thread Paul Rubin
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > Which is only very slightly longer than your version. I would like > it even more if iter() had been written with the impending doom of > lambda in mind, so that this would work: > > for chunk in iter('', f.read, blocksize): > ... > >

Can one class have multiple metaclasses?

2006-01-15 Thread David Hirschfield
Is it possible for one class definition to have multiple metaclasses? I don't think it is, but I'm just checking to make sure. From what I know, you can only define "__metaclass__" to set the metaclass for a class, and that's it, is that correct? -David -- Presenting: mediocre nebula. -- ht

Re: proposal: another file iterator

2006-01-15 Thread Benji York
Jean-Paul Calderone wrote: > When I just want the dumb version, I tend to write this: > > for chunk in iter(lambda: f.read(blocksize), ''): ... > > Which is only very slightly longer than your version. I would like it > even more if iter() had been written with the impending doom of lam

Preventing class methods from being defined

2006-01-15 Thread David Hirschfield
Here's a strange concept that I don't really know how to implement, but I suspect can be implemented via descriptors or metaclasses somehow: I want a class that, when instantiated, only defines certain methods if a global indicates it is okay to have those methods. So I want something like: gl

Re: proposal: another file iterator

2006-01-15 Thread Raymond Hettinger
Paul Rubin wrote: > I find pretty often that I want to loop through characters in a file: > > while True: > c = f.read(1) > if not c: break > ... > > or sometimes of some other blocksize instead of 1. It would sure > be easier to say something like: > >for c in f.iterbytes():

Re: proposal: another file iterator

2006-01-15 Thread Jean-Paul Calderone
On 15 Jan 2006 16:44:24 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >I find pretty often that I want to loop through characters in a file: > > while True: > c = f.read(1) > if not c: break > ... > >or sometimes of some other blocksize instead of 1. It would sure >be eas

Re: instance attributes not inherited?

2006-01-15 Thread Bengt Richter
On Sun, 15 Jan 2006 18:44:50 -0500, "John M. Gabriele" <[EMAIL PROTECTED]> wrote: >The following short program fails: to do what you intended, but it does not fail to do what you programmed ;-) > > >--- code >#!/usr/bin/python > >class Parent( object )

Re: How to get Windows system information?

2006-01-15 Thread dpickles
For the memory, which of these fields tells you the total amount of RAM? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: instance attributes not inherited?

2006-01-15 Thread John M. Gabriele
John M. Gabriele wrote: > David Hirschfield wrote: > >> Nothing's wrong with python's oop inheritance, you just need to know >> that the parent class' __init__ is not automatically called from a >> subclass' __init__. Just change your code to do that step, and you'll >> be fine: >> >> class Par

Re: New Python.org website ?

2006-01-15 Thread JW
On Sun, 15 Jan 2006 22:19:37 +, Tim Parkin wrote: > http://pyyaml.org/downloads/masterhtml/ > > Feedback appreciated ... Many thanks Again, with FF 1.0.7 (on FC4 Linux BTW), the left column no longer violates the right. However, "View>Page Style>large text" makes the button annotation small

Re: instance attributes not inherited?

2006-01-15 Thread John M. Gabriele
David Hirschfield wrote: > Nothing's wrong with python's oop inheritance, you just need to know > that the parent class' __init__ is not automatically called from a > subclass' __init__. Just change your code to do that step, and you'll be > fine: > > class Parent( object ): > def __init__(

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-15 Thread Tim Peters
[Alex Martelli] ... >> In mathematics, 1 is not "the same" as 1.0 -- there exists a natural >> morphism of integers into reals that _maps_ 1 to 1.0, but they're still >> NOT "the same" thing. And similarly for the real-vs-complex case. [Xavier Morel] > I disagree here, 1 and 1.0 are the same math

Re: How to get Windows system information?

2006-01-15 Thread dpickles
Thank you all! These tips answer my question. I am glad I discovered this group. -- http://mail.python.org/mailman/listinfo/python-list

oss mixer usage

2006-01-15 Thread klappnase
Hi, I am trying to write a mixer program using the ossaudiodev module. I could hardly find any documentation or example code, so I try and ask here. There are two things that seem to work already, however I am not sure if the solutions I found are the way it is supposed to be. First, when on init

proposal: another file iterator

2006-01-15 Thread Paul Rubin
I find pretty often that I want to loop through characters in a file: while True: c = f.read(1) if not c: break ... or sometimes of some other blocksize instead of 1. It would sure be easier to say something like: for c in f.iterbytes(): ... or for c in f.iterbytes(bl

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-15 Thread Andreas Kostyrka
Am Donnerstag, den 05.01.2006, 21:34 -0800 schrieb [EMAIL PROTECTED]: > [EMAIL PROTECTED] wrote: > > Mike> I don't use pdb a lot either - and I write a *lot* of Python. > > > > Ditto. I frequently just insert prints or enable cgitb. Sometimes I enable > > line tracing for a specific function and

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Since python has named parameter(and I assume this PEP would support > it as well), is it really that useful to have these place holder things > ? Probably not so much, you're right. > As when the parameter list gets long, named param should be easier to > read. > > Th

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-15 Thread Andreas Kostyrka
Am Donnerstag, den 05.01.2006, 15:03 -0800 schrieb [EMAIL PROTECTED]: I know this sounds like brutal, but I've been developing Python code for a decade now, and I've almost never used pdb.py. OTOH I also use gdb only for "bt" from a core file. Sorry to sound harsh, I do not consider manually step

Re: Listing partitions (on win32)

2006-01-15 Thread Bengt Richter
On Sun, 15 Jan 2006 08:08:16 -0500, "Roger Upole" <[EMAIL PROTECTED]> wrote: > >"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> On 14 Jan 2006 16:52:33 -0800, "Claude Henchoz" <[EMAIL PROTECTED]> wrote: >> >>>Hi >>> >>>Is there any way of listing partitions on a (win

Re: instance attributes not inherited?

2006-01-15 Thread David Hirschfield
Nothing's wrong with python's oop inheritance, you just need to know that the parent class' __init__ is not automatically called from a subclass' __init__. Just change your code to do that step, and you'll be fine: class Parent( object ): def __init__( self ): self.x = 9 class C

instance attributes not inherited?

2006-01-15 Thread John M. Gabriele
The following short program fails: --- code #!/usr/bin/python class Parent( object ): def __init__( self ): self.x = 9 print "Inside Parent.__init__()" class Child( Parent ): def __init__( self ): print "Inside C

Re: Pythonic wrappers for SQL?

2006-01-15 Thread BartlebyScrivener
Just to chime in with Steve Holden on taking the why-not-learn-SQL route. Chris Fehily's new book, SQL, A Visual QuickStart Guide (2nd Ed) is a masterpiece and goes well on the bookshelf with his equally lucid Python QuickStart Guide. Cheap, too, for what you get. http://www.amazon.com/exec/obido

Re: SPE [was: Wingide is a beautiful application]

2006-01-15 Thread Sybren Stuvel
SPE - Stani's Python Editor enlightened us with: > If you would have read the blog (http://pythonide.stani.be/blog), > you could clearly read this: I haven't. >2. download and unpack the archive >SPE-0.8.1.d-wx2.6.1.0-no_setup.zip > > If you follow these three steps nothing more, nothing

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread Ziga Seilnacht
R. Bernstein wrote: . . . > which is perhaps is a little more honest since one is not really in a > file called . However the way the debugger gets this *is* > still a little hoaky in that it looks for something in the frame's > f_code.co_filename *called* . And from that it *assumes* this > is an

Re: Just want to walk a single directory

2006-01-15 Thread Tim Roberts
SB <[EMAIL PROTECTED]> wrote: >Hi, > >I have a super-simple need to just walk the files in a single directory. > >I thought this would do it, but "permanentFilelist" ends up containing >all folders in all subdirectories. > >Could someone spot the problem? I've scoured some threads using XNews reg

Re: New Python.org website ?

2006-01-15 Thread Tim Parkin
[EMAIL PROTECTED] wrote: > JW wrote: > >>On Fri, 13 Jan 2006 11:00:05 -0600, Tim Chase wrote: >> >> >>>http://tim.thechases.com/pythonbeta/pythonbeta.html >>> >> >>Very strange. With FF 1.0.7, I can just get the buttons to violate the >>next column if I "View>Page Style>Large Text", but I wouldn'

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Paul Rubin
"Mike" <[EMAIL PROTECTED]> writes: > Correct. I didn't quite see the issue as assembly vs. python, having > direct translation to programming hours I figured the day I > upgrade my python, I would write a python script to upgrade the > data. I take my word back. Writing that script sounds pote

Re: On Numbers

2006-01-15 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > I'd like to work on that. The idea would be that all the numeric types > are representations of reals with different properties that make them > appropriate for different uses. 2+3j? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > I'd say a==b doesn't necessarily mean a and b have the same value. > Care to say what it does mean (as opposed to what it doesn't mean), then? a==b simply means that a.__eq__(b) returns True. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Fredrik Lundh
Donn Cave wrote: > | > What's the value of None? Would you say "it has no value" or "it's value > | > is None" or something else? > | > | it has no value (or if you prefer, the set of values is empty). > > Dang, I would have said it does have a value. > > For one thing, in > > if a: >

Clear Thinking Power for Comp Developers

2006-01-15 Thread PeaceFest 05 Campaign HQ
Aloha, It's been 32 years that I've been blessed to be in this industry, and as you all know, mental clarity is always a challenge, especially when working on deadline or when the perfect code arrives(the zone). Well, at 50, i'm finding out that sometimes the old noggin ain't firing on all cylinde

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread Fernando Perez
R. Bernstein wrote: > Fernando Perez <[EMAIL PROTECTED]> writes: >> R. Bernstein wrote: > ... >> > However the frame information for exec or execfile looks like this: >> > File "", line 1, in ? >> >> That comes from how the code object was compiled: > ... >> So any regexp-matching based approac

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Steve Holden
Mike wrote: >>So this question was primarily theoretical, right? > > > Theoretical? not really Steve. I wanted to use django's wonderful db > framework to save a structure into my postgresql. Except there is no > direct BLOB support for it yet. There, I was trying to explore my > options with sav

Re: SPE [was: Wingide is a beautiful application]

2006-01-15 Thread SPE - Stani's Python Editor
Sybren Stuvel wrote: > IMO displayed messages should be clear without having to resort to a > debugging mode. I can agree on that. > Debugging mode should only be for removing bugs, not > for enlightenment of the user. Unless he doesn't follow the installation instructions. > Anyway, apt-getting

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Donn Cave
Quoth "Fredrik Lundh" <[EMAIL PROTECTED]>: | Steven D'Aprano wrote: | | > I'm sick of arguing about object, let's use a different example: | > | > >>> id(None) | > 135289128 | > >>> type(None) | > | > | > What's the value of None? Would you say "it has no value" or "it's value | > is None" or some

Re: how do "real" python programmers work?

2006-01-15 Thread fynali
Love it. -- fynali -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Bryan Olson
Mike Meyer wrote: [...] > Actually, what "data type" implies to me is that data have a type. But > skip that for now - what's the data that goes along with an instance > of object? Again, I'm not an expert on 'object'. When a type has a single value instances can take, the value is simply defined

Re: Dynamically changing button text in python

2006-01-15 Thread marijuanated
Thank you very much.I had actually misinterpreted the "textvariable" property for some kind of "storage for each Button". I am actually developing an app where multiple buttons have a single event handler.So i thought the "textvariable" property might be used to store some info about each of the Bu

[ANN] pysqlite 2.1.0 released

2006-01-15 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pysqlite 2.1.0 released === I'm pleased to announce the availability of pysqlite 2.1.0. This is a major release with many new features and some internal changes. While the code was tested by a few people who tracked Subversion, use

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
> So this question was primarily theoretical, right? Theoretical? not really Steve. I wanted to use django's wonderful db framework to save a structure into my postgresql. Except there is no direct BLOB support for it yet. There, I was trying to explore my options with saving this structure in cle

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread bonono
Giovanni Bajo wrote: > Ronald Mai wrote: > > > Here is a reference implementation: > > > > _ = lambda x: x.pop(0) > > > > def partial(func, *args, **keywords): > > def newfunc(*fargs, **fkeywords): > > newkeywords = keywords.copy() > > newkeywords.update(fkeywords)

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Steve Holden
Mike wrote: >>Well, the Cookbook isn't an exhaustive list of everything you can do >>with Python, it's just a record of some of the things people *have* done. > > > Considering I am a newbie, it's a good start for me... > > >>I presume your database has no datatype that will store binary data o

Re: socket.gethostbyaddr() question

2006-01-15 Thread Steve Holden
Harlin Seritt wrote: > I have a list of IP addresses I am testing with socket.gethostbyaddr(). > For the most part, I am able to get a hostname returned to me when I > run gethostbyaddr(). I am also hoping this will allow me to tell if a > computer is up or down. However, in my environment, I am fi

Tomcat authentication from python

2006-01-15 Thread Michael Oliver
I need to access tomcat applications from python, some are Axis/SOAP web services, and some are file/WebDAV operations.   But so far I cannot get python to authenticate and access http://localhost:8080/manager/html much less to any of the other applications.   I have found examples for

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
> Well, the Cookbook isn't an exhaustive list of everything you can do > with Python, it's just a record of some of the things people *have* done. Considering I am a newbie, it's a good start for me... > I presume your database has no datatype that will store binary data of > indeterminate length

Re: socket.gethostbyaddr() question

2006-01-15 Thread Roy Smith
"Harlin Seritt" <[EMAIL PROTECTED]> wrote: > I have a list of IP addresses I am testing with socket.gethostbyaddr(). > For the most part, I am able to get a hostname returned to me when I > run gethostbyaddr(). I am also hoping this will allow me to tell if a > computer is up or down. Gethostbyadd

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
> Even faster would be to write your code in assembly, and dump that > ridiculously bloated database and just write everything to raw bytes on > an unformatted disk. Of course, it might take the programmer a thousand > times longer to actually write the program, and there will probably be > hundred

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
> Even faster would be to write your code in assembly, and dump that > ridiculously bloated database and just write everything to raw bytes on > an unformatted disk. Of course, it might take the programmer a thousand > times longer to actually write the program, and there will probably be > hundred

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
Ronald Mai wrote: > Here is a reference implementation: > > _ = lambda x: x.pop(0) > > def partial(func, *args, **keywords): > def newfunc(*fargs, **fkeywords): > newkeywords = keywords.copy() > newkeywords.update(fkeywords) > newargs = (lambda seq: tupl

socket.gethostbyaddr() question

2006-01-15 Thread Harlin Seritt
I have a list of IP addresses I am testing with socket.gethostbyaddr(). For the most part, I am able to get a hostname returned to me when I run gethostbyaddr(). I am also hoping this will allow me to tell if a computer is up or down. However, in my environment, I am finding that I am able to get a

Replacing bidirectional unicode strings/regexps

2006-01-15 Thread Ernst Elzas
Hello, I've tried to write a "sed s/original/replacement/g " -like script, but for dealing with situations where both original and replacement contain a mixture of left to right and right to left text (for now, English and Hebrew) Both the texts can span multiple lines, and the replacement has to

Re: Spanish Translation of any python Book?

2006-01-15 Thread jean-michel bain-cornu
Olaf "El Blanco" wrote: > Maybe there is someone that speak spanish. I need the best spanish book for > learning python. > > Thanks! > > > Hola, Conoces "La lista de python en castellano <[EMAIL PROTECTED]>" ? Si intentas preguntar a ella, se podria que haya otras respuestas que aqui. Un salud

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Fredrik Lundh
Bryan Olson wrote: > >>Python queries objects for their types; it's now a user-visible feature: > >> > >> >>> 'hello'.__class__ > >> > > > > > > To get an object's type, use type(x). This has always been a user- > > visible feature (along with id(x)). > > Commanding that I get it some ot

Re: Placing graphics & text on printed page - jan06call.jpg (0/1)

2006-01-15 Thread Kevin
One option is to create your page as an image file using PIL (which can handle your text and drawing requirements, as well as any pictures/graphics), then print it to a windows printer using my ImagePrintWin module. ImagePrintWin can print to any normal windows printer, and includes an optional GU

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Steven D'Aprano
On Sun, 15 Jan 2006 12:14:16 +0100, Fredrik Lundh wrote: >> Do two instances of Empty have the same value, or is the question >> meaningless? > > Things are a bit mixed up wrt. old-style classes (because they're > implemented in terms of true objects), but if you make that > > >>> class Empt

Re: two questions about thread

2006-01-15 Thread Kevin
The best way to do this is by using a flag or event that the child-threads monitor each loop (or multiple times per loop if it's a long loop). If the flag is set, they exit themselves. The parent thread only has to set the flag to cause the children to die. Kevin. "Bryan Olson" <[EMAIL PROTECT

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > > >>I think the following is correct: an object's identity is not part >>of its value, while its type is. > > > you're wrong. an object's identity, type, and value are three different > and distinct things. If I do: >>> mylist = [17, 24] are myli

Re: Listing partitions (on win32)

2006-01-15 Thread Claude Henchoz
Why I don't want to rely on WMI: I am wanting to use this under Windows PE, and although I can include WMI, I just wanted to find out whether there is a way to not use it. Another thing: I really do want to also get the partitions that do _not_ have an associated drive letter. All in all: I am pr

Re: SPE [was: Wingide is a beautiful application]

2006-01-15 Thread Sybren Stuvel
SPE - Stani's Python Editor enlightened us with: > This is a misinterpretation, SPE failed because of something else. > (As would have become clear if you would have run SPE in the > debugging mode 'python SPE.py --debug'.) IMO displayed messages should be clear without having to resort to a debug

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Bryan Olson <[EMAIL PROTECTED]> writes: >>>Mike Meyer wrote: Bryan Olson <[EMAIL PROTECTED]> writes: >Mike Meyer wrote: >>Bryan Olson writes: >The Python manual's claim there is solidly grounded. The logic >of 'types

Re: [help] how to generate a empty ".MDB" file using python

2006-01-15 Thread Roger Upole
"Denton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all: > I working in MS window environment. Now I want to use a python > script to import some data from CSV file to MDB file. > but I have some problems about creating MDB file in DAO. > > I am using attached code , but the

Re: Listing partitions (on win32)

2006-01-15 Thread Roger Upole
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 14 Jan 2006 16:52:33 -0800, "Claude Henchoz" <[EMAIL PROTECTED]> wrote: > >>Hi >> >>Is there any way of listing partitions on a (win32) computer without >>using WMI? >> > Maybe this will work (I skipped A: and B:, but

Re: Listing partitions (on win32)

2006-01-15 Thread Roger Upole
"Claude Henchoz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > Is there any way of listing partitions on a (win32) computer without > using WMI? > > Cheers, Claude > Using win32file.DeviceIOControl with IOCTL_DISK_GET_DRIVE_LAYOUT as the control code should be able to retri

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sun, 15 Jan 2006 03:11:27 -0500, Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> On Sat, 14 Jan 2006 23:26:40 -0500, Mike Meyer wrote: > I have no problem with that. Some objects are mutable and can change > their value >

Re: csv format to DBase III format

2006-01-15 Thread Thomas Ganss
Hi, >I need to transfer csv format file to DBase III format file. >How do i do it in Python language? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 >> >>>I create a dbf file, it can be opened by Excel but it cannot be opened >>>by Access. Where is the error in my

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-15 Thread R. Bernstein
Fernando Perez <[EMAIL PROTECTED]> writes: > R. Bernstein wrote: ... > > However the frame information for exec or execfile looks like this: > > File "", line 1, in ? > > That comes from how the code object was compiled: ... > So any regexp-matching based approach here is likely to be fairly bri

Re: timeout a process

2006-01-15 Thread Tim Golden
iapain wrote: > Hello, > I am trying to build and infinite loop handler in python 2.4 on windows > platform. The problem is that i want to create a process and forcely > kill/timeout after 2 sec to handle infinite loop in a gcc complied exe > on cygwin. something like below > > os.system("mycpp.exe

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-15 Thread Xavier Morel
Alex Martelli wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: >... >>> 3. If two objects are equal with "==", does that >>> mean their values are the same? >> Almost universally, yes, although if you know enough about how the >> interpreter works "under the hood" you can define the response

Re: New Python.org website ?

2006-01-15 Thread Tim Parkin
Martin Maney wrote: >Nah, it's very simple, if you can let go of the wrong-headed notion >that the web is just like print media. Of course that means you're >unlikely to win any design awards, or even get a lot of commecnts about >how spiffy your web site looks, because all the design geeks will

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Fredrik Lundh
Steven D'Aprano wrote: > I'm sick of arguing about object, let's use a different example: > > >>> id(None) > 135289128 > >>> type(None) > > > What's the value of None? Would you say "it has no value" or "it's value > is None" or something else? it has no value (or if you prefer, the set of value

Re: Listing partitions (on win32)

2006-01-15 Thread Tim Golden
Claude Henchoz wrote: > Hi > > Is there any way of listing partitions on a (win32) computer without > using WMI? It looks as though XP has a command-line utility called diskpart.exe which should be able to do this kind of thing. I've no experience with it myself, but assuming that it outputs info

Why/Why not WMI [was: Listing partitions (on win32)]

2006-01-15 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Tim Golden wrote: >> [EMAIL PROTECTED] wrote: >>> Tim Golden wrote: Claude Henchoz wrote: > Is there any way of listing partitions on a (win32) computer without > using WMI? Not that this answers your question, but why _don't_ you want to use W

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Steven D'Aprano
On Sun, 15 Jan 2006 10:48:22 +0100, Fredrik Lundh wrote: > an object's identity, type, and value are three different > and distinct things. the identity and type are not part of the value. the > type controls *how* to access the value, and needs to be known *before* > you can access the value.

Re: Listing partitions (on win32)

2006-01-15 Thread bonono
Tim Golden wrote: > [EMAIL PROTECTED] wrote: > > Tim Golden wrote: > > > Claude Henchoz wrote: > > > > > > > Is there any way of listing partitions on a (win32) computer without > > > > using WMI? > > > > > > Not that this answers your question, but why _don't_ you > > > want to use WMI? > > > > >

Re: Dynamically changing button text in python

2006-01-15 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The problem is once i set the textvariable property of the button,i > cannot change the text.For example, > > curButton = Button(root,text="Stop Server",textvariable="this") what made you think that setting textvariable to "this" would be a good idea? the textvariable

[FIXED] Re: urllib2.urlopen Progress bar

2006-01-15 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Calling urllib2.urlopen the below mentioned way fixed my problem. try: os.chdir (sSourceDir) block_size = 4096 i = 0 count = 0 temp = urllib2.urlopen(sUrl) headers = temp.info() size = int(header

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Steven D'Aprano
On Sun, 15 Jan 2006 03:11:27 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Sat, 14 Jan 2006 23:26:40 -0500, Mike Meyer wrote: I have no problem with that. Some objects are mutable and can change their value >>> If the object *is* the value, how can it chang

Re: Listing partitions (on win32)

2006-01-15 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Tim Golden wrote: > > Claude Henchoz wrote: > > > > > Is there any way of listing partitions on a (win32) computer without > > > using WMI? > > > > Not that this answers your question, but why _don't_ you > > want to use WMI? > > > > TJG > > >>> import wmi > > Traceback (

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Fredrik Lundh
Bryan Olson wrote: > I think the following is correct: an object's identity is not part > of its value, while its type is. you're wrong. an object's identity, type, and value are three different and distinct things. the identity and type are not part of the value. the type controls *how* to ac

Re: How to get Windows system information?

2006-01-15 Thread Tim Golden
[posting through Google; not sure how it will format] re info on WMI website: please note that the examples I give no the WMI pages are *nowhere near* exhausting what WMI can do. They don't even scratch the surface. And I all too rarely add to them. If you look around the net, you'll find absolut

Python cannot print - Re: Unicode style in win32/PythonWin

2006-01-15 Thread Robert
Neil Hodgson schrieb: > Thomas Heller: > > > Hm, I don't know. I try to avoid converting questionable characters at > > all, if possible. Then, it seems the error-mode doesn't seem to change > > anything with "mbcs" encoding. WinXP, Python 2.4.2 on the console: > > > u"abc\u034adef".encode(

Re: Listing partitions (on win32)

2006-01-15 Thread bonono
Tim Golden wrote: > Claude Henchoz wrote: > > > Is there any way of listing partitions on a (win32) computer without > > using WMI? > > Not that this answers your question, but why _don't_ you > want to use WMI? > > TJG >>> import wmi Traceback (most recent call last): File "", line 1, in -top

Re: Listing partitions (on win32)

2006-01-15 Thread Tim Golden
Claude Henchoz wrote: > Is there any way of listing partitions on a (win32) computer without > using WMI? Not that this answers your question, but why _don't_ you want to use WMI? TJG -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >