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

2008-01-12 Thread Donn
Martin, I really appreciate your reply. I have been working in a vacuum on this and without any experience. I hope you don't mind if I ask you a bunch of questions. If I can get over some conceptual 'humps' then I'm sure I can produce a better app. > That's a bug in the app. It shouldn't assume

Re: Elementary string-formatting

2008-01-12 Thread Roberto Bonvallet
On Jan 12, 10:15 pm, Odysseus <[EMAIL PROTECTED]> wrote: > P.S. Is there a preferable technique for forcing floating-point division > of two integers to that used above, multiplying by "100.0" first? Put this at the beginning of your program: from __future__ import division This forces all d

Re: Elementary string-formatting

2008-01-12 Thread John Machin
On Jan 13, 3:15 pm, Odysseus <[EMAIL PROTECTED]> wrote: [snip] > > P.S. Is there a preferable technique for forcing floating-point division > of two integers to that used above, multiplying by "100.0" first? What > about if I just wanted a ratio: is "float(n / m)" better than "1.0 * n / > m"? > Od

OSCON 2008 Call for Proposals

2008-01-12 Thread Aahz
The O'Reilly Open Source Convention (OSCON) is accepting proposals for tutorials and presentations. The submission period ends Feb 4. OSCON 2008 will be in Portland, Oregon July 21-25. For more information and to submit a proposal, see http://conferences.oreilly.com/oscon/ -- Aahz ([EMAIL PROT

Re: Elementary string-formatting

2008-01-12 Thread Gary Herron
Odysseus wrote: > Hello, group: I've just begun some introductory tutorials in Python. > Taking off from the "word play" exercise at > > > > I've written a mini-program to tabulate the number of characters in each > word in a file

Elementary string-formatting

2008-01-12 Thread Odysseus
Hello, group: I've just begun some introductory tutorials in Python. Taking off from the "word play" exercise at I've written a mini-program to tabulate the number of characters in each word in a file. Once the data have been co

Re: Why my program (using pexpect to switch user) doesn't work well?

2008-01-12 Thread BlackjadeLin
On Jan 11, 1:49 am, Noah <[EMAIL PROTECTED]> wrote: > On Jan 10, 12:59 am, BlackjadeLin <[EMAIL PROTECTED]> wrote: > > > > > I'm new to python > > I want to write a simple script to switch user,for example,from user_A > > to user_B. > > This my codes: > > > #!/usr/bin/python > > importpexpect > > i

pygtk dnd woes

2008-01-12 Thread [EMAIL PROTECTED]
Hi all, DND has just about got me going bonkers. I want to process the dnd drop to main window and then process the dnd_list to ship to open_arg. Resulting in individual editor panes opening the files. The problem: TypeError: dnd_drop() takes exactly 6 arguments (8 given) or TypeError: dnd_dro

Re: Great Python books for the beginner

2008-01-12 Thread Dick Moores
At 11:03 PM 1/11/2008, Landon 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 for this class is Pyth

Re: DEK's birthday

2008-01-12 Thread George Neuner
On Sat, 12 Jan 2008 12:03:49 -0800 (PST), [EMAIL PROTECTED] wrote: >On Jan 10, 9:57 am, Jim <[EMAIL PROTECTED]> wrote: >> DEK celebrates 70 today. >> >> I doubt he'll read this but I'll say it anyway: Happy Birthday! >> >> Jim Hefferon > >Donald Knuth is a son of a bitch who made a lot of money fr

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

2008-01-12 Thread Robert Kern
Martin v. Löwis wrote: >> Even if towlower() gets used? I've found an explicit statement that the >> conversion it does can be locale-specific: >> >> http://msdn2.microsoft.com/en-us/library/8h19t214.aspx > > Right. However, the build option of Python where that's the case is > deprecated. Exce

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

2008-01-12 Thread John Machin
On Jan 13, 9:49 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sat, 12 Jan 2008 13:51:18 -0800, John Machin wrote: > > On Jan 12, 11:26 pm, Torsten Bronger <[EMAIL PROTECTED]> > > wrote: > >> Hallöchen! > > >> Fredrik Lundh writes: > >> > Robert Kern wrote: > > >> >>> However it appears from your b

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

2008-01-12 Thread John Machin
On Jan 13, 10:31 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > The Unicode standard says that case mappings are language-dependent. > > I think you are misreading it. Ummm well, it does say "normative" as opposed to Fredrik's "informative" ... > 5.18 "Implementation Guides" says > (talking

Re: __init__ explanation please

2008-01-12 Thread Colin J. Williams
Erik Lind wrote: > I'm new to Python, and OOP. I've read most of Mark Lutz's book and more > online and can write simple modules, but I still don't get when __init__ > needs to be used as opposed to creating a class instance by assignment. For > some strange reason the literature seems to take t

Re: __init__ explanation please

2008-01-12 Thread Daniel Fetchinson
> I'm new to Python, and OOP. I've read most of Mark Lutz's book and more > online and can write simple modules, but I still don't get when __init__ > needs to be used as opposed to creating a class instance by assignment. For > some strange reason the literature seems to take this for granted. I'd

Re: executing newgrp from python in current shell possible?

2008-01-12 Thread Karthik Gurusamy
On Jan 12, 6:19 am, Svenn Are Bjerkem <[EMAIL PROTECTED]> wrote: > 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

__init__ explanation please

