LANG, locale, unicode, setup.py and Debian packaging

2008-01-12 Thread Donn Ingle
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything without 'utf8' in it, then things start to go downhill: 2a. The app assumes unicode objects internally. i.e.

Re: How to POST call and retrieve result page

2008-01-12 Thread suyash jape
Hi /search.php fills the text box values. But /search.php has two form action elements 1) AND 2) I did GET and POST to both results.php page , which gives *'String could not be parsed as XML'* exception. Should data passed be in some XML format or normal query ? POST on blast_results.php

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 11, 8:04 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Could you: > > > lockerA= Locker( listA, listB ) > > lockerA.op( listB.reverse ) > > lockerA.op( listA.pop ) > > > Where lockerA ops acquire the locks on all its threads? > > I don't understand that que

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 2:37 am, [EMAIL PROTECTED] wrote: > On Jan 11, 8:04 pm, Paul Rubin wrote: > > > > > [EMAIL PROTECTED] writes: > > > Could you: > > > > lockerA= Locker( listA, listB ) > > > lockerA.op( listB.reverse ) > > > lockerA.op( listA.pop ) > > > > Where lockerA ops acqu

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-12 Thread Hendrik van Rooyen
"Bjoern Schliessmann" wrote: >I'm currently trying to implement a simulation program with Kamaelia >and need a reliable TCP connection to a data server. > >From Twisted, I know that a method is called if the connection fails >by whatever reason. I tried to get the same results with Kamaelia's >TC

Re: ctypes, GetWindowLongPtr

2008-01-12 Thread Henry Baxter
David, Quick reply :) That pointed me in the right direction. The documentation I was reading indicated the use of GetWindowLongPtr, but at compile time (if one were writing C/C++ code) which particular version (Long/64, or 32 bit) is chosen. That's where I was getting mixed up - thanks! Henry

eric4 request for contribution

2008-01-12 Thread Detlev Offenbach
Hi, I am in the progress of writing a refactoring plugin for eric4 using the rope refactoring library. Unfortunately, this library does not contain a nice icon to be shown in an About Rope dialog. Is there anybody around, who could contribute such an icon. Maybe it could look like the Python snake

Re: removeall() in list

2008-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I'm writing an NxN observer pattern, mostly for my own personal > > exploration. Two threads -might- be calling 'Disconnect' at the same > > time, and I can't even guarantee that the function runs properly. I think the Pythonic way to do this is have the targets com

Re: converting JSON to string

