Re: Python HTML parser chokes on UTF-8 input

2008-10-10 Thread Marc 'BlackJack' Rintsch
On Fri, 10 Oct 2008 00:13:36 +0200, Johannes Bauer wrote: > Terry Reedy schrieb: >> I believe you are confusing unicode with unicode encoded into bytes >> with the UTF-8 encoding. Having a problem feeding a unicode string, >> not 'UFT-8 code', which in Python can only mean a UTF-8 encoded byte >>

Re: Python 2.6, GUI not working on vista?

2008-10-10 Thread Michael Shih
no mind ! bad vista ... -- From: ""Martin v. Löwis"" <[EMAIL PROTECTED]> Sent: Friday, October 10, 2008 2:28 PM To: Subject: Re: Python 2.6, GUI not working on vista? I'm not a developer, just a lowly end user. I'm not in a position to be able t

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread davidsands
On Oct 10, 4:36 am, RossRGK <[EMAIL PROTECTED]> wrote: > I'm having trouble getting my head around a solution for a situation > where I need to flexibly format some text with a varying number of > embedded fields. > > Here's a simplified description of my challenge... > > I have a list of lists cal

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Hendrik van Rooyen
"Tino Wildenhain" wrote: > > byte1 byte2? this does not look very practical > to me. In the simplest form of storing > your values in a text string, you could just > use ord() to get the byte value and > operate on it with 1<<0 1<<1 1<<3 and so on. > > If you want, put a module in which defin

Re: book recommendation for Python newbie?

2008-10-10 Thread Gabriel Rossetti
Joe Strout wrote: I'm trying to (gently) convince my business partner that we should be adding Python to our core toolset. He's never used it before, apart from poking around in the tutorial a bit at my urging. But he's got a birthday coming up, and I'd like to get him a book that will help h

Re: Inefficient summing

2008-10-10 Thread Alexander Schmolck
beginner <[EMAIL PROTECTED]> writes: > On Oct 9, 3:53 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: >> beginner <[EMAIL PROTECTED]> writes: >> how about: >> >> ratio = (lambda c: c.real/c.imag)(sum(complex(r["F1"], r["F2"] for r in >> rec))) >> > Neat, but I will have a problem if I am dealin

Re: Accessing the message of Outlook inbox

2008-10-10 Thread venutaurus539
On Oct 9, 12:19 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Oct 8, 12:50 pm, [EMAIL PROTECTED] wrote: > > > > > On Oct 8, 8:53 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > On Oct 8, 9:24 am, [EMAIL PROTECTED] wrote: > > > > > Hi all, > > > >         How can I access the body of a mail

a regular expression problem

2008-10-10 Thread lookon
I want to use django to dispatch url. The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+ \b)/(?P\d+)$'. It works when the string is English(like Google), but fails when the string is in foreign language. Can anyone tell me the righ regular expression? Thank you! -- http://mail.pyth

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Hendrik van Rooyen
George Sakkis wrote: >I don't know of a canonical way (bit hacking is not really common in >Python) but pehaps BitPacket [1] comes close to what you're after. > >George > >[1] http://hacks-galore.org/aleix/BitPacket/ Thanks for the link - I will check it out - Hendrik -- http://mail.python.org/

Re: Debugging suggestions, efficiency - handling modules

2008-10-10 Thread Almar Klein
You might like IPython, it is an interactive python shell and you caneasily run scripts from it. That way, the active session remains, as well as all the imports. Personally, I don't like the "from pylab import *", the python philosophy says: "Namespaces are one honking great idea -- let's do more

Re: Porn Addiction Solutions?

2008-10-10 Thread Dotan Cohen
2008/10/10 <[EMAIL PROTECTED]>: > I have to compliment you guys with your suggestions and support. Most > other groups would have a field day and not be helpful. > Compassion is rarely present on usenet. Actually, I suspect that the OP was trolling. But in any case it is a problem that is pretty

Re: component / event based web framework for python?

2008-10-10 Thread lkcl
On Sep 15, 4:53 pm, Jaime Barciela <[EMAIL PROTECTED]> wrote: > Hello all, > > I've been surveying the field ofpythonweb frameworks for a while but > there are just too many so I ask mighty Usenet. > > Is there a component / event based web framework forpython? Something > that can abstract you fro

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > Yes, that's a wonderful thing, because from the code I see around > 99.9% of people see the cmp and just use it, totally ignoring the > presence of the 'key' argument, that allows better and shorter > solutions of the sorting problem. Me too because I