2008-01-12 Thread Erik Lind
I'm new to Python, and OOP. I've read most of Mark Lutz's book and more online and can write simple modules, but I still don't get when __init__ needs to be used as opposed to creating a class instance by assignment. For some strange reason the literature seems to take this for granted. I'd app

Re: *** American nationalism is FAKE and its MYTHS are LIES, YANK BASTARDS RAPED BY THEIR OWN MARINES - ***

2008-01-12 Thread PeterD
On Sat, 12 Jan 2008 11:50:07 -0800 (PST), [EMAIL PROTECTED] wrote: >THE YANK CHRISTIAN WHITE MARINE Recently in Chicago an Indian father killed his daughter, and and her two children... Why? Because she'd married without his permission. So that seems to make your and your countrymen so many step

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

2008-01-12 Thread Torsten Bronger
Hallöchen! John Machin writes: > On Jan 12, 11:26 pm, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > >> [...] >> >> Slightly off-topic because it's not part of the Unicode >> subsystem, but I was once irritated that the none-breaking space >> (codepoint xa0 I think) was included into string.white

Re: super, decorators and gettattribute

2008-01-12 Thread Steven D'Aprano
On Sat, 12 Jan 2008 15:47:05 -0500, Mike Meyer wrote: > There's an apparently common bug here: you don't want to pass super > self.__class__, but the class that the method is bound to. Given an instance method, is it possible to easily determine what class it is defined in? I thought the im_cla

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

2008-01-12 Thread Martin v. Löwis
> Even if towlower() gets used? I've found an explicit statement that the > conversion it does can be locale-specific: > > http://msdn2.microsoft.com/en-us/library/8h19t214.aspx Right. However, the build option of Python where that's the case is deprecated. Regards, Martin -- http://mail.pyth

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

2008-01-12 Thread Martin v. Löwis
> The Unicode standard says that case mappings are language-dependent. I think you are misreading it. 5.18 "Implementation Guides" says (talking about "most environments") "In such cases, the language-specific mappings *must not* be used." (emphasis also in the original spec). Regards, Martin --

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

2008-01-12 Thread Martin v. Löwis
> What I'd like to understand better is the "compatibility heirarchy" of > known encodings, in the positive sense that if a string decodes > successfully with encoding A, then it is also possible that it will > encode with encodings B, C; and in the negative sense that is if a > string fails to dec

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

2008-01-12 Thread Martin v. Löwis
> 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. Whenever there is > a "string like this" in a var it's supposed to be unicode. Whenever > something comes into the app (from a filename, a file's c

Re: Simple List division problem

2008-01-12 Thread Dustan
On Jan 12, 2:25 pm, Paul Rubin wrote: > 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,

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

2008-01-12 Thread Michael Sparks
Bjoern Schliessmann wrote: > Hello, > > I'm currently trying to implement a simulation program with Kamaelia > and need a reliable TCP connection to a data server. The behaviour you're seeing sounds odd (which is hopefully encouraging :-), but it's not clear from the description whether its a bug

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

2008-01-12 Thread Carl Banks
On Sat, 12 Jan 2008 13:51:18 -0800, John Machin wrote: > 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-sh

Re: removeall() in list

2008-01-12 Thread castironpi
On Jan 12, 1:28 pm, Paul Rubin wrote: > [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 ha

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

2008-01-12 Thread Robert Kern
Fredrik Lundh 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 casing >>> functions. Do you still need

Re: Magic function

2008-01-12 Thread dg . google . groups
Thanks everyone for the comments. I had previously thought about the possibility of the classes keeping track of their instances. I guess this could probably be done quite transparently with a decorator too (as we have many different types of objects being collected together). The only issue is th

Re: *** American nationalism is FAKE and its MYTHS are LIES, YANK BASTARDS RAPED BY THEIR OWN MARINES - ***

2008-01-12 Thread Dan Upton
On Jan 12, 2008 5:15 PM, ChairmanOfTheBored <[EMAIL PROTECTED]> wrote: > On Sat, 12 Jan 2008 11:50:07 -0800 (PST), [EMAIL PROTECTED] wrote: > > >THERMUCK > > Is a goddmned retard. > -- > http://mail.python.org/mailman/listinfo/python-list > Why was this ever on the Python list (I assume it start

Re: super, decorators and gettattribute

2008-01-12 Thread Richard Szopa
On Jan 12, 9:47 pm, Mike Meyer <[EMAIL PROTECTED]> wrote: > The same way you call any object's methods if you know it's name": > > getattr(super_object, name)(*args, **kwargs) Thanks a lot for your answer! However, I am very surprised to learn that super_object.__getattr__(name)(*args, **kw

Re: *** American nationalism is FAKE and its MYTHS are LIES, YANK BASTARDS RAPED BY THEIR OWN MARINES - ***

2008-01-12 Thread Danyelle Gragsone
Can people people be banned from this list? or the best way to handle mailings of this such is to just block or foreword the individual mailers to the trash bin? It's content like this that makes a wonderul list like this look bad Thanks, LN~ -- http://mail.python.org/mailman/listinfo/python-li

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

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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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: 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

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: 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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: *** 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: 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 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 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: 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

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

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] =

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: *** 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 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 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: 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: 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: 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: 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: 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, 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: 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

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, 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

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 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: 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: 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

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: 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

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: 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

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: *** 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: 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: 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

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: 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

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: 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

  1   2   >