2008-01-12 Thread Jeroen Ruigrok van der Werven
-On [20080112 08:38], Gowri ([EMAIL PROTECTED]) wrote: >Actually, I have one other problem after all this. I see that if I try >to construct JSON output as above, it is of the form >[{'isbn': u'1-56592-724-9', 'title': u'The Cathedral & the Bazaar&

Re: different encodings for unicode() and u''.encode(), bug?

2008-01-12 Thread mario
On Jan 4, 12:02 am, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 4, 8:03 am, mario <[EMAIL PROTECTED]> wrote: > > On Jan 2, 2:25 pm, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > > > > Apparently for the empty string the encoding is irrelevant as it will not > > > be used. I guess there is an ea

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-12 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > Not sure about Kamelia, but I have found that when a FIN comes > along, a socket.recv() gives back an empty string, just like EOF > on a file. That Python socket interface can detect it I'm absolutely sure -- Twisted handles it. I even pdb'ed Kamaelia and control flow

Is unicode.lower() locale-independent?

2008-01-12 Thread Robert Kern
The section on "String Methods"[1] in the Python documentation states that for the case conversion methods like str.lower(), "For 8-bit strings, this method is locale-dependent." Is there a guarantee that unicode.lower() is locale-*in*dependent? The section on "Case Conversion" in PEP 100 sugg

paging in python shell

2008-01-12 Thread Alex K
Hello, Does anyone know if the python shell supports paging or if I should look into iPython? Thank you so much. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: removeall() in list

2008-01-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'm writing an NxN observer pattern, mostly for my own personal > exploration. Two threads -might- be calling 'Disconnect' at the same > time, and I can't even guarantee that the function runs properly. > > for emelem in [ e for e in emlist if e.func is func ]: >

upload file and estimation time

2008-01-12 Thread whatazor
Hi all, unseccsefully, I try to analyze this problem. If I can only work on the client size, how can I create a module that calculate the upload time of a file, so the time for finish it? i can start with ftp protocol and after extend this logic for my requirements. thx w -- http://mail.python.o

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread John Machin
On Jan 12, 8:25 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > The section on "String Methods"[1] in the Python documentation states that for > the case conversion methods like str.lower(), "For 8-bit strings, this method > is > locale-dependent." Is there a guarantee that unicode.lower() is > local

where do my python files go in linux?

2008-01-12 Thread Jorgen Bodde
Hi All, I am trying to make a debian package. I am following the tutorial by Horst Jens (http://showmedo.com/videos/video?name=linuxJensMakingDeb&fromSeriesID=37) and it is very informative. However one thing my app has and his doesn't, is multiple python files which need to be executed. For exam

Re: where do my python files go in linux?

2008-01-12 Thread Jeroen Ruigrok van der Werven
-On [20080112 12:03], Jorgen Bodde ([EMAIL PROTECTED]) wrote: >app.py calls a lot of modules in {dir}/app. Horst says the python file >goes in /usr/bin/app.py which is ok with me, but I have multiple >python files, and I decided to use an app.sh script to call my python >files. In th

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread Robert Kern
John Machin wrote: > On Jan 12, 8:25 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> The section on "String Methods"[1] in the Python documentation states that >> for >> the case conversion methods like str.lower(), "For 8-bit strings, this >> method is >> locale-dependent." Is there a guarantee th

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread Fredrik Lundh
Robert Kern wrote: >> However it appears from your bug ticket that you have a much narrower >> problem (case-shifting a small known list of English words like VOID) >> and can work around it by writing your own locale-independent casing >> functions. Do you still need to find out whether Python un

Looking for GSM Mobile Phone www.enmac.com.hk

2008-01-12 Thread Farooq
ENMAC Digital Quran Mobile includes Full Quran with Text and Translation in different languages, Tafaseer books, Ahadees Books, Universal Qibla Direction, Prayer Timing and much more at good price, please contact us for best prices and visit our website http://www.enmac.com.hk for more information.

Re: Using a proxy with urllib2

2008-01-12 Thread Rob Wolfe
"Jack" <[EMAIL PROTECTED]> writes: >>> I'm trying to use a proxy server with urllib2. >>> So I have managed to get it to work by setting the environment >>> variable: >>> export HTTP_PROXY=127.0.0.1:8081 >>> >>> But I wanted to set it from the code. However, this does not set the >>> proxy: >>>

Re: Great Python books for the beginner

2008-01-12 Thread Jim
Look at http://www.python.org/doc/ . The tutorial is quite good. Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread Torsten Bronger
Hallöchen! Fredrik Lundh writes: > Robert Kern wrote: > >>> However it appears from your bug ticket that you have a much >>> narrower problem (case-shifting a small known list of English >>> words like VOID) and can work around it by writing your own >>> locale-independent casing functions. Do yo

Re: upload file and estimation time

2008-01-12 Thread Diez B. Roggisch
whatazor schrieb: > Hi all, > unseccsefully, I try to analyze this problem. If I can only work on > the client size, how can I create a module that calculate the upload > time of a file, so the time for finish it? i can start with ftp > protocol and after extend this logic for my requirements. All

Re: extracting Javadocs using Python

2008-01-12 Thread Wildemar Wildenburger
Rajarshi wrote: > Does anybody know if something like this is available? Or would I need > to implement a parser from scratch? > Probably. But using pyparsing, you shouldn't have a lot of trouble with it. You may want to take a look at epydoc, a python API-doc generator. I seem to remember that

eric4 request for contribution

2008-01-12 Thread Detlev Offenbach
Hi, I am in the progress of writing a refactoring plugin for eric4 using the rope refactoring library. Unfortunately, this library does not contain a nice icon to be shown in an About Rope dialog. Is there anybody around, who could contribute such an icon. Maybe it could look like the Python sn

Re: Great Python books for the beginner

2008-01-12 Thread Ben Finney
Landon <[EMAIL PROTECTED]> writes: > I was wondering if anyone had any opinions on what other titles I > could look into since this one seems from a glance at reviews to be > teaching mainly through game programming (a topic I'm not too > interested in) or if this one is a quality book by itself.

Re: urllib2 rate limiting

2008-01-12 Thread Dimitrios Apostolou
On Fri, 11 Jan 2008, Nick Craig-Wood wrote: > Here is an implementation based on that idea. I've used urllib rather > than urllib2 as that is what I'm familiar with. Thanks! Really nice implementation. However I'm stuck with urllib2 because of its extra functionality so I'll try to implement som

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 3:51 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm writing an NxN observer pattern, mostly for my own personal > > exploration. Two threads -might- be calling 'Disconnect' at the same > > time, and I can't even guarantee that the function runs properly.

Re: Magic function

2008-01-12 Thread bearophileHUGS
Steven D'Aprano: > As simple as the above is, it could be made simpler. Judging from the > example given, the Bigobj constructor doesn't need a keyword argument, > it could just as easily take an arbitrary number of arguments: > bigobj = Bigobj(obj1, obj2, obj3, obj4...) I agree; "Things should be

Re: executing newgrp from python in current shell possible?

2008-01-12 Thread Svenn Are Bjerkem
On Jan 9, 9:18 pm, Zentrader <[EMAIL PROTECTED]> wrote: > On Jan 9, 5:56 am, Svenn Are Bjerkem <[EMAIL PROTECTED]> > wrote: > > >I have been looking for a way to execute this command > > as a part of a script, but it seems that the changes are only valid in > > the context of the script and when th

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread default
On Sat, 12 Jan 2008 02:01:09 -0500, "radiosrfun" <[EMAIL PROTECTED]> wrote: >I WISH - that the President and Congress of this country would shut off ALL >foreign aid. Ditto that. Israel is the chief beneficiary of our foreign aid largesse. Some 8 billion dollars annually. What doesn't find

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 11, 5:26 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > 1. Put a single thread in charge of the list, and communicate with it > by message passing through Queues. To get X out of the list, you'd > send the mutator thread a message asking for removal. The m

Re: Great Python books for the beginner

2008-01-12 Thread sween119
On Jan 12, 2:03 am, Landon <[EMAIL PROTECTED]> wrote: > Hi, I'm a freshman in college and I'm going to be taking an intro to > programming course next semester which mainly uses Python, so I > thought it might be a good time to pick up Python beyond the scope of > the class as well. The text book f

Re: Great Python books for the beginner

2008-01-12 Thread Mike
On Jan 12, 7:47 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Landon <[EMAIL PROTECTED]> writes: > > I was wondering if anyone had any opinions on what other titles I > > could look into since this one seems from a glance at reviews to be > > teaching mainly through game programming (a topic I'm not

Compiling fails on Mac OS X 10.5

2008-01-12 Thread mc
Hi! I'm trying to compile on my Macbook with OS X 10.5. I have all updates and Xcode 3.0 installed. I checked python out with: svn checkout http://svn.python.org/projects/python/branches/py3k After that I did "./configure" in the created "py3k" dir. Everything went fine. But make fails with the

Re: where do my python files go in linux?

2008-01-12 Thread Jorgen Bodde
Hi Jeroen, Thanks for the advice. > Personally I'd be loathe to put app.py in /usr/bin. This directory is normally > reserved for OS-specific binaries. For personal/system-extended stuff I'd use > /usr/local/bin or whatever your system mandates. (But hey, that's the typical > mentality difference

Re: where do my python files go in linux?

2008-01-12 Thread Faber J. Fedor
On 12/01/08 12:02 +0100, Jorgen Bodde wrote: > Hi All, > > I am trying to make a debian package. I am following the tutorial by > Horst Jens > (http://showmedo.com/videos/video?name=linuxJensMakingDeb&fromSeriesID=37) > and it is very informative. However one thing my app has and his > doesn't, i

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread radiosrfun
"default" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 12 Jan 2008 02:01:09 -0500, "radiosrfun" > <[EMAIL PROTECTED]> wrote: > >>I WISH - that the President and Congress of this country would shut off >>ALL >>foreign aid. > > Ditto that. > > Israel is the chief beneficiar

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 8:04 am, [EMAIL PROTECTED] wrote: > On Jan 11, 5:26 pm, Paul Rubin wrote: > > > [EMAIL PROTECTED] writes: > > > 1. Put a single thread in charge of the list, and communicate with it > > by message passing through Queues. To get X out of the list, you'd > > sen

Re: where do my python files go in linux?

2008-01-12 Thread Grant Edwards
On 2008-01-12, Jorgen Bodde <[EMAIL PROTECTED]> wrote: >> Normally you'd split up the bulk of the code into a module which gets >> installed into site-packages and a piece of stand-alone front-end code which >> imports the module and executes whatever you need to do and gets installed >> into a ty

How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
Hi all, I'm trying to use the pywin32 extension to find out the user's home directory but currently I didn't find a solution yet. What I'd need to do is not getting the home directory of the currently logged in user but something like: >>> get_homedir("frank") "C:\home\users\frank" >>> get_homedir

Re: Compiling fails on Mac OS X 10.5

2008-01-12 Thread Mark Dickinson
On Jan 12, 9:41 am, mc <[EMAIL PROTECTED]> wrote: > Hi! > I'm trying to compile on my Macbook with OS X 10.5. I have all updates > and Xcode 3.0 installed. > > I checked python out with: svn > checkouthttp://svn.python.org/projects/python/branches/py3k > After that I did "./configure" in the  crea

what did the bible say about Mohammad

2008-01-12 Thread small giant
According to the Bible, God said to Moses, on whom be peace: I will raise up for them a prophet like you from among their brothers; I will put my words in his mouth, and he will tell them everything I command him. (The Holy Bible, New International Version, Deuteronomy chapter 18, verse 18). The pr

Re: How to get user home directory on Windows

2008-01-12 Thread Christian Heimes
Giampaolo Rodola' wrote: > Is there a way to do that? home = os.path.expanduser("~") Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
On 11 jan, 16:10, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 11, 8:59 am, Bruno Desthuilliers > But I *still* fail to see how it could be "misleading", and > > *you* still fail to explain in which way it could be misleading. > > > If your point is that saying that CPython uses a byte-code/V

Re: Python too slow?

2008-01-12 Thread Paul Boddie
On 12 Jan, 04:03, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > > Given the way that people seem to use "interpreted" as a pejorative and a > synonym for "slow", I don't doubt it one bit. Especially in management, > where they might be making technical judgments on the basis of ha

Re: How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
On 12 Gen, 17:44, Christian Heimes <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > Is there a way to do that? > > home = os.path.expanduser("~") > > Christian That gives the home of the *current logged in user*. I need another thing. -- http://mail.python.org/mailman/listinfo/python-lis

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
On 11 jan, 15:41, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > > > fact 1: CPython compiles source code to byte-code. > > fact 2: CPython executes this byte-code. > > fact 3: Sun's JDK compiles source code to byte-code. > > fact 4: Sun's JDK execute

a problem with py2exe

2008-01-12 Thread [EMAIL PROTECTED]
I wrote an app that uses some Tix widgets and wanted to make an exe using py2exe .i used the setup script as given in http://www.py2exe.org/index.cgi/TixSetup and it copies the dlls into the dist directory created by py2exe. But then the application works only if i create a directory named 'DLLs '

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
On 11 jan, 17:23, Ed Jensen <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > fact 1: CPython compiles source code to byte-code. > > fact 2: CPython executes this byte-code. > > fact 3: Sun's JDK compiles source code to byte-code. > > fact 4: Sun's JDK executes this by

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
On 10 jan, 21:47, Ed Jensen <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > I fail to see how the existence of JIT compilers in some Java VM changes > > anything to the fact that both Java (by language specification) and > > CPython use the byte-code/VM scheme. > > W

Re: Compiling fails on Mac OS X 10.5

2008-01-12 Thread mc
On Jan 12, 5:34 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Jan 12, 9:41 am, mc <[EMAIL PROTECTED]> wrote: > > > > > Hi! > > I'm trying to compile on my Macbook with OS X 10.5. I have all updates > > and Xcode 3.0 installed. > > > I checked python out with: svn > > checkouthttp://svn.python

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
On 10 jan, 03:10, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 09 Jan 2008 21:26:05 +0100, Bruno Desthuilliers wrote: > > hint: how can a compiler safely optimize anything in a language so > > dynamic that even the class of an object can be changed at runtime ? > > Is that a trick question?

Re: removeall() in list

2008-01-12 Thread Rhamphoryncus
On Jan 12, 1:37 am, [EMAIL PROTECTED] wrote: > On Jan 11, 8:04 pm, Paul Rubin wrote: > > > > > [EMAIL PROTECTED] writes: > > > Could you: > > > > lockerA= Locker( listA, listB ) > > > lockerA.op( listB.reverse ) > > > lockerA.op( listA.pop ) > > > > Where lockerA ops acqu

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 11:22 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jan 12, 1:37 am, [EMAIL PROTECTED] wrote: > > > > > On Jan 11, 8:04 pm, Paul Rubin wrote: > > > > [EMAIL PROTECTED] writes: > > > > Could you: > > > > > lockerA= Locker( listA, listB ) > > > > lockerA.op(

Re: How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
Update. I found a way for getting the home directory of the user but it requires to validate the user by providing username+password: def get_homedir(username, password): token = win32security.LogonUser( username, None, password, win32security.LOGON32_LOGON_NETW

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread Richard Henry
"radiosrfun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "default" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Sat, 12 Jan 2008 02:01:09 -0500, "radiosrfun" > > <[EMAIL PROTECTED]> wrote: > > > >>I WISH - that the President and Congress of this country wo

Re: removeall() in list

2008-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: > 2) List is referenced by others; concurrent modifications may be going > on; can not replace it. Can I make asynchronous modifications and > merge the changes, SCM-style? Nothing else should have direct access to the list. > 3) Dictionary returns non-static order; ord

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread default
On Sat, 12 Jan 2008 09:15:44 -0800, ChairmanOfTheBored <[EMAIL PROTECTED]> wrote: > You are both fucked in the head, coffee or not. He more than you, but >still, you both don't know what you are talking about. Any castigation from Bored is an accolade . . . I must be on the right track to get th

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 12:26 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > 2) List is referenced by others; concurrent modifications may be going > > on; can not replace it. Can I make asynchronous modifications and > > merge the changes, SCM-style? > > Nothing else should h

Simple List division problem

2008-01-12 Thread marcstuart
How do I divide a list into a set group of sublist's- if the list is not evenly dividable ? consider this example: x = [1,2,3,4,5,6,7,8,9,10] y = 3 # number of lists I want to break x into z = y/x what I would like to get is 3 sublists print z[0] = [1,2,3] print z[2] = [4,5,6] print z[3] =

super, decorators and gettattribute

2008-01-12 Thread Richard Szopa
Hello all, I am playing around w/ Python's object system and decorators and I decided to write (as an exercise) a decorator that (if applied to a method) would call the superclass' method of the same name before doing anything (initially I wanted to do something like CLOS [1] :before and :end meth

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread radiosrfun
"ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 12 Jan 2008 10:35:38 -0500, "radiosrfun" > <[EMAIL PROTECTED]> wrote: > >>"default" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >>> On Sat, 12 Jan 2008 02:01:09 -0500, "radiosrfun" >>> <[EM

Re: removeall() in list

2008-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > Nothing else should have direct access to the list. > Impossible to guarantee in Python. If you do, the reference to you does. Well, ok. Nothing else should USE that access. -- http://mail.python.org/mailman/listinfo/python-list

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-12 Thread Joe Riopel
On Jan 12, 2008 2:00 PM, radiosrfun <[EMAIL PROTECTED]> wrote: > Whether we agree on "tactics" or not - if it come to a battlefield with the > two of us - or any Americans there - we're still going to fight the same > enemy - not each other. This is a good resource for starting Python http://divei

Re: Simple List division problem

2008-01-12 Thread marcstuart
I have gotten a little further, but not in the order of the original list def divide_list(lst, n): return [lst[i::n] for i in range(n)] x = [1,2,3,4,5,6,7,8,9,10] y = 3 z = divide_list(x,y) print z[0] print z[1] print z[2] this prints: [1, 4, 7, 10] [2, 5, 8] [3, 6, 9] closer, but I w

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 1:03 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > > Nothing else should have direct access to the list. > > Impossible to guarantee in Python. If you do, the reference to you does. > > Well, ok. Nothing else should USE that access. Ah, very agreed.

RE: Import and execfile()

2008-01-12 Thread lloyd
Hello, > I maintain a few configuration files in Python syntax (mainly nested > dicts of ints and strings) and use execfile() to read them back to > Python. This has been working great; it combines the convenience of > pickle with the readability of Python. So far each configuration is > conta

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 12:26 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > 2) List is referenced by others; concurrent modifications may be going > > on; can not replace it. Can I make asynchronous modifications and > > merge the changes, SCM-style? > > Nothing else should h

RE: where do my python files go in linux?

2008-01-12 Thread lloyd
Hello, > Question 1. Where do I put the bulk of python scripts in a normal > linux environment? In my system I put them in /usr/local/lib/python2.4/site-packages/my_scripts. And, I have *.pth file in /usr/local/lib/python2.4/site-packages that points to my_scripts. The *.pth file simply reads "m

Re: super, decorators and gettattribute

2008-01-12 Thread Richard Szopa
On Jan 12, 7:45 pm, Richard Szopa <[EMAIL PROTECTED]> wrote: > doing anything (initially I wanted to do something like CLOS > [1] :before and :end methods, but that turned out to be too > difficult). Erm, I meant :before and :after methods. -- Richard -- http://mail.python.org/mailman/list

Re: Python too slow?

2008-01-12 Thread [EMAIL PROTECTED]
Oh.. it seems my naiveness has stirred quite a discussion >_<... I must admit though, I've learned a bit about Python reading through this topic. Thanks to everyone who pointed out the flaws in the code. I'll see if I can come up with my own color tracking solution in a few weeks and post back h

Re: Simple List division problem

2008-01-12 Thread [EMAIL PROTECTED]
On Jan 12, 12:37 pm, marcstuart <[EMAIL PROTECTED]> wrote: > How do I divide a list into a set group of sublist's- if the list is > not evenly dividable ? > consider this example: > > x = [1,2,3,4,5,6,7,8,9,10] > y = 3      # number of lists I want to break x into > z = y/x > > what I would like to

Re: Simple List division problem

2008-01-12 Thread Gary Herron
marcstuart wrote: > How do I divide a list into a set group of sublist's- if the list is > not evenly dividable ? > consider this example: > > x = [1,2,3,4,5,6,7,8,9,10] > y = 3 # number of lists I want to break x into > z = y/x > > > what I would like to get is 3 sublists > > print z[0] = [1,

Re: Great Python books for the beginner

2008-01-12 Thread babycode
On Jan 12, 2:03 am, Landon <[EMAIL PROTECTED]> wrote: > I was wondering if anyone had any opinions on what other titles I > could look into since this one seems from a glance at reviews to be > teaching mainly through game programming (a topic I'm not too > interested in) or if this one is a quali

Re: IDLE won't start in Python 2.5 for Windows

2008-01-12 Thread mikez302
I opened a command window in my Python25 folder and tried typing pythonw. I just got another command prompt as if the program ran but didn't do anything. It looked like this: C:\Python25>pythonw C:\Python25> -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE won't start in Python 2.5 for Windows

2008-01-12 Thread Fredrik Lundh
mikez302 wrote: > I opened a command window in my Python25 folder and tried typing > pythonw. I just got another command prompt as if the program ran but > didn't do anything. It looked like this: > > C:\Python25>pythonw > > C:\Python25> "pythonw" is the console-less version of the Python run

Re: where do my python files go in linux?

2008-01-12 Thread Joe Riopel
On Jan 12, 2008 10:13 AM, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > I thought about that too. I just wonder why /usr/local/bin is always > empty and every .deb I install from a source (if it's from Ubuntu or > not) installs files in /usr/bin .. So I looked further and noticed > that most python fil

Re: removeall() in list

2008-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Will you engage with me over e-mail to discuss the Locker > implementation I'm developing? Aaron I really can't, sorry. I'm finding it hard enough to follow over the newsgroup. If you just have a single one of these lists, it's probably simplest to do what Frederik L

Re: Compiling fails on Mac OS X 10.5

2008-01-12 Thread Mark Dickinson
On Jan 12, 12:05 pm, mc <[EMAIL PROTECTED]> wrote: > Alright! > ./configure output is here:http://rafb.net/p/NqSmqc25.html > and make output here:http://rafb.net/p/kzeb2e29.html Hmm. Doesn't seem to be anything unusual here. I was expecting to see some more informative error message somewhere. D

Re: Simple List division problem

2008-01-12 Thread Fredrik Lundh
marcstuart wrote: > How do I divide a list into a set group of sublist's- if the list is > not evenly dividable ? consider this example: > > x = [1,2,3,4,5,6,7,8,9,10] > y = 3 # number of lists I want to break x into > z = y/x > > what I would like to get is 3 sublists > > print z[0] = [1

Re: where do my python files go in linux?

2008-01-12 Thread Carl Banks
On Sat, 12 Jan 2008 12:02:20 +0100, Jorgen Bodde wrote: > I am trying to make a debian package. I am following the tutorial by > Horst Jens > (http://showmedo.com/videos/video? name=linuxJensMakingDeb&fromSeriesID=37) > and it is very informative. However one thing my app has and his > doesn't, is

Re: Great Python books for the beginner

2008-01-12 Thread GeneralCody
On 2008-01-12 08:03:42 +0100, Landon <[EMAIL PROTECTED]> said: > Hi, I'm a freshman in college and I'm going to be taking an intro to > programming course next semester which mainly uses Python, so I > thought it might be a good time to pick up Python beyond the scope of > the class as well. The t

Re: Import and execfile()

2008-01-12 Thread Mike Meyer
On Fri, 11 Jan 2008 20:55:07 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 11, 5:24 pm, Mike Meyer <[EMAIL PROTECTED]> > wrote: > > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> > > wrote: > > > I maintain a few configuration files in Python syntax (ma

Re: Great Python books for the beginner

2008-01-12 Thread Landon
One thing I wonder about is the examples these books use to teach the concepts. I found myself really attached to K&R because the end of section projects were utilities that I would find be able to find useful in day to day work such as a version of wc and a program that would take collapse all con

Re: where do my python files go in linux?

2008-01-12 Thread Mike Meyer
On Sat, 12 Jan 2008 16:13:08 +0100 "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > > Normally you'd split up the bulk of the code into a module which gets > > installed into site-packages and a piece of stand-alone front-end code which > > imports the module and executes whatever you need to do and get

sqlite3 is it in the python default distro?

2008-01-12 Thread Martin Marcher
Hello, I can see that sqlite is in the standard lib documentation: http://docs.python.org/lib/module-sqlite3.html however debian and ubuntu (and gentoo according to the packages info) seem _not_ to include it. Now 2 question arise: a) Is sqlite included in the python default distribution b) In

Re: super, decorators and gettattribute

2008-01-12 Thread Mike Meyer
On Sat, 12 Jan 2008 10:45:25 -0800 (PST) Richard Szopa <[EMAIL PROTECTED]> wrote: > Hello all, > > I am playing around w/ Python's object system and decorators and I > decided to write (as an exercise) a decorator that (if applied to a > method) would call the superclass' method of the same name

Re: sqlite3 is it in the python default distro?

2008-01-12 Thread Gary Herron
Martin Marcher wrote: > Hello, > > I can see that sqlite is in the standard lib documentation: > http://docs.python.org/lib/module-sqlite3.html > > however debian and ubuntu (and gentoo according to the packages info) seem > _not_ to include it. > > Now 2 question arise: > > a) Is sqlite included

Re: Great Python books for the beginner

2008-01-12 Thread André
On Jan 12, 4:04 pm, Landon <[EMAIL PROTECTED]> wrote: > One thing I wonder about is the examples these books use to teach the > concepts. I found myself really attached to K&R because the end of > section projects were utilities that I would find be able to find > useful in day to day work such as

Re: Simple List division problem

2008-01-12 Thread Paul Rubin
marcstuart <[EMAIL PROTECTED]> writes: > what I would like to get is 3 sublists > > print z[0] = [1,2,3] > print z[2] = [4,5,6] > print z[3] = [7,8,9,10] Are you SURE you want that? In almost every situation I've seen, print z[0] = [1,2,3] print z[2] = [4,5,6] print z[3] = [7,8,9

Re: Great Python books for the beginner

2008-01-12 Thread [EMAIL PROTECTED]
On 12 jan, 21:04, Landon <[EMAIL PROTECTED]> wrote: > One thing I wonder about is the examples these books use to teach the > concepts. I found myself really attached to K&R because the end of > section projects were utilities that I would find be able to find > useful in day to day work such as a

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread John Machin
On Jan 12, 10:51 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > >> However it appears from your bug ticket that you have a much narrower > >> problem (case-shifting a small known list of English words like VOID) > >> and can work around it by writing your own locale-independent

Re: where do my python files go in linux?

2008-01-12 Thread Carl Banks
On Sat, 12 Jan 2008 15:25:53 -0500, Mike Meyer wrote: > On Sat, 12 Jan 2008 16:13:08 +0100 "Jorgen Bodde" > <[EMAIL PROTECTED]> wrote: >> > Normally you'd split up the bulk of the code into a module which gets >> > installed into site-packages and a piece of stand-alone front-end >> > code which i

Re: sqlite3 is it in the python default distro?

2008-01-12 Thread Diez B. Roggisch
Martin Marcher schrieb: > Hello, > > I can see that sqlite is in the standard lib documentation: > http://docs.python.org/lib/module-sqlite3.html > > however debian and ubuntu (and gentoo according to the packages info) seem > _not_ to include it. > > Now 2 question arise: > > a) Is sqlite inc

Re: sqlite3 is it in the python default distro?

2008-01-12 Thread Fredrik Lundh
Martin Marcher wrote: > I can see that sqlite is in the standard lib documentation: > http://docs.python.org/lib/module-sqlite3.html > > however debian and ubuntu (and gentoo according to the packages info) seem > _not_ to include it. http://packages.debian.org/python-sqlite -- http://mail.

Re: Is unicode.lower() locale-independent?

2008-01-12 Thread John Machin
On Jan 12, 11:26 pm, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > > > Fredrik Lundh writes: > > Robert Kern wrote: > > >>> However it appears from your bug ticket that you have a much > >>> narrower problem (case-shifting a small known list of English > >>> words like VOID) and can w

Re: where do my python files go in linux?

2008-01-12 Thread Jeroen Ruigrok van der Werven
Hi Jorgen, -On [20080112 16:14], Jorgen Bodde ([EMAIL PROTECTED]) wrote: >I thought about that too. I just wonder why /usr/local/bin is always >empty and every .deb I install from a source (if it's from Ubuntu or >not) installs files in /usr/bin .. So I looked further and noti

  1   2   >