Home Shop 18 - Zenith Desktop Model No: G31645

2008-10-10 Thread Ayushi Mehra
Home Shop 18 - Zenith Desktop Model No: G31645 Features: Processor: * Pentium Core2Duo - E4600 * 2.4GHz * 2MB Cache * 800 MHz FSB RAM: * 512MB DDR2-667 SDRAM -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-10 Thread mmgarvey
On Oct 8, 10:56 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: >> I think that (0).numbits()==-1 is the natural solution. > > Can you clarify this?  Why is -1 the natural solution? I > can see a case for 0, for -infinity (whatever that means), > or for raising an exception, but I can't see why -1 wo

Re: a regular expression problem

2008-10-10 Thread Bruno Desthuilliers
lookon a écrit : I want to use django to dispatch url. The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+ \b)/(?P\d+)$'. It works when the string is English(like Google), but fails when the string is in foreign language. Care to give an exemple of url that fails ? Anyway, if you

Re: default value in __init__

2008-10-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers: >> You mean : "to people that don't bother reading the FineManual *nor* >> searching the newsgroup / ML archives ?" > > Are there ways to change how Python3 manages arguments and functions, > to remove this antifeature of Python, avoiding this commo

Re: book recommendation for Python newbie?

2008-10-10 Thread Abah Joseph
Core Python Programming" written by Wesley J. Chun, second edition, Prentice Hall, ISBN 0-13-226993-7, go for it. I`m only a PHP programmer and this book have helped me a lot from basic to advance level. though i`m still reading... On 10/10/08, slais-www <[EMAIL PROTECTED]> wrote: > > Mike Drisc

Re: Debugging suggestions, efficiency - handling modules

2008-10-10 Thread Bruno Desthuilliers
John [H2O] a écrit : Hello, I am writing some scripts that run a few calculations using scipy and plot the results with matplotlib (i.e. pylab). What I have found, however, is that the bulk of the time it takes to run the script is simply in loading modules. Is this loading time really that h

Enormous amount webcams womans showing groupsex. Free

2008-10-10 Thread fernandena
Enormous amount webcams womans showing groupsex. http://sexystory.psend.com/groupsex.htm -- http://mail.python.org/mailman/listinfo/python-list

indexing arrays

2008-10-10 Thread John [H2O]
I'm having trouble slicing arrays: I thought I could do the following: >>> i = array(range(140,149)) >>> j = array(range(5,20)) >>> a = acc[i,j] Traceback (most recent call last): File "", line 1, in ValueError: shape mismatch: objects cannot be broadcast to a single shape It's strange, becau

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
> Thomas Heller wrote: >> Does Python 3 have no way anymore to sort with a comparison function? >> >> Both [].sort() and sorted() seem to accept only 'key' and 'reverse' >> arguments, >> the 'cmp' argument seems to be gone. Can that be? Terry Reedy schrieb: > Yes. When this was discussed, no

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread RossRGK
Kerri Reno wrote: Ross, I'm no expert in python, so excuse me if this is inane. What I would do is have fmts be a dictionary where fmts = { 3 = 'oats %0d kilos over %0d days with %0d workers', 2 = 'barley %0d lbs for %0d hours', 1 = 'apples %0d baskets'} then something like

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread RossRGK
davidsands wrote: The tuple() type-conversion function will do what you need: print fmts[0] % tuple(bigList[0]) print fmts[1] % tuple(bigList[1]) print fmts[2] % tuple(bigList[2]) I never thought of the tuple type conversion - that looks promising. Thanks for that! R. -- http://

Re: indexing arrays

2008-10-10 Thread Emily Rodgers
"John [H2O]" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I'm having trouble slicing arrays: > > I thought I could do the following: i = array(range(140,149)) j = array(range(5,20)) a = acc[i,j] > Traceback (most recent call last): > File "", line 1, in > Value

Re: Porn Addiction Solutions?

2008-10-10 Thread pheeh . zero
On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: > On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > > > It's very simple. You need to know the world is much more than the > > imaginery life you are looking. Spend some time in the feet of the > > Lord Jesus who would help you to come out

