issue: Permissions in odfpy

2009-05-18 Thread shruti surve
hey, i am using odfpy and generating spreadsheet in open office..but nobody should modify the file..so can anybody tell me how can we give permissions (read only) to spreadsheet in odfpy??..i have change the properties of my normal open office spreadsheet file and made it read only..n also extract

Re: Package problem

2009-05-18 Thread David Cournapeau
On Tue, May 19, 2009 at 2:35 PM, David Lyon wrote: > On Tue, 19 May 2009 13:53:18 +0900, David Cournapeau > wrote: >> Given that nobody has managed to solve this problem, I doubt you will >> find a solution. > > It is solved in other languages.. for example perl.. and delphi I don't know much ab

Re: Question about locals()

2009-05-18 Thread Steven D'Aprano
Sorry for breaking threading, the original post is not being carried by my ISP. On Tue, 19 May 2009, Gökhan SEVER wrote: > Hello, > > Could you please explain why locals() allow me to create variables that > are not legal in Python syntax. Example: locals()['1abc'] = 55. Calling > of 1abc resul

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Chris Rebert
On Mon, May 18, 2009 at 9:35 PM, Lawrence D'Oliveiro wrote: > In message <07e5af6c-d41d-4a4a-8e2e- > f27bc92c9...@f16g2000vbf.googlegroups.com>, Steve Ferg wrote: > >> On the one hand, there are developers who love big IDEs with lots of >> features (code generation, error checking, etc.), and rely

Re: Conceptual flaw in pxdom?

2009-05-18 Thread Stefan Behnel
Paul Boddie wrote: > On 18 Mai, 08:54, Stefan Behnel wrote: >> Emanuele D'Arrigo wrote: >>> I'm looking at pxdom and in particular at its foundation class >>> DOMObject >> I didn't know pxdom, but looking at it now I can see that it hasn't been >> updated since 2006. Not sure if that means that it

Re: Question about locals()

2009-05-18 Thread Terry Reedy
Gökhan SEVER wrote: Hello, Could you please explain why locals() allow me to create variables that are not legal in Python syntax. It doesn't. Example: locals()['1abc'] = 55. Calling of 1abc results with a syntax error. Within a function, locals() is a persistemt dictionary copy of the lo

Re: Subversion commit from Python?

2009-05-18 Thread Jack Trades
On May 19, 12:26 am, Lawrence D'Oliveiro wrote: > In message <2904e7de-0a8d-4697-9c44- > > c83bb5319...@s31g2000vbp.googlegroups.com>, Jack Trades wrote: > > Originally I had the 'data' directory in the same directory as the cgi > > scripts and was using os.system("svn commit"), however I kept run

Re: Package problem

2009-05-18 Thread David Lyon
On Tue, 19 May 2009 13:53:18 +0900, David Cournapeau wrote: > Given that nobody has managed to solve this problem, I doubt you will > find a solution. It is solved in other languages.. for example perl.. and delphi > If there was a reasonable solution, it would have > already been developed.

Re: Question about locals()

