Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread Daniel Fetchinson
On 3/9/09, bearophileh...@lycos.com wrote: > See here Daniel Fetchinson: > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/a973de8f3562675c > > But be quite careful in using that stuff, it has some traps. Thanks a lot for all the helpful replies! Yes, I should name the unna

Re: A better way to timeout a class method?

2009-03-09 Thread John O'Hagan
On Mon, 9 Mar 2009, Nick Craig-Wood wrote: > John O'Hagan wrote: > > Is there a concise Pythonic way to write a method with a timeout? > > > > I did this: > > > > class Eg(object): > > > > def get_value(self, timeout): > > > > from threading import Timer > > self.flag =

Re: Windows install to custom location after building from source

2009-03-09 Thread Tim Golden
Martin v. Löwis wrote: AFAICT, it only complained about errors in merging _Validation. I'm not sure whether I get the same errors (I would have to check); those errors can safely be ignored. Good. I also see that it fails to add custom actions into InstallExecuteSequence. I find that puzzling

Menu Interface Problem.

2009-03-09 Thread Paulo Repreza
Hi all, I'm having a little problem in my program Menu Interface. Here is the code: - # Improvement of lists-demolists.py **Includes a MENU interface* menu_item = 0 list = [] # Progr

Re: A Dangling Tk Entry

2009-03-09 Thread r
Walter, Why don't you just explain in simple English exactly what you would like to do. You posts have jumped from "why this" to "why that" and none of your jumping around makes much sense. Typically you want to concentrate on one problem at a time and move in a linear fashion not hop around aimle

Re: Ban Xah Lee

2009-03-09 Thread Lew
s...@netherlands.com wrote: On Mon, 09 Mar 2009 22:08:54 -0400, Lew wrote: Larry Gates wrote: For me, the worst thing is when I'm programming, and a bug *actually* gets on my monitor. In real life, I'm this tough person: a rugged tradesmen. I'm so phobic of bugs that I'll run away screaming

Re: searching strings

2009-03-09 Thread Gabriel Genellina
En Mon, 09 Mar 2009 23:18:50 -0200, Daniel Dalton escribió: I'm writing a program where I search a variable (path), and see if it contains the whole string of variable name so: if name in path: else: One question about this, how can I make it do exactly what it's doing now, exc

Re: A Dangling Tk Entry

2009-03-09 Thread Rhodri James
On Tue, 10 Mar 2009 04:14:51 -, W. eWatson wrote: Marc 'BlackJack' Rintsch wrote: On Mon, 09 Mar 2009 04:22:57 -0700, W. eWatson wrote: Marc 'BlackJack' Rintsch wrote: On Sun, 08 Mar 2009 22:20:09 -0700, W. eWatson wrote: You didn't answer my question why entry is necessary at all.

Re: Is python worth learning as a second language?

2009-03-09 Thread Boštjan Jerko
On 9.3.2009, at 11:43, ZikO wrote: Hi I hope I won't sound trivial with asking my question. I am a C++ programmer and I am thinking of learning something else because I know second language might be very helpful somehow. I have heard a few positive things about Python but I have never wri

Re: Ban Xah Lee

2009-03-09 Thread Luis Gonzalez
On 10 mar, 00:54, Grant Edwards wrote: > On 2009-03-10, Byung-Hee HWANG wrote: > > > "D'Arcy J.M. Cain" writes: > >> Byung-Hee HWANG wrote: > > >>> Don't worry, Xah. At least, my minds is running on your rails. > >>> Please do not stop. BTW, what do you think about using Gnus > >>> instead of G

Re: last and final attempt to search for python ods library.

2009-03-09 Thread Terry Reedy
John Machin wrote: On Mar 10, 6:55 am, Terry Reedy wrote: Krishnakant wrote: I need to merge cells in a spreadsheet and this library won't do that. I think you are confusing process and result. The result is a cell that spans more than one column or row *when displayed*, thus hiding the cell

Re: A Dangling Tk Entry

2009-03-09 Thread W. eWatson
Marc 'BlackJack' Rintsch wrote: On Mon, 09 Mar 2009 04:22:57 -0700, W. eWatson wrote: Marc 'BlackJack' Rintsch wrote: On Sun, 08 Mar 2009 22:20:09 -0700, W. eWatson wrote: You didn't answer my question why entry is necessary at all. The original author thought it was necessary to return entr