Re: FLexible formatted text involving nested lists?

2008-10-10 Thread Tino Wildenhain
Hi, RossRGK wrote: Kerri Reno wrote: Ross, I'm no expert in python, so excuse me if this is inane. What I would do is have fmts be a dictionary where fmts = { 3 = 'oats %0d kilos over %0d days with %0d workers', 2 = 'barley %0d lbs for %0d hours', 1 = 'apples %0d baskets'}

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Hendrik van Rooyen
Mensanator wrote: >I use the gmpy module for all my bit related work and >have been very satisfied with the results. 8<--- gmpy function list --- Thanks. All of this looks good. Will check out gmpy too. - Hendrik -- http://mail.python.org/mailman/listinfo/python-

Re: default value in __init__

2008-10-10 Thread Bruno Desthuilliers
David C. Ullrich a écrit : In article <[EMAIL PROTECTED]>, kenneth <[EMAIL PROTECTED]> wrote: On Oct 9, 10:14 am, Christian Heimes <[EMAIL PROTECTED]> wrote: kenneth wrote: the 'd' variable already contains the 'self.d' value of the first instance and not the default argument {}. Am I doing

Re: default value in __init__

2008-10-10 Thread bearophileHUGS
Bruno Desthuilliers: > You mean : "to people that don't bother reading the FineManual *nor* > searching the newsgroup / ML archives ?" Are there ways to change how Python3 manages arguments and functions, to remove this antifeature of Python, avoiding this common mistake done by every newbie? I do

Re: default value in __init__

2008-10-10 Thread bearophileHUGS
Duncan Booth: > You can't just copy the default values on every call: you would still get > people confused by the semantics whether you did a shallow or deep copy or > as now no copy. I think I agree. > I don't think simply re-executing the default argument > expression on each call works eithe

Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Jonathan Fine
Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any recommendations? Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: book recommendation for Python newbie?

2008-10-10 Thread slais-www
Mike Driscoll wrote: A lot of people recommend Lutz's "Learning Python". While I haven't read it, I have read his follow-up "Programming Python" and it was I found Learning Python good for learning, and a useful reference sometimes, but it can seem very slow paced if you already know some oth

Get "code object" of class

2008-10-10 Thread Okko Willeboordse
To get the "code object" c of my_class I can do; c = compile(inspect.getsource(my_class), "

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Ross Ridge
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: >Is there a canonical way to address the bits in a structure >like an array or string or struct? > >Or alternatively, is there a good way to combine eight >ints that represent bits into one of the bytes in some >array or string or whatever? This is the

extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Hello :) The result of various incompatibilities has left me needing to somehow extract the address that a null pointer is pointing to with the null pointer being exposed to python via PyCObject_FromVoidPtr the code that creates the PyCObject is as follows: tmp = PyCObject_FromVoidPtr (info.i

List Order of Initialization

2008-10-10 Thread SamFeltus
When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] -- http://mail.python.org/mailman/listinfo/python-list

Re: List Order of Initialization

2008-10-10 Thread Diez B. Roggisch
SamFeltus schrieb: When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] Yes. Diez -- http://mail.python.org/m

Re: a regular expression problem

2008-10-10 Thread Leefurong
> > I want to use django to dispatch url. > > The url is like /test/Google/6,and my patten is r'^/test/(?P\b\W+ \W should be \w, a typo? :) > > \b)/(?P\d+)$'. > > It works when the string is English(like Google), but fails when the > > string is in foreign language. Try this: r'(?u)^/test/(?P\b\w+\

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Tino Wildenhain
Hendrik van Rooyen wrote: "Tino Wildenhain" wrote: byte1 byte2? this does not look very practical to me. In the simplest form of storing your values in a text string, you could just use ord() to get the byte value and operate on it with 1<<0 1<<1 1<<3 and so on. If you want, put a module in

a regular expression problem

2008-10-10 Thread gita ziabari
> > > > > -- Forwarded message -- > From: lookon <[EMAIL PROTECTED]> > To: python-list@python.org > Date: Fri, 10 Oct 2008 03:58:08 -0700 (PDT) > Subject: a regular expression problem > I want to use django to dispatch url. > The url is like /test/Google/6,and my patten is r'^/test/

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Hendrik van Rooyen
Lie Ryan wrote: >You'll find that in most cases, using integer or Boolean is enough. There >are some edge cases, which requires bit addressing for speed or memory >optimizations, in python, the usual response to that kind of optimization >requirement is to move that part of the code to C. > >If,