2009-05-18 Thread John O'Hagan
On Tue, 19 May 2009, Gökhan SEVER wrote: > Hello, > > Could you please explain why locals() allow me to create variables that are > not legal in Python syntax. Example: locals()['1abc'] = 55. Calling of 1abc > results with a syntax error. Shouldn't it be better to raise an error > during the variab

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread Kalyan Chakravarthy
Hi John I am using Google Spread Sheet with 20 rows of data , OS is Windows XP Python2.6 Actually my requirement is in an web application when user enters User name and Password, back end i needs to check, is it they entered correct user name with password (

Re: Package problem

2009-05-18 Thread David Cournapeau
On Tue, May 19, 2009 at 1:31 PM, David Lyon wrote: > > Hi David, > > I guess paraphrased you are saying "don't touch your packages".. > > To my point of view, the needs of the developer override the > priorities of the O/S house... > > We should expect "old" packages on our systems from the O/S >

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Lawrence D'Oliveiro
In message <07e5af6c-d41d-4a4a-8e2e- f27bc92c9...@f16g2000vbf.googlegroups.com>, Steve Ferg wrote: > On the one hand, there are developers who love big IDEs with lots of > features (code generation, error checking, etc.), and rely on them to > provide the high level of support needed to be reasona

Re: Package problem

2009-05-18 Thread David Lyon
Hi David, I guess paraphrased you are saying "don't touch your packages".. To my point of view, the needs of the developer override the priorities of the O/S house... We should expect "old" packages on our systems from the O/S and have an easier way to update them to whatever we want.. That's

Question about locals()

2009-05-18 Thread Gökhan SEVER
Hello, Could you please explain why locals() allow me to create variables that are not legal in Python syntax. Example: locals()['1abc'] = 55. Calling of 1abc results with a syntax error. Shouldn't it be better to raise an error during the variable creation time? Thank you Gökhan -- http://mail

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Lawrence D'Oliveiro
In message , Ulrich Eckhardt wrote: > If you took a look at Java, you > would notice that the core language syntax is much simpler than Python's. I don't think it is. Look at things like "private" versus "protected" versus "public" with or without "static" and "final", "class" versus "interface"

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread Jeff McNeil
On May 18, 11:45 pm, Wincent wrote: > If you want to write to a csv file, the other option is savetxt in > NumPy module. > > Best > > On May 19, 7:29 am, John Machin wrote: > > > On May 19, 5:12 am, Terry Reedy wrote: > > > > Kalyan Chakravarthy wrote: > > > > Hi All, > > > >              I have

Re: Subversion commit from Python?

2009-05-18 Thread Lawrence D'Oliveiro
In message <2904e7de-0a8d-4697-9c44- c83bb5319...@s31g2000vbp.googlegroups.com>, Jack Trades wrote: > Originally I had the 'data' directory in the same directory as the cgi > scripts and was using os.system("svn commit"), however I kept running > into weird bugs with this method. What bugs? --

Re: A newbie question about some code

2009-05-18 Thread Dave Angel
Jim Qiu wrote: Hi everyone. I am reading a python library code and found something i can not understand. Please help! class Envelope(object): def __init__(self,ta_info): self.ta_info = ta_info def writefilelist(self,ta_list,tofile): for filename in ta_list:

Re: Package problem

2009-05-18 Thread David Cournapeau
On Tue, May 19, 2009 at 1:15 PM, David Cournapeau wrote: > something like virtualenv for packages using autotools. ^^^ Sorry, I meant setuptools here, not autotools David -- http://mail.python.org/mailman/listinfo/python-list

Re: Package problem

2009-05-18 Thread David Cournapeau
On Tue, May 19, 2009 at 4:52 AM, Sverre wrote: > I'm using Ubuntu and some of the packages in the repository are too > old. So I got the thought to remove nearly  all packages downloaded > from the repository and install them with easy_install. Is this a way > to go without greater problems? This

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread Wincent
If you want to write to a csv file, the other option is savetxt in NumPy module. Best On May 19, 7:29 am, John Machin wrote: > On May 19, 5:12 am, Terry Reedy wrote: > > > Kalyan Chakravarthy wrote: > > > Hi All, > > >              I have data in Spread Sheet ( First Name and Last Name), > > >

Re: Adding a Par construct to Python?

2009-05-18 Thread Carl Banks
On May 18, 1:52 pm, jer...@martinfamily.freeserve.co.uk wrote: > As I understand it the reason for the GIL is to prevent problems with > garbage collection in multi-threaded applications. Not really. It's main purpose to prevent context switches from happening in the middle of some C code (essent

Subversion commit from Python?

2009-05-18 Thread Jack Trades
I'm wondering if there's an easy way to do a 'svn commit' on a directory from Python. More Details: I have a wiki-like program that stores its data in a directory that I would like to put under version control to be able to roll back unwanted changes. The program is stored in two directories, a '

Re: A newbie question about some code

2009-05-18 Thread Jim Qiu
On Mon, May 18, 2009 at 5:30 PM, Rhodri James wrote: > On Mon, 18 May 2009 10:18:52 +0100, Jim Qiu > wrote: > > Please check the blue highlighted part, I don't understand how the object >> get the property? >> > > Colours and highlighting don't come across in Usenet postings. Could > you be a

Re: Adding a Par construct to Python?

2009-05-18 Thread Steven D'Aprano
On Mon, 18 May 2009 02:27:06 -0700, jeremy wrote: > However I *do* actually want to add syntax to the language. I think that > 'par' makes sense as an official Python construct - we already have had > this in the Occam programming language for twenty-five years. The reason > for this is ease of us

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread John Machin
On May 19, 5:12 am, Terry Reedy wrote: > Kalyan Chakravarthy wrote: > > Hi All, > >              I have data in Spread Sheet ( First Name and Last Name), > > how can i see  this data  in Python code ( how can i use Spread Sheet as > > Data Store ) . > > I you have a choice, a plain text file is MU

Re: Which C compiler?

2009-05-18 Thread norseman
Emile van Sebille wrote: On 5/18/2009 1:27 PM Jive Dadson said... I love Python, but the update regimen is very frustrating. It's a misery to me why every major release requires new versions of so much application stuff. No other software that I use is like that. When I upgrade Windoze, I

Re: Which C compiler?

2009-05-18 Thread norseman
Jive Dadson wrote: Martin v. Löwis wrote: Jive Dadson wrote: I am using Python 2.4. I need to make a native Python extension for Windows XP. I have both VC++ 6.0 and Visual C++ 2005 Express Edition. Will VC++ 6.0 do the trick? That would be easier for me, because the project is written for t

Re: Photoimage on button appears pixelated when button is disabled

2009-05-18 Thread Dustan
On May 17, 7:11 am, Tim Golden wrote: > Dustan wrote: > > On May 15, 2:59 pm, Dustan wrote: > >> In tkinter, when I place a photoimage on a button and disable the > >> button, the image has background dots scattered through the image. > >> Searching the web, I wasn't able to find any documentatio

Re: Which C compiler?

2009-05-18 Thread Emile van Sebille
On 5/18/2009 1:27 PM Jive Dadson said... I love Python, but the update regimen is very frustrating. It's a misery to me why every major release requires new versions of so much application stuff. No other software that I use is like that. When I upgrade Windoze, I do not have to get new ma

Re: Python code-bloat tool-- warning n00b stuff...

2009-05-18 Thread David Stanek
On Mon, May 18, 2009 at 12:45 PM, david wright > > I would suggest looking into TDD (test driven development). > > This technique would be a good fit to eliminate you feeling of code bloat, in > TDD you only write the necessary amount > of code to make your test pass, hence you never write code th

Re: Context manager, atexit processing, and PEP 3143 DaemonContext.close

2009-05-18 Thread Ben Finney
MRAB writes: > Gunter Henriksen wrote: > > If there is a function which triggers a one-shot switch, I like to > > have a way to find out if it has already been triggered, I prefer to > > have the function tell me if it triggered the switch or not, but I > > would not want that to be by raising an

urllib and keep-alive header

2009-05-18 Thread swellfr
I would like to know if it is possible to create a connection to a web server that keeps the underlying socket alive ( Connection : Keep- Alive header in the HTTP request ) between request ( and can also be closed on request ) Can someone provide me a small example showing it. Thx -- http://mai

Re: Adding a Par construct to Python?

2009-05-18 Thread Paul Boddie
On 18 Mai, 11:27, jer...@martinfamily.freeserve.co.uk wrote: > > Thanks for your responses to my original questions. Thanks for your interesting response! > Paul, thanks for explaining about the pprocess module which appears > very useful. I presume that this is using multiple operating system >

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Dave Angel
Tim Hoffman wrote: Which suggests to me there must be some sort of order of precedence between __contains__ and __getitem__ and 'for' statement must change the order in some manner. Thanks for the reply T (Please don't top-post. It makes reading the quoted portions hard, since they're t

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
On 18 May, 21:07, Terry Reedy wrote: > George Sakkis wrote: > > On May 18, 5:27 am, jer...@martinfamily.freeserve.co.uk wrote: > > >> My suggestion is primarily about using multiple threads and sharing > >> memory - something akin to the OpenMP directives that one of you has > >> mentioned. To do

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
On 18 May, 19:58, George Sakkis wrote: > On May 18, 5:27 am, jer...@martinfamily.freeserve.co.uk wrote: > > > My suggestion is primarily about using multiple threads and sharing > > memory - something akin to the OpenMP directives that one of you has > > mentioned. To do this efficiently would inv

Re: Package problem

2009-05-18 Thread A. Cavallo
On Monday 18 May 2009 20:52:52 Sverre wrote: > I'm using Ubuntu and some of the packages in the repository are too > old. So I got the thought to remove nearly all packages downloaded > from the repository and install them with easy_install. Is this a way > to go without greater problems? If you'

Re: Which C compiler?

2009-05-18 Thread Jive Dadson
Martin v. Löwis wrote: Jive Dadson wrote: I am using Python 2.4. I need to make a native Python extension for Windows XP. I have both VC++ 6.0 and Visual C++ 2005 Express Edition. Will VC++ 6.0 do the trick? That would be easier for me, because the project is written for that one. If not, wi

Re: Advanced Python books?

2009-05-18 Thread python
Take a look at "Text Processing In Python" by David Mertz. This book doesn't cover all your requirements, but its a well-written book that is more comprehensive than its title might indicate. There's also a free version of this book online. Malcolm -- http://mail.python.org/mailman/listinfo/pyth

Re: Advanced Python books?

2009-05-18 Thread UrsusMaximus
You might try Expert Python Programming by Tarek Ziadé. It is a relatively recent book aimed at "experts". There are several reviews of the book linked to from http://www.awaretek.com/ book.html">this page. Ron On May 18, 1:04 pm, kj wrote: > I have read a couple of "learn Python"-type books, a

Re: Adding a Par construct to Python?

2009-05-18 Thread Terry Reedy
George Sakkis wrote: On May 18, 5:27 am, jer...@martinfamily.freeserve.co.uk wrote: My suggestion is primarily about using multiple threads and sharing memory - something akin to the OpenMP directives that one of you has mentioned. To do this efficiently would involve removing the Global Interp

Advanced Python books?

2009-05-18 Thread kj
I have read a couple of "learn Python"-type books, and now I'm looking for some more advanced books on Python, something analogous to "Effective Java" or "High-Order Perl". I've only been able to find "Advanced Python 3 Programming Techniques", which, as far as I can tell, is only available as a

Package problem

2009-05-18 Thread Sverre
I'm using Ubuntu and some of the packages in the repository are too old. So I got the thought to remove nearly all packages downloaded from the repository and install them with easy_install. Is this a way to go without greater problems? -- http://mail.python.org/mailman/listinfo/python-list

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Terry Reedy
Tim Hoffman wrote: [i for i in aa] Traceback (most recent call last): File "", line 1, in ? File "", line 3, in __getitem__ KeyError: 0 Which suggests to me there must be some sort of order of precedence between __contains__ and __getitem__ and 'for' statement must change the order in som

SQLObject 0.9.11

2009-05-18 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.11, a minor bugfix release of 0.9 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy

SQLObject 0.10.6

2009-05-18 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.6, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread Terry Reedy
Kalyan Chakravarthy wrote: Hi All, I have data in Spread Sheet ( First Name and Last Name), how can i see this data in Python code ( how can i use Spread Sheet as Data Store ) . I you have a choice, a plain text file is MUCH easier. Or, you can output a plain text data.csv (co

Re: Adding a Par construct to Python?

2009-05-18 Thread George Sakkis
On May 18, 5:27 am, jer...@martinfamily.freeserve.co.uk wrote: > My suggestion is primarily about using multiple threads and sharing > memory - something akin to the OpenMP directives that one of you has > mentioned. To do this efficiently would involve removing the Global > Interpreter Lock, or s

Re: How to get Exif data from a jpeg file

2009-05-18 Thread BJ Swope
On Sun, May 17, 2009 at 4:17 AM, Arnaud Delobelle wrote: > > Daniel Fetchinson writes: > > >> I need to get the creation date from a jpeg file in Python.  Googling > >> brought up a several references to apparently defunct modules.  The best > >> way I have been able to find so far is something l

Re: Context manager, atexit processing, and PEP 3143 DaemonContext.close

2009-05-18 Thread MRAB
Gunter Henriksen wrote: Anyone else? If there is a function which triggers a one-shot switch, I like to have a way to find out if it has already been triggered, I prefer to have the function tell me if it triggered the switch or not, but I would not want that to be by raising an exception. Th

Re: pydb output vanishes when running nosetests doctests

2009-05-18 Thread Diez B. Roggisch
jcervidae wrote: > Hi Pythonistas: > > When pydb.debugger() is launched from within my code or for some other > reason pydb starts from inside a nosetests or doctest, I do not see > any output from it. It appears the test has hung but it hasn't. If I > type commands pydb obeys them I just can't s

The ultimate in voice-powered scripting in Windows... need help

2009-05-18 Thread John Doe
http://code.google.com/p/dragonfly/ The help I need probably requires a Python programmer to become familiar with the project. I cannot tell exactly how much syntax versus logic is involved. But if you have ever had any interest in voice/speech activated system wide scripting in Windows, this

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Jeff McNeil
On May 18, 11:31 am, Tim Hoffman wrote: > Hi Marco > > Thats definately what I think is happening. > > I tried the following > > >>> class yy(object): > > ...   def __getitem__(self,name): > ...     raise KeyError(name) > ...   def __contains__(self,name): > ...     raise KeyError(name) > ...>>> a

Re: Context manager, atexit processing, and PEP 3143 DaemonContext.close

2009-05-18 Thread Gunter Henriksen
> Anyone else? If there is a function which triggers a one-shot switch, I like to have a way to find out if it has already been triggered, I prefer to have the function tell me if it triggered the switch or not, but I would not want that to be by raising an exception. -- http://mail.python.org/ma

Fedora root access with python

2009-05-18 Thread Chris Hughes
I've written some software for ubuntu/debian linux and am porting it over to RPM-based distros and have relied heavily on gksu being called internally to perform root tasks with a graphical password. However fedora seems to have another system of authenticating root access, how do I do that gra

Re: Python code-bloat tool-- warning n00b stuff...

2009-05-18 Thread david wright
- Original Message From: Robert Kern To: python-list@python.org Sent: Saturday, May 16, 2009 3:55:11 PM Subject: Re: Python code-bloat tool-- warning n00b stuff... On 2009-05-16 12:13, anand j wrote: > Hi, > I am looking for a bunch of rules or a tool that takes the code for > my

Re: Just wondering

2009-05-18 Thread norseman
Dave Angel wrote: norseman wrote: Marco Mariani wrote: Gediminas Kregzde wrote: def doit(i): pass def main(): a = [0] * 1000 t = time() map(doit, a) print "map time: " + str(time() - t) Here you are calling a function ten million times, build a list with of ten million

pydb output vanishes when running nosetests doctests

2009-05-18 Thread jcervidae
Hi Pythonistas: When pydb.debugger() is launched from within my code or for some other reason pydb starts from inside a nosetests or doctest, I do not see any output from it. It appears the test has hung but it hasn't. If I type commands pydb obeys them I just can't see the results. How can I stop

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Gabor Urban
Hi guys, I think this issue is long-long displute over tools and IDE-s. No need to combine it with the question of the complexity of the programming language used. I know guys, who did every development project using a simple GVIM and command line tools, and vere extremly productive. Even in Java

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Tim Hoffman
Hi Marco Thats definately what I think is happening. I tried the following >>> class yy(object): ... def __getitem__(self,name): ... raise KeyError(name) ... def __contains__(self,name): ... raise KeyError(name) ... >>> aa = yy() >>> 'll' in aa Traceback (most recent call last): Fi

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Jeff McNeil
On May 18, 11:22 am, timh wrote: > Hi > > I am trying to understand something about how the 'in' operator (as in > the following expression) > > if 'aa' in x: >    do_something() > > When trying to implement in support on a class it appears that if > __contains__ doesn't exist > in falls back to c

Re: Concurrency Email List

2009-05-18 Thread Aahz
On Mon, May 18, 2009, Pete wrote: > On May 16, 2009, at 7:26 PM, Aahz wrote: >> On Sat, May 16, 2009, Pete wrote: >>> >>> python-concurre...@googlegroups.com is a new email list >>> for discussion of concurrency issues in python. It arose >>> out of Dave Beazley's class on the subject last week: >

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread John Machin
Kalyan Chakravarthy hyit.com> writes: > > Hi All, I have data in Spread Sheet ( First Name and Last Name), how can i see  this data  in Python code ( how can i use Spread Sheet as Data Store ) . -- RegardsKalyan Hi Kalyan, A few questions ... the answers might help us help you bett

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Marco Mariani
timh wrote: However strange things happen to the name passed to __getitem__ in the following example (and in fact in all varients I have triend the name/ key passed to __getitem__ is always the integer 0 I think it's scanning the container as a sequence and not as a mapping, hence the access

? 'in' operator and fallback to __getitem__

2009-05-18 Thread timh
Hi I am trying to understand something about how the 'in' operator (as in the following expression) if 'aa' in x: do_something() When trying to implement in support on a class it appears that if __contains__ doesn't exist in falls back to calling __getitem__ However strange things happen to

Re: Concurrency Email List

2009-05-18 Thread Pete
On May 16, 2009, at 7:26 PM, Aahz wrote: [posted and e-mailed] On Sat, May 16, 2009, Pete wrote: python-concurre...@googlegroups.com is a new email list for discussion of concurrency issues in python. It arose out of Dave Beazley's class on the subject last week: http://www.dabeaz.com/c

Re: Python mail truncate problem

2009-05-18 Thread David
On May 18, 5:10 am, bieff...@gmail.com wrote: > On 18 Mag, 05:51, David wrote: > > > > > > > Hi, > > > I am writing Python script to process e-mails in a user's mail > > account. What I want to do is to update that e-mail's Status to 'R' > > after processing it, however, the following script trunc

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 14:05:50 +0100, Tim Golden wrote: > According to http://docs.python.org/install/index.html and my > own reasonably long experience of them, they're just a way of > getting extra paths into sys.path. Well, fair enough... > The docs referred to above do indeed say "add a

Re: Generic web parser

2009-05-18 Thread S.Selvam
On Mon, May 18, 2009 at 1:59 PM, Jeremiah Dodds wrote: > > > On Sat, May 16, 2009 at 2:18 PM, S.Selvam wrote: > >> Hi all, >> >> I have to design web parser which will visit the given list of websites >> and need to fetch a particular set of details. >> It has to be so generic that even if we add

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
David Lyon wrote: > On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister > wrote: >> Yes, but that processing will add /example/ to sys.path, right? > > It actually works the other way around. The directories listed in > sys.path are scanned for .pth files. No, they are not. That's exactly my

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread Mike Kazantsev
On Mon, 18 May 2009 00:51:43 -0700 (PDT) "boblat...@googlemail.com" wrote: > this is the conversion I'm looking for: > > ['1.1', '2.2', '3.3'] -> (1.1, 2.2, 3.3) Since itertools are useful in nearly every module and probably are imported already... import itertools as it ftuple = tuple(it.

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Tim Golden
David Lyon wrote: On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister wrote: Yes, but that processing will add /example/ to sys.path, right? It actually works the other way around. The directories listed in sys.path are scanned for .pth files. You can add packages by listing them inside

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Marco Mariani
Steve Ferg wrote: I periodically think of that blog, usually in circumstances that make me also think "Boy, that guy really got it right". But despite repeated and prolonged bouts of googling I haven't been able to find the article again. I must be using the wrong search terms or something. D

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Aahz
In article , Ulrich Eckhardt wrote: >Steve Ferg wrote: >> >> On the one hand, there are developers who love big IDEs with lots of >> features (code generation, error checking, etc.), and rely on them to >> provide the high level of support needed to be reasonably productive >> in heavy-weight lan

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister wrote: > Yes, but that processing will add /example/ to sys.path, right? It actually works the other way around. The directories listed in sys.path are scanned for .pth files. You can add packages by listing them inside a .PTH. > I'm expec

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
David Lyon wrote: > (...) >> 1&2 => 3) A file test.pth with the content "/example/" should result in >> sys.path containing "/example/". > > No. Python, once finding the .pth will process it. Yes, but that processing will add /example/ to sys.path, right? >> 4) "" (the current directory) is the

Re: Python mail truncate problem

2009-05-18 Thread bieffe62
On 18 Mag, 05:51, David wrote: > Hi, > > I am writing Python script to process e-mails in a user's mail > account. What I want to do is to update that e-mail's Status to 'R' > after processing it, however, the following script truncates old e- > mails even though it updates that e-mail's Status co

Re: [Python-Dev] PEP 384: Defining a Stable ABI

2009-05-18 Thread Michael Foord
Martin v. Löwis wrote: It also might make it easier for alternate implementations to support the same API so some modules could work cross implementation - but I suspect that's a non-goal of this PEP :). Indeed :-) I'm also skeptical that this would actually allow cross-implementat

Re: How can i use Spread Sheet as Data Store

2009-05-18 Thread Krishnakant
Hi Kaliyan, It is very simple. There is a library called odfpy which you can use to read and write odf documents. I highly recommend using open formats so that the API is clear and you can ask help if needed. The odfpy library has modules to create spreadsheets and read or write by row or sell etc

How can i use Spread Sheet as Data Store

2009-05-18 Thread Kalyan Chakravarthy
Hi All, I have data in Spread Sheet ( First Name and Last Name), how can i see this data in Python code ( how can i use Spread Sheet as Data Store ) . -- Regards Kalyan -- http://mail.python.org/mailman/listinfo/python-list

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Christian Heimes
Philipp Hagemeister schrieb: > Where is the fault in my reasoning here? Python processes .pth files only in some directories. The directories are * the global site-packages directory * the user site-packages directory (starting with Python 2.6) * and any directory that is added by a .pth file

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 11:49:15 +0200, Philipp Hagemeister wrote: > 1) According to http://docs.python.org/dev/install/, "The most > convenient way is to add a path configuration file to a directory that’s > already on Python’s path, (...). It's true... > 2) Path configuration files have an extensi

.pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Philipp Hagemeister
Where is the fault in my reasoning here? 1) According to http://docs.python.org/dev/install/, "The most convenient way is to add a path configuration file to a directory that’s already on Python’s path, (...). 2) Path configuration files have an extension of .pth, (...)" 1&2 => 3) A file test.pt