Re: Ban Xah Lee

2009-03-09 Thread Grant Edwards
On 2009-03-10, Byung-Hee HWANG wrote: > "D'Arcy J.M. Cain" writes: >> Byung-Hee HWANG wrote: >> >>> Don't worry, Xah. At least, my minds is running on your rails. >>> Please do not stop. BTW, what do you think about using Gnus >>> instead of G2/1.0? >> >> So you are going to repeat his postings

Re: Ban Xah Lee

2009-03-09 Thread David Lyon
On Mon, 09 Mar 2009 20:25:16 -0700, Jürgen Exner wrote: >>I'm certain he's the smartest computer guy on his street. > > Make that "he ist certain, he is the smartest computer guy". Which street? in a modern city? someplace in the developed world? This we need to know -- http://mail.py

Re: Ban Xah Lee

2009-03-09 Thread sln
On Mon, 09 Mar 2009 22:08:54 -0400, Lew wrote: >Larry Gates wrote: >> For me, the worst thing is when I'm programming, and a bug *actually* gets >> on my monitor. In real life, I'm this tough person: a rugged tradesmen. >> I'm so phobic of bugs that I'll run away screaming like a girl. > >I had

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread bearophileHUGS
See here Daniel Fetchinson: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a973de8f3562675c But be quite careful in using that stuff, it has some traps. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-09 Thread J�rgen Exner
Larry Gates wrote: >>> comp.lang.lisp is cool so here Xah participates as a normal contributor. >I'm certain he's the smartest computer guy on his street. Make that "he ist certain, he is the smartest computer guy". jue -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread Ryan Kelly
>Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) > [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> x = { } > >>> x[lambda arg: arg] = 5 > >>> x[lambda arg: arg] > Traceback (most recent call last): > File "", line 1

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread MRAB
Daniel Fetchinson wrote: Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type "help", "copyright", "credits" or "license" for more information. x = { } x[lambda arg: arg] = 5 x[lambda arg: arg] Traceback (most recent call last): File "", line

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread David Stanek
On Mon, Mar 9, 2009 at 11:07 PM, Daniel Fetchinson wrote: > Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) > [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. x = { } x[lambda arg: arg] = 5 x[lambda arg: arg]

Re: Ban Xah Lee

2009-03-09 Thread J�rgen Exner
Dirk Bruere at NeoPax wrote: >Xah Lee wrote: Subject: Ban Xah Lee My vote: YES jue -- http://mail.python.org/mailman/listinfo/python-list

Why is lambda allowed as a key in a dict?

2009-03-09 Thread Daniel Fetchinson
Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = { } >>> x[lambda arg: arg] = 5 >>> x[lambda arg: arg] Traceback (most recent call last): File "", line 1, in KeyError:

Re: Is python worth learning as a second language?

2009-03-09 Thread Tomasz Rola
On Mon, 9 Mar 2009, Bruno Desthuilliers wrote: > Tomasz Rola a écrit : > (snip) > > > I may not be objective (tried Java, hated it after 6 years). > > Arf - only took me 6 months !-) I guess sometimes I need to be knocked really hard ;-/. But it works both ways - I cannot imagine what should J

Re: Ban Xah Lee

2009-03-09 Thread Lew
Christian wrote: ... [Xah Lee] seems to be mostly doing a often highly intelligent monologue ... Really? -- Lew -- http://mail.python.org/mailman/listinfo/python-list

Re: A better way to timeout a class method?

2009-03-09 Thread John O'Hagan
On Mon, 9 Mar 2009, Marco Mariani wrote: > John O'Hagan wrote: > > Is there a concise Pythonic way to write a method with a timeout? > > No need for threading. Just define a signal handler and call > signal.alarm(). > Thanks, that works well in general; but unfortunately the method in question (se

Re: How to extract some text?

2009-03-09 Thread odeits
On Mar 8, 3:50 pm, Oltmans wrote: > On Mar 9, 3:37 am, Chris Rebert wrote: > > > Learn about the methods of the string class > > (str):http://docs.python.org/library/stdtypes.html#id4 > > > You'll probably be most interested in .split() > > OK, thanks I got it. I was trying to use Regex but .spl

Re: Ban Xah Lee