Debugging suggestions, efficiency - handling modules

2008-10-10 Thread John [H2O]
Hello, I am writing some scripts that run a few calculations using scipy and plot the results with matplotlib (i.e. pylab). What I have found, however, is that the bulk of the time it takes to run the script is simply in loading modules. Granted, I am currently using: from pylab import * However

Re: inspect feature

2008-10-10 Thread Bruno Desthuilliers
Aaron "Castironpi" Brady a écrit : On Oct 9, 3:48 am, Bruno Desthuilliers wrote: Aaron "Castironpi" Brady a écrit : Hello, The 'inspect' module has this method: inspect.getargvalues(frame) It takes a frame and returns the parameters used to call it, including the locals as defined in the fr

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Hendrik van Rooyen
"Tino Wildenhain" wrote: > Hendrik van Rooyen wrote: > > "Tino Wildenhain" wrote: 8< > > Sure, one could for instance make a list of eight-entry lists: > > > > io = [[b0,b1,b2,b3,b4,b5,b6,b7],] > > what should that represent? Which byte order > do you have in

Re: Porn Addiction Solutions?

2008-10-10 Thread Um Jammer NATTY
On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > It's very simple. You need to know the world is much more than the > imaginery life you are looking. Spend some time in the feet of the > Lord Jesus who would help you to come out of this trouble. Does anyone else find it amusing that this poster ass

Re: Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Christian Heimes
Jonathan Fine wrote: Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any recommendations? Yeah, please implement a nice wrapper and submit a patch to bugs.python.o

Re: Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Mike Driscoll
On Oct 10, 9:44 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > I'm using the _winreg module to change Windows registry settings, but > its rather low level, and I'd prefer to be working with something more > Pythonic. > > Does anyone have any recommendations? > > Jonathan I've used YARW

Re: How to do regular BASH work in Python?

2008-10-10 Thread Michael Torrie
Frantisek Malina wrote: > What is the best way to do the regular bash commands in native python? > > - create directory > - create file > - make a symlink > - copy a file to another directory > - move a file > - set permissions > > I need to write a program that creates real application/FTP accou

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 5:24 am, Gordon Allott <[EMAIL PROTECTED]> wrote: > Hello :) > > The result of various incompatibilities has left me needing to somehow > extract the address that a null pointer is pointing to with the null > pointer being exposed to python via PyCObject_FromVoidPtr > > the code that cre

unified_diff

2008-10-10 Thread [EMAIL PROTECTED]
I can create a unified diff as follows: udiff = difflib.unified_diff(text1, text2) Is there an available function somewhere to apply udiff to text1 and construct text2, like this? text2 = some_func(text1, udiff) Thanks for any clues. -- http://mail.python.org/mailman/listinfo/python-list

Python Boot Camp 11/10-11/14

2008-10-10 Thread Kerri Reno
Anyone thinking about attending the Python Boot Camp at Big Nerd Ranch? This is the time. If they don't get one more person they will cancel the session. So if you're on the fence, take one for the Gipper, and sign up for the November session. http://www.bignerdranch.com/classes/python.shtml K

GzipFile(fileobj=sys.stdin) Why not?

2008-10-10 Thread Brian Cole
Appears like a patch was submitted to allow GzipFile to work from pipes long ago. But there's no comment on why this was never accepted. Is there a good reason? http://mail.python.org/pipermail/patches/2006-June/020064.html -Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > Did you try: > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > PyDict_SetItemString (dict, "display", tmp); > Py_DECREF (tmp); > > Or also try: > > PyCObject_AsVoidPtr( tmp ); > -- > http://mail.python.org/mailman/listinfo/python-list the problem is

Re: inspect feature

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 3:36 am, Bruno Desthuilliers wrote: > Aaron "Castironpi" Brady a écrit : > > > > > On Oct 9, 3:48 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> Aaron "Castironpi" Brady a écrit : > > >>> Hello, > >>> The 'inspect' module has this method: > >>> inspect.getargvalues(frame) > >

Re: default value in __init__