Re: Adding a Par construct to Python?

2009-05-18 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Sun, 17 May 2009 20:34:00 +0200, Diez B. Roggisch wrote: > My math-skills are a bit too rusty to qualify the exact nature of the operation, commutativity springs to my mind. >>> >>> And how is reduce() supposed to know whether or not some arbitrary >>> funct

Re: A newbie question about some code

2009-05-18 Thread Chris Rebert
On Mon, May 18, 2009 at 2:18 AM, Jim Qiu wrote: > Hi everyone. > I am reading a python library code and found something i can not understand. > Please help! > class Envelope(object): >     def __init__(self,ta_info): >         self.ta_info = ta_info > >     def writefilelist(self,ta_list,tofile):

Re: A newbie question about some code

2009-05-18 Thread Rhodri James
On Mon, 18 May 2009 10:18:52 +0100, Jim Qiu wrote: Please check the blue highlighted part, I don't understand how the object get the property? Colours and highlighting don't come across in Usenet postings. Could you be a bit more specific. Which object, and what property? -- Rhodri Jame

Re: Adding a Par construct to Python?

2009-05-18 Thread jeremy
On 17 May, 22:27, Paul Boddie wrote: > On 17 Mai, 14:05, jer...@martinfamily.freeserve.co.uk wrote: > > > From a user point of view I think that adding a 'par' construct to > > Python for parallel loops would add a lot of power and simplicity, > > e.g. > > > par i in list: > >     updatePartition(

A newbie question about some code

2009-05-18 Thread Jim Qiu
Hi everyone. I am reading a python library code and found something i can not understand. Please help! class Envelope(object): def __init__(self,ta_info): self.ta_info = ta_info def writefilelist(self,ta_list,tofile): for filename in ta_list: fromfile = botsl

Re: Prepackaged function args

2009-05-18 Thread John O'Hagan
On Mon, 18 May 2009, boblat...@googlemail.com wrote: > Hello group, > > suppose I've got a function f() that takes N parameters, and a list > (or tuple) arg[] with N elements that I'd like to pass as parameters. > The straightforward function call looks like this: > > result = f(arg[0], arg[1], ...

Re: Prepackaged function args

2009-05-18 Thread Chris Rebert
On Mon, May 18, 2009 at 1:36 AM, boblat...@googlemail.com wrote: > Hello group, > > suppose I've got a function f() that takes N parameters, and a list > (or tuple) arg[] with N elements that I'd like to pass as parameters. > The straightforward function call looks like this: > > result = f(arg[0]

Re: Which C compiler?

2009-05-18 Thread Jive Dadson
P.s. I just found out that there's a new Express edition, 2008. (New to me, that is.) I'm installing it. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread Ben Finney
"boblat...@googlemail.com" writes: > Hello group, > > this is the conversion I'm looking for: > > ['1.1', '2.2', '3.3'] -> (1.1, 2.2, 3.3) > > Currently I'm "disassembling" the list by hand, like this: > > fields = line.split('; ') > for x in range(len(fields)): > fields[x] =

Re: Generic web parser

2009-05-18 Thread andrew cooke
http://groups.google.com/group/beautifulsoup/browse_thread/thread/d416dd19fdaa43a6 http://jjinux.blogspot.com/2008/10/python-some-notes-on-lxml.html andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.split gets confused with combined \\ and /

2009-05-18 Thread Ulrich Eckhardt
Stef Mientki wrote: > I've to distribute both python files and data files. > Everything is developed under windows and now the datafiles contains > paths with mixed \\ and /. For your info: Some (!!!) parts of MS Windows understand forward slashes as path separators and disallows them in file name

Re: Conceptual flaw in pxdom?

2009-05-18 Thread Paul Boddie
On 18 Mai, 08:54, Stefan Behnel wrote: > Emanuele D'Arrigo wrote: > > I'm looking at pxdom and in particular at its foundation class > > DOMObject > > I didn't know pxdom, but looking at it now I can see that it hasn't been > updated since 2006. Not sure if that means that it is complete or that i

Prepackaged function args

2009-05-18 Thread boblat...@googlemail.com
Hello group, suppose I've got a function f() that takes N parameters, and a list (or tuple) arg[] with N elements that I'd like to pass as parameters. The straightforward function call looks like this: result = f(arg[0], arg[1], ..., arg[N-1]) Is there a less verbose way of accomlishing this? T

Re: Generic web parser

2009-05-18 Thread Jeremiah Dodds
On Sat, May 16, 2009 at 2:18 PM, S.Selvam wrote: > Hi all, > > I have to design web parser which will visit the given list of websites and > need to fetch a particular set of details. > It has to be so generic that even if we add new websites, it must fetch > those details if available anywhere.

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread Ulrich Eckhardt
boblat...@googlemail.com wrote: > this is the conversion I'm looking for: > > ['1.1', '2.2', '3.3'] -> (1.1, 2.2, 3.3) > > Currently I'm "disassembling" the list by hand, like this: > > fields = line.split('; ') > for x in range(len(fields)): > fields[x] = float(fields[x]) >

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread Chris Rebert
On Mon, May 18, 2009 at 12:51 AM, boblat...@googlemail.com wrote: > Hello group, > > this is the conversion I'm looking for: > > ['1.1', '2.2', '3.3'] -> (1.1, 2.2, 3.3) > > Currently I'm "disassembling" the list by hand, like this: > >    fields = line.split('; ') >    for x in range(len(fields))

  1   2   >