2009-03-09 Thread Lew
Larry Gates wrote: For me, the worst thing is when I'm programming, and a bug *actually* gets on my monitor. In real life, I'm this tough person: a rugged tradesmen. I'm so phobic of bugs that I'll run away screaming like a girl. I had a smudge on my monitor some years ago. It was on the fram

Re: creating a list of all imported modules

2009-03-09 Thread mataap
On Mar 10, 10:01 am, Tim Michelsen wrote: > Hello, > > how do I create a list of all modules imported by my module/script and > which are present in the namespace? > > I am looking for something like %who in Ipython. > > My aim is to create a file for the documentation that shows all > dependencie

Re: Help cleaning up some code

2009-03-09 Thread odeits
On Mar 9, 1:06 am, Dennis Lee Bieber wrote: > On Sun, 8 Mar 2009 19:07:08 -0700 (PDT), odeits > declaimed the following in gmane.comp.python.general: > > > > > i get this error when running that query: > > > sqlite3.OperationalError: LIMIT clause should come after UNION not > > before > >        

Re: searching strings

2009-03-09 Thread Daniel Dalton
On Mon, Mar 09, 2009 at 06:24:24PM -0700, Chris Rebert wrote: > Normalize the case of the strings: > > i.lower() in j.lower() Too easy, thanks very much! Cheers, Daniel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-09 Thread Larry Gates
On Tue, 10 Mar 2009 00:37:50 +, Dirk Bruere at NeoPax wrote: > Kenneth Tilton wrote: >> Dirk Bruere at NeoPax wrote: >>> Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: > Dirk Bruere at NeoPax wrote: >> Well, don't worry - nobody is go

Re: searching strings

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 6:18 PM, Daniel Dalton wrote: > Hi, > > I'm writing a program where I search a variable (path), and see if it > contains the whole string of variable name > so: > if name in path: >   > else: >   > > One question about this, how can I make it do exactly what it's doi

searching strings

2009-03-09 Thread Daniel Dalton
Hi, I'm writing a program where I search a variable (path), and see if it contains the whole string of variable name so: if name in path: else: One question about this, how can I make it do exactly what it's doing now, except ignore case? eg. if I do this: i="A" j="ab" i in j should

Re: Ban Xah Lee

2009-03-09 Thread Byung-Hee HWANG
"D'Arcy J.M. Cain" writes: > On Sun, 08 Mar 2009 18:38:24 +0900 > Byung-Hee HWANG wrote: >> Xah Lee writes: > [snip] >> Don't worry, Xah. At least, my minds is running on your rails. Please do >> not stop. BTW, what do you think about using Gnus instead of G2/1.0? > > So you are going to repeat

Re: Windows install to custom location after building from source

2009-03-09 Thread Martin v. Löwis
> I attach the merge.log output but I'll try to do some > research to understand what's going on here in any case. > In particular it's not clear to me whether the thing > has worked but has just tripped up over some non-essential > part, or whether these are real errors. (I really need > to set up

Re: Do python.org MacOS X dmg installers still only provide 32 bit Python framework?

2009-03-09 Thread Martin v. Löwis
> Does this technical problem go beyond the lack of 64 bit safe tcl/tk, > which is what I understood used to be part of the problem? Yes, it does. See the python-dev archives for details. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-09 Thread Tim Greer
Xah Lee wrote: > Christian wrote: > > On Mar 9, 1:22 pm, Christian wrote: >> XahLeeschrieb:> Of interest: >> >> > • Why Can't You Be Normal? >> > http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html >> >> IMHO the point that you never reply to responds is what makes it >> problematic

Re: Ban Xah Lee

2009-03-09 Thread Dirk Bruere at NeoPax
Kenneth Tilton wrote: Dirk Bruere at NeoPax wrote: Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: Dirk Bruere at NeoPax wrote: Well, don't worry - nobody is going to ban you from Usenet (except possibly the Chinese govt). OTOH, nobody here much cares.

Re: Ban Xah Lee

2009-03-09 Thread Xah Lee
Christian wrote: On Mar 9, 1:22 pm, Christian wrote: > XahLeeschrieb:> Of interest: > > > • Why Can't You Be Normal? > > http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html > > IMHO the point that you never reply to responds is what makes it > problematic. > I have seen 10 or more t