2008-10-10 Thread Chris Rebert
On Fri, Oct 10, 2008 at 4:36 AM, <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers: >> You mean : "to people that don't bother reading the FineManual *nor* >> searching the newsgroup / ML archives ?" > > Are there ways to change how Python3 manages arguments and functions, > to remove this antifeat

Re: python 3: sorting with a comparison function

2008-10-10 Thread pruebauno
On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > Yes, that's a wonderful thing, because from the code I see around > > 99.9% of people see the cmp and just use it, totally ignoring the > > presence of the 'key' argument, that allows bett

Subprocess problem on multiple OS's

2008-10-10 Thread Amanda Jamin
Subprocess issues with platform independence Postby ajamin on Wed Oct 08, 2008 10:46 am I am writing a python script that will act as a wrapper for another program. The python script will provide the inputs for this program and will verify that the output is correct. The application runs on multip

Re: default value in __init__

2008-10-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: >> I don't think simply re-executing the default argument >> expression on each call works either: that would confuse at least as >> many people as the current system. > > May I ask you why? I think I don't agree, but I am not sure. > My thought (which may well be wrong)

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Aaron "Castironpi" Brady
On Oct 10, 12:04 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Did you try: > > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > > PyDict_SetItemString (dict, "display", tmp); > > Py_DECREF (tmp); > > > Or also try: > > > PyCObject_AsVoidPtr( tmp ); >

Re: default value in __init__

2008-10-10 Thread bearophileHUGS
Chris Rebert: > The general idea been discussed ad-nauseum on the list several times > before, including just 2 months ago. See e.g.: Okay, it can't be fixed then. Bye and thank you, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Porn Addiction Solutions?

2008-10-10 Thread John Ladasky
On Oct 8, 12:30 pm, [EMAIL PROTECTED] wrote: > On Oct 8, 3:07 pm, [EMAIL PROTECTED] wrote: > > Any suggestions? Sure -- my suggestion is to post in relevant newsgroups! Rec.music.hip-hop, comp.lang.python, comp.lang.ruby, and alt.comp.freeware are not appropriate places for your inquiries. Alt.su

Re: urlparse import Faillure

2008-10-10 Thread Wojtek Walczak
On Thu, 9 Oct 2008 22:47:58 -0700 (PDT), Robert Hancock wrote: import CGIHTTPServer ... > ImportError: cannot import name urlparse ... > It points to the third line of the comment. Any ideas on how to > proceed with the debugging? Have you tried getting rid of this comment? I doubt tha

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 19:22, [EMAIL PROTECTED] wrote: > On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > > Yes, that's a wonderful thing, because from the code I see around > > > 99.9% of people see the cmp and just use it, totally ignoring th

Re: Get "code object" of class