Re: Concurrent tasklets in Stackless Python

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 4:47 PM, Minesh Patel wrote: > On Mon, Mar 9, 2009 at 3:17 PM, Chris Rebert wrote: >> On Mon, Mar 9, 2009 at 3:05 PM, Minesh Patel wrote: >>> Is there a way for multiple tasklets to run in parallel? >> >> Seems doubtful (though I'm not an expert). >> >> From the Wikipedia

RE: Is python worth learning as a second language?

2009-03-09 Thread Delaney, Timothy (Tim)
ZikO wrote: > I am a C++ programmer and I am thinking of learning something else > because I know second language might be very helpful somehow. I have > heard a few positive things about Python but I have never writen any > single line in python so I do not know this language at all. > > Do you t

creating a list of all imported modules

2009-03-09 Thread Tim Michelsen
Hello, how do I create a list of all modules imported by my module/script and which are present in the namespace? I am looking for something like %who in Ipython. My aim is to create a file for the documentation that shows all dependencies of my script on external (3rd party) libraries. T

Re: Sharing objects between processes

2009-03-09 Thread ET
On Mon, 2009-03-09 at 14:57 -0700, Aaron Brady wrote:\ > > import threading > import time > > > class Globals: > cont= True > content= { } > lock_content= threading.Lock( ) > > def read( ): > out= open( 'temp.txt', 'w' ) > while Globals.cont: > with

Re: Concurrent tasklets in Stackless Python

2009-03-09 Thread Minesh Patel
On Mon, Mar 9, 2009 at 3:17 PM, Chris Rebert wrote: > On Mon, Mar 9, 2009 at 3:05 PM, Minesh Patel wrote: >> Is there a way for multiple tasklets to run in parallel? > > Seems doubtful (though I'm not an expert). > > From the Wikipedia article: "Stackless microthreads are managed by the > languag

Re: A better way to timeout a class method?

2009-03-09 Thread Nick Craig-Wood
John O'Hagan wrote: > Is there a concise Pythonic way to write a method with a timeout? > > I did this: > > class Eg(object): > > def get_value(self, timeout): > > from threading import Timer > self.flag = True > > def flag_off(): > self.flag =

Re: docstring reference to another docstring

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 4:17 PM, bdb112 wrote: > Thanks for the quick reply - I expanded it to a working program, > it seems to do the job and works in my actual code (always good).  As > you said, it assumes the called function's class is already defined. > Is there a way around this? (The mo

Re: docstring reference to another docstring

2009-03-09 Thread bdb112
Thanks for the quick reply - I expanded it to a working program, it seems to do the job and works in my actual code (always good). As you said, it assumes the called function's class is already defined. Is there a way around this? (The module was originally ordered "top-down"). class Cl

Re: Eject a Removable USB drive

2009-03-09 Thread Aaron Brady
On Mar 9, 6:08 pm, Mark Hammond wrote: > On 10/03/2009 8:20 AM, Rickey, Kyle W wrote: > > > Thanks for the link! That code has got me on the right track. I've > > almost got it working with one small kink. > > > After the code runs my drive still shows up on Windows Explorer but as a > > removable

Re: Eject a Removable USB drive

2009-03-09 Thread Mark Hammond
On 10/03/2009 8:20 AM, Rickey, Kyle W wrote: Thanks for the link! That code has got me on the right track. I've almost got it working with one small kink. After the code runs my drive still shows up on Windows Explorer but as a removable drive. If I try to double click on it, it tells me to inse

Re: Candidate for a new itertool

2009-03-09 Thread Raymond Hettinger
[prueba] > The data often contains objects with attributes instead of tuples, and > I expect the new namedtuple datatype to be used also as elements of > the list to be processed. > > But I haven't found a nice generalized way for that kind of pattern > that aggregates from a list of one datatype t

Re: A better way to timeout a class method?

2009-03-09 Thread Nick Craig-Wood
Marco Mariani wrote: > John O'Hagan wrote: > > > Is there a concise Pythonic way to write a method with a timeout? > > No need for threading. Just define a signal handler and call signal.alarm(). > > See the example at the end of the page: > > http://docs.python.org/library/signal.html Wo

Re: docstring reference to another docstring

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 3:23 PM, bdb112 wrote: > A function of the class ClusterSet uses a similar function of the > class Cluster to do most of its work.  Its docstring could have so > much in common with that in Cluster that it could be just a line or > two in addition to that of Cluster. > > Is

docstring reference to another docstring

2009-03-09 Thread bdb112
A function of the class ClusterSet uses a similar function of the class Cluster to do most of its work. Its docstring could have so much in common with that in Cluster that it could be just a line or two in addition to that of Cluster. Is there a way for the ClusterSet docstring to tack the Clust

Re: Windows install to custom location after building from source

2009-03-09 Thread Tim Golden
Tim Golden wrote: Martin v. Löwis wrote: Just create an empty one. Won't quite work: merge tries to find full_current_version which is determined (if None) in msi.py from the rather involved current version stuff. Only if you don't pass an msi file on the command line. So I recommend that you

Re: Concurrent tasklets in Stackless Python

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 3:05 PM, Minesh Patel wrote: > Is there a way for multiple tasklets to run in parallel? Seems doubtful (though I'm not an expert). From the Wikipedia article: "Stackless microthreads are managed by the language interpreter itself, not the operating system kernel—context sw

Concurrent tasklets in Stackless Python

2009-03-09 Thread Minesh Patel
Is there a way for multiple tasklets to run in parallel? I have been following the examples in http://members.verizon.net/olsongt/stackless/why_stackless.html but it seems that tasklets block for data or are scheduled and there is no way to run them concurrently. -- Thanks, Minesh Patel -- http:/

Re: last and final attempt to search for python ods library.

2009-03-09 Thread John Machin
On Mar 10, 6:55 am, Terry Reedy wrote: > Krishnakant wrote: > > I need to merge cells in a spreadsheet and this library won't do that. > > I think you are confusing process and result.  The result is a cell that > spans more than one column or row *when displayed*, thus hiding the > cells that wou

Re: Sharing objects between processes

2009-03-09 Thread Aaron Brady
On Mar 9, 4:21 pm, ET wrote: > On Mon, 2009-03-09 at 13:58 -0700, Aaron Brady wrote: > > On Mar 9, 2:17 pm, ET wrote: > > > On Mon, 2009-03-09 at 11:04 -0700, Aaron Brady wrote: snip > > Here's what we have to work with from you: > > > > > > > > The problem, as briefly as possible: > > > > > > >

Re: Is python worth learning as a second language?

2009-03-09 Thread r
On Mar 9, 5:43 am, ZikO wrote: Is python worth learning as a second language? Short answer: Yes Long answer: 'Ye%s' %'s'*1000 -- http://mail.python.org/mailman/listinfo/python-list

parallel/concurrent process in python

2009-03-09 Thread Ommer . Simjee
I'm trying to figure out parallel process python code. Something similar to fork funtion in C. For example, I using sniff tool in scapy to capture packets but i want this to run in the background: --- from scapy.all import * import subprocess import netsnmp pkts=sniff(iface="eth0",filter="UD

Re: Is python worth learning as a second language?

2009-03-09 Thread grocery_stocker
On Mar 9, 1:33 pm, Bruno Desthuilliers wrote: > David Cournapeau a écrit : > > > On Mon, Mar 9, 2009 at 11:33 PM, grocery_stocker wrote: > >> On Mar 9, 5:30 am, Nick Craig-Wood wrote: > >>> Go here > > >>>  http://www.diveintopython.org/ > > >>> Download the PDF or buy the book. > > >> What abou

Re: Sharing objects between processes

2009-03-09 Thread Aaron Brady
On Mar 9, 4:21 pm, ET wrote: > On Mon, 2009-03-09 at 13:58 -0700, Aaron Brady wrote: > > On Mar 9, 2:17 pm, ET wrote: > > > On Mon, 2009-03-09 at 11:04 -0700, Aaron Brady wrote: snip > > Here's what we have to work with from you: > > > > > > > > The problem, as briefly as possible: > > > > > > >

Re: xml input sanitizing method in standard lib?

2009-03-09 Thread Gabriel Genellina
En Mon, 09 Mar 2009 15:30:31 -0200, Petr Muller escribió: Thanks for response and sorry for I wasn't clear first time. I have a heap of data (logs), from which I build a XML document using xml.dom.minidom. In this data, some xml invalid characters may occur - form feed (\x0c) character is one e

Re: Is python worth learning as a second language?

2009-03-09 Thread Bruno Desthuilliers
Tomasz Rola a écrit : (snip) I may not be objective (tried Java, hated it after 6 years). Arf - only took me 6 months !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python worth learning as a second language?

2009-03-09 Thread Bruno Desthuilliers
David Cournapeau a écrit : On Mon, Mar 9, 2009 at 11:33 PM, grocery_stocker wrote: On Mar 9, 5:30 am, Nick Craig-Wood wrote: Go here http://www.diveintopython.org/ Download the PDF or buy the book. What about the stuff on docs.python.org? Isn't that information just as reliable? They d

Re: Sharing objects between processes

2009-03-09 Thread ET
On Mon, 2009-03-09 at 13:58 -0700, Aaron Brady wrote: > On Mar 9, 2:17 pm, ET wrote: > > On Mon, 2009-03-09 at 11:04 -0700, Aaron Brady wrote: > > > On Mar 9, 12:47 pm, ET wrote: > > > > > Message: 2 > > > > > Date: Sun, 8 Mar 2009 12:00:40 -0700 (PDT) > > > > > From: Aaron Brady > > > > > Subje

RE: Eject a Removable USB drive

2009-03-09 Thread Rickey, Kyle W
Thanks for the link! That code has got me on the right track. I've almost got it working with one small kink. After the code runs my drive still shows up on Windows Explorer but as a removable drive. If I try to double click on it, it tells me to insert a disk (see screenshot). So it seems my cod

Re: Read from .csv file

2009-03-09 Thread Grant Edwards
On 2009-03-09, Karnama Ahmad (KTH) wrote: > > Dear all, > > I would be thankfukl if you answer to the following easy question: > > How can I read from a .csv file in Python and save the data in a array > or dictionary. I'd first try using the CSV module. http://www.google.com/search?q=python+csv

Re: Read from .csv file

2009-03-09 Thread Tim Chase
I would be thankfukl if you answer to the following easy question: How can I read from a .csv file in Python and save the data in a array or dictionary. I suspect your teacher expects you to use the "csv" module[1] in the standard library. -tkc [1] http://docs.python.org/library/csv.html

Re: Read from .csv file

2009-03-09 Thread Chris Rebert
On Mon, Mar 9, 2009 at 1:56 PM, Karnama Ahmad (KTH) wrote: > > Dear all, > > I would be thankfukl if you answer to the following easy question: > > How can I read from a .csv file in Python and save the data in a array > or dictionary. Use the `csv` module -- http://docs.python.org/library/csv.ht

Read from .csv file

2009-03-09 Thread Karnama Ahmad (KTH)
Dear all, I would be thankfukl if you answer to the following easy question: How can I read from a .csv file in Python and save the data in a array or dictionary. I look forward hearing from you. Best Regards, Ahmad -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing objects between processes

2009-03-09 Thread Aaron Brady
On Mar 9, 2:17 pm, ET wrote: > On Mon, 2009-03-09 at 11:04 -0700, Aaron Brady wrote: > > On Mar 9, 12:47 pm, ET wrote: > > > > Message: 2 > > > > Date: Sun, 8 Mar 2009 12:00:40 -0700 (PDT) > > > > From: Aaron Brady > > > > Subject: Re: Sharing objects between processes > > > > To: python-l...@py

Re: xml input sanitizing method in standard lib?

2009-03-09 Thread Terry Reedy
Petr Muller wrote: Hi, Thanks for response and sorry for I wasn't clear first time. I have a heap of data (logs), from which I build a XML document using xml.dom.minidom. In this data, some xml invalid characters may occur - form feed (\x0c) character is one example. Is this a hypothetical

Re: Ban Xah Lee

2009-03-09 Thread Kenneth Tilton
Dirk Bruere at NeoPax wrote: Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: Dirk Bruere at NeoPax wrote: Well, don't worry - nobody is going to ban you from Usenet (except possibly the Chinese govt). OTOH, nobody here much cares. So, rant on - it's what

Re: Which Lisp to Learn?

2009-03-09 Thread Tim Greer
Michael Austin wrote: > Arne Vajhøj wrote: >> Xah Lee wrote: >>> For those of you imperative programers who kept on hearing about >>> lisp and is tempted to learn, then, ... >> >> You: >> * consider yourself unfairly treated by various communities >> * post a long drivel about various Lisp flavor

Re: Ban Xah Lee

2009-03-09 Thread Tim Greer
Christian wrote: > Though I think you are misusing the > Usenet. For what you do you should rather write a weblog so people > interested in your monologues could follow them in a place where they > are by definition on topic. I would agree that is the issue in Xah Lee's case as well. I don't kno

Re: create a list of undocumented functions

2009-03-09 Thread Tim Michelsen
Thanks so much. I will try this. May you also have a look at: creating a list of all imported modules http://www.nabble.com/creating-a-list-of-all-imported-modules-to22418347.html Do you have an idea? Thanks & regards, Timmie -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-09 Thread Christian
Xah Lee schrieb: Of interest: • Why Can't You Be Normal? http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html IMHO the point that you never reply to responds is what makes it problematic. I have seen 10 or more threads started by you and in not a single one of those I have seen an

Re: Mapping 64 bit int from C to Python-2.2

2009-03-09 Thread Gabriel Genellina
En Mon, 09 Mar 2009 13:51:59 -0200, Explore_Imagination escribió: I want to map 64 bit integers from C to python. I must use Python 2.2 BUT There is no support for 64 bits integers in Python2.2 (Supported in 2.5). Now the problem is that I have these four variables: unit32_t a,b,c; uint64_t

Re: a potential pep to extend the syntax of for loops

2009-03-09 Thread Terry Reedy
pang wrote: This is a proposal to increase the richness of for loops, only to the extent that it equals that of list and generator comprehensions. This idea has already been proposed and rejected. But discuss away as you wish ;=). tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: last and final attempt to search for python ods library.

2009-03-09 Thread Terry Reedy
Krishnakant wrote: Hi Terry, Well, You did reply i know, but seems i lost that mail some where, My mail client must have messed up the mail. any ways thanks for your reply, Right now I am stuck very badly. The problem is that I am trying python-ooolib and did find the library pritty good. But

Re: Which Lisp to Learn?

2009-03-09 Thread Michael Austin
Arne Vajhøj wrote: Xah Lee wrote: For those of you imperative programers who kept on hearing about lisp and is tempted to learn, then, ... You: * consider yourself unfairly treated by various communities * post a long drivel about various Lisp flavors to newsgroups that are not in any way Li

Re: Mapping 64 bit int from C to Python-2.2

2009-03-09 Thread pruebauno
On Mar 9, 11:51 am, Explore_Imagination wrote: > Hi > > I want to map 64 bit integers from C to python. I must use Python 2.2 > BUT There is no support for 64 bits integers in Python2.2 (Supported > in 2.5). > > Now the problem is that I have these four variables: > > unit32_t a,b,c; > uint64_t w,

No module named _sqlite3

2009-03-09 Thread gert
Testing 3.1 i get this with 3.0 it works python/lib/python3.1/sqlite3/dbapi2.py", line 27, in , ImportError:No module named _sqlite3, -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python worth learning as a second language?

2009-03-09 Thread Tomasz Rola
On Mon, 9 Mar 2009, ZikO wrote: > Hi > [...] > > Do you think python would be good complementary language for C++? Yes, definitely. > Do you think it's worth learning it or let's say try Java? I may not be objective (tried Java, hated it after 6 years). In the long run, I'm afraid Java is go

Re: Sharing objects between processes

2009-03-09 Thread ET
On Mon, 2009-03-09 at 11:04 -0700, Aaron Brady wrote: > On Mar 9, 12:47 pm, ET wrote: > > > Message: 2 > > > Date: Sun, 8 Mar 2009 12:00:40 -0700 (PDT) > > > From: Aaron Brady > > > Subject: Re: Sharing objects between processes > > > To: python-l...@python.org > > > Message-ID: > > ><5514c3d

Re: 2.6.1 - simple division

2009-03-09 Thread Tim Rowe
2009/3/8 : 4 / 5.0 > 0.84 0.8 * 5 > 4.0 > > python 2.6.1 on mac. What the hell is going on here? I know this has already been answered in detail, but one thing that it's easy for those new to floating point issues to miss is that fractions that can be expressed exactly i

Re: Packaging Survey

2009-03-09 Thread Robert Kern
On 2009-03-09 13:52, R. David Murray wrote: "Werner F. Bruhin" wrote: Tarek Ziadé wrote: The Python Langage Summit is coming up. To prepare this event, I have put online a survey you can take to tell us a bit more about you and how you package your Python applications. * Who should take

Re: Eject a Removable USB drive

2009-03-09 Thread MRAB
Rickey, Kyle W wrote: Hello everyone, I would like to be able to eject a usb drive based on drive letter. I've done a bit of googling and came across the CM_Request_Device_Eject function on MSDN (http://msdn.microsoft.com/en-us/library/ms790831.aspx) However, I am not quite sure how to

Re: create a list of undocumented functions

2009-03-09 Thread Gabriel Genellina
En Mon, 09 Mar 2009 15:51:01 -0200, Tim Michelsen escribió: is there a scipt or any other possibility to create a list of all undocumente functions (without docstrings) within a package or at least module? You may customize this to your needs: import inspect def find_undocumented(modu

Re: Packaging Survey

2009-03-09 Thread R. David Murray
"Werner F. Bruhin" wrote: > Tarek Ziadé wrote: > > The Python Langage Summit is coming up. To prepare this event, I have > > put online a survey you can take to tell us a bit more about you and > > how you package your Python applications. > > > > * Who should take the survey : any Python dev

Eject a Removable USB drive

2009-03-09 Thread Rickey, Kyle W
Hello everyone, I would like to be able to eject a usb drive based on drive letter. I've done a bit of googling and came across the CM_Request_Device_Eject function on MSDN (http://msdn.microsoft.com/en-us/library/ms790831.aspx) However, I am not quite sure how to supply the necessary param

Re: Ban Xah Lee

2009-03-09 Thread Dirk Bruere at NeoPax
Larry Gates wrote: On Sun, 08 Mar 2009 04:09:52 +, Dirk Bruere at NeoPax wrote: Dirk Bruere at NeoPax wrote: Well, don't worry - nobody is going to ban you from Usenet (except possibly the Chinese govt). OTOH, nobody here much cares. So, rant on - it's what Usenet is for. ☄ <--- what is

Re: Sharing objects between processes

2009-03-09 Thread Aaron Brady
On Mar 9, 12:47 pm, ET wrote: > > Message: 2 > > Date: Sun, 8 Mar 2009 12:00:40 -0700 (PDT) > > From: Aaron Brady > > Subject: Re: Sharing objects between processes > > To: python-l...@python.org > > Message-ID: > >    <5514c3df-d74e-47d8-93fc-34dd5119e...@c11g2000yqj.googlegroups.com> > > Conten

create a list of undocumented functions

2009-03-09 Thread Tim Michelsen
Hello, is there a scipt or any other possibility to create a list of all undocumente functions (without docstrings) within a package or at least module? Thanks for your help in advance. Regards, Timmie -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing objects between processes

2009-03-09 Thread ET
> Message: 2 > Date: Sun, 8 Mar 2009 12:00:40 -0700 (PDT) > From: Aaron Brady > Subject: Re: Sharing objects between processes > To: python-list@python.org > Message-ID: > <5514c3df-d74e-47d8-93fc-34dd5119e...@c11g2000yqj.googlegroups.com> > Content-Type: text/plain; charset=ISO-8859-1 > >

Re: Sharing objects between processes

2009-03-09 Thread ET
> Message: 1 > Date: Sun, 08 Mar 2009 18:47:09 + > From: Tim Golden > Subject: Re: Sharing objects between processes > Cc: python-list@python.org > Message-ID: <49b412ad.1030...@timgolden.me.uk> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > ET wrote: > > Using the 'with' k

Re: Set & Frozenset?

2009-03-09 Thread Matt Nordhoff
Alan G Isaac wrote: >> Hans Larsen schrieb: >>> How could I "take" an elemment from a set or a frozenset > > > On 3/8/2009 2:06 PM Diez B. Roggisch apparently wrote: >> You iterate over them. If you only want one value, use >> iter(the_set).next() > > > I recall a claim that > >

Re: xml input sanitizing method in standard lib?

2009-03-09 Thread Petr Muller
Hi, > > Is there some method provided in python standard library to sanitize > > strings used as input to xml documents? (=remove form-feeds and whatever > > else). I've searched docs and google, found only 4Suite project. I > > cannot rely on something not in standard lib, so I'm wondering if I'v

Re: Packaging Survey

2009-03-09 Thread Werner F. Bruhin
Tarek Ziadé wrote: The Python Langage Summit is coming up. To prepare this event, I have put online a survey you can take to tell us a bit more about you and how you package your Python applications. * Who should take the survey : any Python developer that packages and distributes his code,

  1   2   >