2008-10-10 Thread Matimus
On Oct 10, 5:50 am, Okko Willeboordse <[EMAIL PROTECTED]> wrote: > To get the "code object" c of my_class I can do; > > c = compile(inspect.getsource(my_class), "

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: Python 2.5.3: call for patches

2008-10-10 Thread troelswh
On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > In principle, the release will include all changes that are already on > the release25-maint branch in subversion [1]. If you think that specific > changes should be considered, please create an issue in the bug tracker > [2], and la

Modification of a urllib2 object ?

2008-10-10 Thread vincehofmeister
I have several ways to the following problem. This is what I have: ... import ClientForm import BeautifulSoup from BeautifulSoup request = urllib2.Request('http://form.com/) self.first_object = urllib2.open(request) soup = BeautifulSoup(self.first_object) forms = ClienForm.ParseResponse(self

Re: python 3: sorting with a comparison function

2008-10-10 Thread bearophileHUGS
Kay Schluehr: > Sometimes it helps when people just make clear how they use technical > terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3: sorting with a comparison function

2008-10-10 Thread Paul McGuire
On Oct 10, 12:22 pm, [EMAIL PROTECTED] wrote: > On Oct 10, 8:35 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: > > > > Yes, that's a wonderful thing, because from the code I see around > > > 99.9% of people see the cmp and just use it, totally ignoring

Where/how to propose an addition to a standard module?

2008-10-10 Thread Joe Strout
I would like to propose a new method for the string.Template class. What's the proper procedure for doing this? I've joined the python- ideas list, but that seems to be only for proposed language changes, and my idea doesn't require any change to the language at all. From

Re: How to create a tuple quickly with list comprehension?

2008-10-10 Thread Hatem Nassrat
on Wed Jun 13 10:17:24 CEST 2007, Diez B. Roggisch deets at nospam.web.de wrote: >markacy wrote: > >> On 13 Cze, 09:45, "fdu.xia... at gmail.com" > gmail.com> wrote: >>> Hi all, >>> >>> I can use list comprehension to create list quickly. So I >>> expected that I >>> can created tuple quickly with

Re: Python 2.5.3: call for patches

2008-10-10 Thread Michael Ströder
[EMAIL PROTECTED] wrote: > On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> In principle, the release will include all changes that are already on >> the release25-maint branch in subversion [1]. If you think that specific >> changes should be considered, please create an issue in

Re: Where/how to propose an addition to a standard module?

2008-10-10 Thread Skip Montanaro
> I would like to propose a new method for the string.Template class. What's > the proper procedure for doing this? There is a python-ideas mailing list. I think that's probably the right place to start. If it gets a generally favorable response there, adding a feature request with an implementa

Set Your EMAIL CLIENT dates correctly.

2008-10-10 Thread Hatem Nassrat
I am sure this has been ranted about. People who have their dates in their client set to 2020 should be banned from using the internet, unless they have a legitimate reason like doing y3k testing on the Python Mailing list. -- Hatem Nassrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Porn Addiction Solutions?

2008-10-10 Thread Aspersieman
On Fri, 10 Oct 2008 16:11:07 +0200, <[EMAIL PROTECTED]> wrote: On Oct 10, 7:03 am, Um Jammer NATTY <[EMAIL PROTECTED]> wrote: On Oct 10, 5:37 am, [EMAIL PROTECTED] wrote: > It's very simple. You need to know the world is much more than the > imaginery life you are looking. Spend some time in t

Re: Porn Addiction Solutions?

2008-10-10 Thread Reacher
On Oct 8, 2:07 pm, [EMAIL PROTECTED] wrote: > Help, I'm addicted to porn. I've been spending a lot of time > downloading hardcore porn and masturbating to it. It's ruining my > life. I just found out that one of these sites somehow hacked my card > and rang up $5K in charges which they won't even r

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 20:38, [EMAIL PROTECTED] wrote: > Kay Schluehr: > > > Sometimes it helps when people just make clear how they use technical > > terms instead of invoking vague associations. > > And generally Python docs can enjoy growing few thousands examples... Cleaning up and extending documentatio

Re: Modification of a urllib2 object ?

2008-10-10 Thread George Sakkis
On Oct 10, 2:32 pm, [EMAIL PROTECTED] wrote: > I have several ways to the following problem. > > This is what I have: > > ... > import ClientForm > import BeautifulSoup from BeautifulSoup > > request = urllib2.Request('http://form.com/) > > self.first_object = urllib2.open(request) > > soup = Beaut

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Kay Schluehr: >> Sometimes it helps when people just make clear how they use technical >> terms instead of invoking vague associations. > > And generally Python docs can enjoy growing few thousands examples... Well, that may not be necessary. But I think that a clear

Using multiprocessing

2008-10-10 Thread nhwarriors
I am attempting to use the (new in 2.6) multiprocessing package to process 2 items in a large queue of items simultaneously. I'd like to be able to print to the screen the results of each item before starting the next one. I'm having trouble with this so far. Here is some (useless) example code th

Re: python 3: sorting with a comparison function

2008-10-10 Thread Terry Reedy
Kay Schluehr wrote: Me too because I don't get this: "key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None." I am not sure what you do not get, but it should say 'for example, key=str.lower." None

Read data from Serial Command

2008-10-10 Thread brianrpsgt1
I am new to scripting. I am trying to read the settings from a serial device using Python. I have been able to successfully connect to the device and change baud rate settings, ect... with PySerial. I am trying to send a command to the serial device and capture the returned info, however, it is

Re: extracting null pointer address from PyCObject with ctypes

2008-10-10 Thread Gordon Allott
Aaron "Castironpi" Brady wrote: > I see. If I understand, you have a PyCObject in a dictionary. > > Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr. Its > return type should be 'c_void_p', and you can use 'result.value' to > get the original pointer. > -- > http://mail.python.org

Re: indexing arrays

2008-10-10 Thread Terry Reedy
John [H2O] wrote: I'm having trouble slicing arrays: If these are numpy arrays, as appears, rather that array module arrays, then the numpy list might be a better place. In any case, using 'numpy' would have gotten the attention of someone scanning for posts about numpy. I thought I coul

Re: Read data from Serial Command

2008-10-10 Thread Grant Edwards
On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > I am new to scripting. I am trying to read the settings from a serial > device using Python. I have been able to successfully connect to the > device and change baud rate settings, ect... with PySerial. I am > trying to send a command to th

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
Thanks for the message What exactly is happening is that the return is "None" for the command that I am sending. If I connect through Hyperterminal and execute the 'sh nw enc' command, it returns 'WEP' I have confirmed that the serial port is correct and open with the s.isOpen() function. Also

Re: List Order of Initialization

2008-10-10 Thread Terry Reedy
Diez B. Roggisch wrote: SamFeltus schrieb: When a list initializes, will it always evaluate in order starting at element 0 and finishing with the last element? def f1(x): return x + 2 def f2(x): return x * 2 def f3(x): return x * 3 the_list = [f1(7), f2(8), f3(4)] Yes. From t

Re: Python 2.5.3: call for patches

2008-10-10 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Oct 7, 9:27 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: In principle, the release will include all changes that are already on the release25-maint branch in subversion [1]. If you think that specific changes should be considered, please create an issue in the bug

python debugger tips?

2008-10-10 Thread just . another . random . user
Hi All, I'm switching to python from perl, and like the language a ton, but I find pdb and pydb to be vastly inferior debuggers to the perl version. In particular, I've grown very used to stepping into arbitrary functions interactively. For instance, in perl you can do this: casqa1:~> perl -de

Re: List Order of Initialization

2008-10-10 Thread Ben Finney
SamFeltus <[EMAIL PROTECTED]> writes: > When a list initializes, will it always evaluate in order starting at > element 0 and finishing with the last element? > > def f1(x): > return x + 2 > > def f2(x): > return x * 2 > > def f3(x): > return x * 3 > > the_list = [f1(7), f2(8), f3(

Re: python debugger tips?

2008-10-10 Thread Stef Mientki
take a look at winpdb (which has no relation with Windows-OS !! cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

How to uninstall/update modules

2008-10-10 Thread pjacobi . de
Dear All, It seems I don't understand how Python packages are handled. Here's my specific problem * I'm on Win32 * I've installed Enthought Python 2.5 because it got all the numerical stuff included * Later I tried to install Twisted 8.1 Twisted ended up in C:\Python\Lib\site-packages\twisted

Re: Read data from Serial Command

2008-10-10 Thread Grant Edwards
On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > Thanks for the message > > What exactly is happening is that the return is "None" for the command > that I am sending. If I connect through Hyperterminal and execute the > 'sh nw enc' command, it returns 'WEP' It looks to me like you're neve

PIL on windows XP x64 (64-bit)?

2008-10-10 Thread Berco Beute
Has anybody here got PIL (the Image lib) working on Windows XP x64 (64- bit)? There is no version available for that platform from pythonware.com. Thanks, 2B -- http://mail.python.org/mailman/listinfo/python-list

Re: Modification of a urllib2 object ?

2008-10-10 Thread vincehofmeister
On Oct 10, 1:02 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 10, 2:32 pm, [EMAIL PROTECTED] wrote: > > > > > I have several ways to the following problem. > > > This is what I have: > > > ... > > import ClientForm > > import BeautifulSoup from BeautifulSoup > > > request = urllib2.Request(

DNS Zonefile editor

2008-10-10 Thread preacher37
I am looking for a web based zone file editor written in python to be used to allow customers to modify their DNS records in a bind style DNS system. Any info regarding existing projects is appreciated. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read data from Serial Command

2008-10-10 Thread brianrpsgt1
Gave that a shot what is happening is that the script is hanging. Does that mean that the write function is not making it through, thus there is nothing to return? Grant Edwards wrote: > On 2008-10-10, brianrpsgt1 <[EMAIL PROTECTED]> wrote: > > Thanks for the message > > > > What exactly i

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 23:04, Terry Reedy <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Me too because I don't get this: > > > "key specifies a function of one argument that is used to extract a > > comparison key from each list element: key=str.lower. The default > > value is None." > > I am not sure

  1   2   >