Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: > On 2011-01-06, Slie wrote: > [reformated to <80 columns per RFC 1855 guidelines] > > I have read several examples on python post requests but I'm not sure > > mine needs to be that complicated. > > >From the HTML example on the page you posted:

Re: Attaching C++ libraries to Python app.

2011-01-05 Thread Stefan Sonnenberg-Carstens
Am 05.01.2011 23:44, schrieb Rohit Coder: I am just asking. In future I may need to import any C++ library, not a Crypto, but some other. Is it possible? Yes. There are at least five possible ways: - Handcode the interface and glue code (http://docs.python.org/extending) - use SWIG to autogener

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert wrote: > On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: > > > > http://code.google.com/apis/chart/docs/post_requests.html > > > > Google will return a chart in your browser from a URL that you have > built. If your URL is bigger then 2K characters it wil

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Chris Rebert
> On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert wrote: >> On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: >> > >> > http://code.google.com/apis/chart/docs/post_requests.html >> > >> > Google will return a chart in your browser from a URL that you have >> > built. If your URL is bigger then 2K characte

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Corey Richardson
On 01/06/2011 12:16 AM, Garland Fulton wrote: > I tried to use "pygooglechart.py" and I have been trying to get it set > up all day actually along with several other graphing API's. > > I just found out that there is a problem with numpy and python 3.1 that > is why I moved from the API's. Should

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
Thank you for showing me the POST request, I will defiantly learn a lot from that. On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: > On 2011-01-06, Slie wrote: > [reformated to <80 columns per RFC 1855 guidelines] > > I have read several examples on python post requests but I'm not sure > > mi

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
I tried to use "pygooglechart.py" and I have been trying to get it set up all day actually along with several other graphing API's. I just found out that there is a problem with numpy and python 3.1 that is why I moved from the API's. Should I change version just for these library's? Should I be

Re: Help with code-lists and strings

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 6:39 PM, Cathy James wrote: > > Thank you all for your help. > 1) I need to list words with uppercase first, then those with lower case; I > used istitle() and isupper (don't know the method for mixed case yet) > 2) Steve, it's a compliment that you though I'd undersand you

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 7:36 PM, Slie wrote: > > http://code.google.com/apis/chart/docs/post_requests.html > > Google will return a chart in your browser from a URL that you have built. If > your URL is bigger then 2K characters it will allow you to submit POST > requests. > > They gives examples

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Tim Harig
On 2011-01-06, Slie wrote: [reformated to <80 columns per RFC 1855 guidelines] > I have read several examples on python post requests but I'm not sure > mine needs to be that complicated. >From the HTML example on the page you posted:

Re: Help with code-lists and strings

2011-01-05 Thread Steven D'Aprano
Apologies if this comes through twice, I'm having problems with my news client and/or provider. On Wed, 05 Jan 2011 16:56:40 -0600, GrayShark wrote: > In python it's best to build up you functional needs. So two steps. > First a nand (negative 'and' operation). Then wrap that with a function >

Re: Searching Python-list

2011-01-05 Thread Philip Semanchuk
On Jan 5, 2011, at 8:31 PM, Slie wrote: > I was wondering if anyone could tell me how to search through the Archives > otter then manually looking through each month. Do a Google search and include this term: site:mail.python.org/pipermail/python-list/ e.g. to search for banana: http://www.go

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 6:24 PM Bubba said... Your code only shows the first 488 bytes of the file? add 'rb' to the open statement... >>> pdflines = open(r'c:\shared\python_book_01.pdf','rb').readlines() >>> sps = [0] >>> for ii in pdflines: sps.append(sps[-1]+len(ii)) Emile -- http://mail.python.

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 5:55 PM Bubba said... Does this work for binary files? (Like PDFs) I don't know what you want -- pdf's are not line oriented so searching for \n's is sketchy from the get go. I figured this was homework to test something Emile -- http://mail.python.org/mailman/listinfo/py

Re: Searching Python-list

2011-01-05 Thread Emile van Sebille
On 1/5/2011 5:31 PM Slie said... I was wondering if anyone could tell me how to search through the Archives otter then manually looking through each month. http://groups.google.com To limit the results to this group, prepend group:comp.lang.python to your search terms. Emile -- http://m

Re: Importing modules from miscellaneous folders

2011-01-05 Thread Benjamin Kaplan
On Wed, Jan 5, 2011 at 8:08 PM, Jshgwave wrote: > > On a Windows PC, I would like to be able to store modules in > topic-specific foldersinstead of in Python26/Lib/site-packages, > and then import into an IPython session those modules and the > functions in them. > > To test this, I have made a to

Google Chart API, HTTP POST request format.

2011-01-05 Thread Slie
http://code.google.com/apis/chart/docs/post_requests.html Google will return a chart in your browser from a URL that you have built. If your URL is bigger then 2K characters it will allow you to submit POST requests. They gives examples of HTML, JavaScript, and PHP POST requests. Is there a way

Re: Help with code-lists and strings

2011-01-05 Thread Dave Angel
On 01/-10/-28163 02:59 PM, GrayShark wrote: < In python it's best to build up you functional needs. So two steps. First a nand (negative 'and' operation). Then wrap that with a function to create two strings of your list element, you''re calling 'word'. By the way, list is reserved word, like

Re: Help with code-lists and strings

2011-01-05 Thread Cathy James
Thank you all for your help. 1) I need to list words with uppercase first, then those with lower case; I used istitle() and isupper (don't know the method for mixed case yet) 2) Steve, it's a compliment that you though I'd undersand your code, but I only know conditional statements, started on list

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Your code only shows the first 488 bytes of the file? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Does this work for binary files? (Like PDFs) -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching Python-list

2011-01-05 Thread Alice Bevan–McGregor
On 2011-01-05 17:31:13 -0800, Slie said: I was wondering if anyone could tell me how to search through the Archives otter then manually looking through each month. Grab a Usenet news reader (such as Thunderbird or Unison), point it at: nntps://news.gmane.org/gmane.comp.python.general

Re: Searching Python-list

2011-01-05 Thread Ned Deily
In article <6113bae4-29bb-416a-820f-cfcb0688d...@gmail.com>, Slie wrote: > I was wondering if anyone could tell me how to search through the Archives > otter then manually looking through each month. One way is to use the mirror of the mailing list at gmane.org: http://dir.gmane.org/gmane.com

Re: Streaming templating languages for use as WSGI body.

2011-01-05 Thread Alice Bevan–McGregor
Not sure if it's bad form to respond to your own posts, but here goes. ;) Coding up a quick hack of a templating engine, I've produced this: http://pastie.textmate.org/private/ws5jbeh1xyeaqtrhahevqw (The implementation of the engine itself is a base class that overrides __call__ and __getit

Re: Interrput a thread

2011-01-05 Thread Adam Skutt
On Jan 4, 10:53 pm, John Nagle wrote: >      There are systems where there's support designed in for thread > abort.  LISP/Scheme systems tend to support it.  QNX, the real-time > OS, has well worked out thread-abort semantics at the C level. > (QNX has really good features for "not getting stuck"

Searching Python-list

2011-01-05 Thread Slie
I was wondering if anyone could tell me how to search through the Archives otter then manually looking through each month. -- http://mail.python.org/mailman/listinfo/python-list

Importing modules from miscellaneous folders

2011-01-05 Thread Jshgwave
On a Windows PC, I would like to be able to store modules in topic-specific foldersinstead of in Python26/Lib/site-packages, and then import into an IPython session those modules and the functions in them. To test this, I have made a toy module: --- """  toy_module.py    This is for testing

Re: Help with a Python coding question

2011-01-05 Thread Justin Peel
On Wed, Jan 5, 2011 at 4:45 PM, Emile van Sebille wrote: > On 1/5/2011 3:12 PM kanth...@woh.rr.com said... > > I want to use Python to find all "\n" terminated >> strings in a PDF file, ideally returning string >> starting addresses. Anyone willing to help? >> > > pdflines = open(r'c:\shared\p

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 3:12 PM kanth...@woh.rr.com said... I want to use Python to find all "\n" terminated strings in a PDF file, ideally returning string starting addresses. Anyone willing to help? pdflines = open(r'c:\shared\python_book_01.pdf').readlines() sps = [0] for ii in pdflines: sps.append(sp

Help with a Python coding question

2011-01-05 Thread kanthony
I want to use Python to find all "\n" terminated strings in a PDF file, ideally returning string starting addresses. Anyone willing to help? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- -

Re: Help with code-lists and strings

2011-01-05 Thread GrayShark
On Wed, 05 Jan 2011 14:58:05 -0500, Terry Reedy wrote: > On 1/5/2011 12:57 PM, Cathy James wrote: > >> I am learning python and came across an excercise where i need to use >> lists to strip words from a sentence; starting with those containing >> one or more uppercase letters, followed by words

Streaming templating languages for use as WSGI body.

2011-01-05 Thread Alice Bevan–McGregor
Howdy! I'm trying to find a templating engine whose templates can be consumed directly as a WSGI response body iterable. So far I haven't been very successful with Google; the engines I've found universally generate a monolithic rendered string. Bonus points for templating engines that supp

RE: Attaching C++ libraries to Python app.

2011-01-05 Thread Rohit Coder
I am just asking. In future I may need to import any C++ library, not a Crypto, but some other. Is it possible? > Date: Wed, 5 Jan 2011 22:44:15 +0100 > Subject: Re: Attaching C++ libraries to Python app. > From: stefan.sonnenb...@pythonmeister.com > To: passionate_program...@hotmail.com > CC: p

Re: Attaching C++ libraries to Python app.

2011-01-05 Thread Robert Kern
On 1/5/11 3:44 PM, Stefan Sonnenberg-Carstens wrote: Am Mi, 5.01.2011, 22:21 schrieb Rohit Coder: Is it possible to use C++ libraries within a Python application? I am planning to write an encryption program and want to use GnuPG C++ You don't need to reinvent the wheel: http://www.dlitz.net

Re: opinion: comp lang docs style

2011-01-05 Thread Emile van Sebille
On 1/5/2011 12:10 PM ru...@yahoo.com said... A language reference manual should completely and accurately describe the language it documents. (That seems fairly obvious to me although there will be differing opinions of how precise one needs to be, etc.) Once it meets that minimum standard,

Re: Attaching C++ libraries to Python app.

2011-01-05 Thread Stefan Sonnenberg-Carstens
You don't need to reinvent the wheel: http://www.dlitz.net/software/pycrypto/ Am Mi, 5.01.2011, 22:21 schrieb Rohit Coder: > > Is it possible to use C++ libraries within a Python application? I am > planning to write an encryption program and want to use GnuPG C++ > libraries.elementFontfont-fami

Re: Trying to decide between PHP and Python

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 9:26 AM, MRAB wrote: > On 05/01/2011 10:44, Nobody wrote: >> >> On Tue, 04 Jan 2011 12:20:42 -0800, Google Poster wrote: >> >>> The indentation-as-block is unique, >> >> Not at all. It's also used in occam, Miranda, Haskell and F#. >> > Don't forget about ABC. Just to round

Re: Graphing API,

2011-01-05 Thread Slie
Thank you, I will defiantly look into that. On Jan 5, 2011, at 4:32 AM, Tim Harig wrote: > On 2011-01-05, Slie wrote: >> Is there a graphing API, someone suggests? > > You should check the archives, variations of this question get asked > a lot. > > I use GNUplot to do my graphing. I sim

Attaching C++ libraries to Python app.

2011-01-05 Thread Rohit Coder
Is it possible to use C++ libraries within a Python application? I am planning to write an encryption program and want to use GnuPG C++ libraries.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-space

Re: Creating custom Python objects from C code

2011-01-05 Thread Eric Frederich
On Wed, Jan 5, 2011 at 11:39 AM, Antoine Pitrou wrote: > On Wed, 5 Jan 2011 11:27:02 -0500 > Eric Frederich wrote: >> I have read through all the documentation here: >> >>     http://docs.python.org/extending/newtypes.html >> >> I have not seen any documentation anywhere else explaining how to >>

Re: opinion: comp lang docs style

2011-01-05 Thread ru...@yahoo.com
On 01/05/2011 12:23 AM, Alice Bevan–McGregor wrote: > > On 2011-01-04 22:29:31 -0800, Steven D'Aprano said: > > >> >> In any case, your assumption that any one documentation work should stand >> >> on its own merits is nonsense -- *nothing* stands alone. > > > > +1 I responded more fully in my res

Re: opinion: comp lang docs style

2011-01-05 Thread ru...@yahoo.com
On 01/04/2011 11:29 PM, Steven D'Aprano wrote: > On Tue, 04 Jan 2011 15:17:37 -0800, ru...@yahoo.com wrote: > >>> If one wants to critique the 'Python Docs', especially as regards to >>> usefulness to beginners, one must start with the Tutorial; and if one >>> wants to use if statements as an examp

Re: Matrix multiplication

2011-01-05 Thread Dan Stromberg
On Tue, Jan 4, 2011 at 11:31 PM, Tim Roberts wrote: > Zdenko wrote: >> >>Please, can anybody write me a simple recursive matrix multiplication >>using multiple threads in Python, or at least show me some guidelines >>how to write it myself > > Matrix multiplication is not generally done recursive

Re: Help with code-lists and strings

2011-01-05 Thread Terry Reedy
On 1/5/2011 12:57 PM, Cathy James wrote: I am learning python and came across an excercise where i need to use lists to strip words from a sentence; starting with those containing one or more uppercase letters, followed by words with lower case letters. When writing code, it is good to start w

Re: Creating custom Python objects from C code

2011-01-05 Thread Stefan Behnel
Eric Frederich, 05.01.2011 17:27: I have read through all the documentation here: http://docs.python.org/extending/newtypes.html I have not seen any documentation anywhere else explaining how to create custom defined objects from C. At this point, it is best to take a look at Cython *bef

RE: Help with code-lists and strings

2011-01-05 Thread Rob Richardson
You take a sentence and break it up into words, storing it in a list named "list". Then, for each word in the list, you set list2 to a boolean value of true or false, depending on the result of isupper() and istitle(). Note that the variable "list2" does not refer to a list. It refers to whateve

Re: Just Starting in on programming

2011-01-05 Thread Miki
http://www.openbookproject.net/thinkCSpy/ ? -- http://mail.python.org/mailman/listinfo/python-list

Help with code-lists and strings

2011-01-05 Thread Cathy James
Dear all, You folks will probably hear from me more often in the next few months. I hope some of you have time help me on occassion. Actually, a volunteer mentor would be greatly appreciated:) I am learning python and came across an excercise where i need to use lists to strip words from a senten

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Paul Rubin
Inyeol writes: > def get_all(self): > for number in self._numbers: > yield number I think def get_all(self): return iter(self._numbers) is more direct. -- http://mail.python.org/mailman/listinfo/python-list

Re: RE: Qt with PyDev

2011-01-05 Thread Benjamin Kaplan
On Jan 5, 2011 12:15 PM, "Rohit Coder" wrote: > > Seen both, but do I need to install the binaries or add a link in Pydev to PySide source-code? > You need to install the binaries. Doing that will put the pyside libraries in a location where Python and Pydev can find them automatically. > __

Re: Trying to decide between PHP and Python

2011-01-05 Thread MRAB
On 05/01/2011 10:44, Nobody wrote: On Tue, 04 Jan 2011 12:20:42 -0800, Google Poster wrote: The indentation-as-block is unique, Not at all. It's also used in occam, Miranda, Haskell and F#. Don't forget about ABC. -- http://mail.python.org/mailman/listinfo/python-list

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Peter Otten
Jacek Krysztofik wrote: > Sorry for OT, but this is actually a question of mine >> if numbers % 2 == 0: > wouldn't the following be faster? >> if numbers & 1 == 0: You can answer that and similar questions yourself with the timeit module: $ python -m timeit -s'm,

RE: Qt with PyDev

2011-01-05 Thread Rohit Coder
Seen both, but do I need to install the binaries or add a link in Pydev to PySide source-code? Date: Tue, 4 Jan 2011 07:09:53 -0800 From: gher...@islandtraining.com To: python-list@python.org Subject: Re: Qt with PyDev On 01/04/2011 12:00 AM, RP Khare wrote:

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Jacek Krysztofik
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Sorry for OT, but this is actually a question of mine > if numbers % 2 == 0: wouldn't the following be faster? > if numbers & 1 == 0: JK -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using G

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
On Tue, 4 Jan 2011, Roy Smith wrote: > There. Now that I've tossed some gasoline on the language wars fire, > I'll duck and run in the other direction :-) May I suggest a better strategy? Run first, duck next :-). Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's n

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
On Wed, 5 Jan 2011, Grant Edwards wrote: > On 2011-01-05, Tomasz Rola wrote: > > On Tue, 4 Jan 2011, Roy Smith wrote: > >> Alan Meyer wrote: > >>> On 1/4/2011 4:22 PM, Google Poster wrote: > >>> > The syntax reminds me of Lots of Interspersed Silly Parentheses > (L.I.S.P.), but withou

Re: Creating custom Python objects from C code

2011-01-05 Thread Antoine Pitrou
On Wed, 5 Jan 2011 11:27:02 -0500 Eric Frederich wrote: > I have read through all the documentation here: > > http://docs.python.org/extending/newtypes.html > > I have not seen any documentation anywhere else explaining how to > create custom defined objects from C. > I have this need to cre

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Neil Cerutti
On 2011-01-05, Inyeol wrote: > For example: I'm writing simple class: > > class Numbers: > def __init__(self, numbers): > self._numbers = numbers > def get_all(self): > for number in self._numbers: > yield number > > If I want to add anot

Creating custom Python objects from C code

2011-01-05 Thread Eric Frederich
I have read through all the documentation here: http://docs.python.org/extending/newtypes.html I have not seen any documentation anywhere else explaining how to create custom defined objects from C. I have this need to create custom objects from C and pass them as arguments to a function call

Re: Trying to decide between PHP and Python

2011-01-05 Thread Neil Cerutti
On 2011-01-05, Grant Edwards wrote: > Optimizing a language for the ease of the compiler writer is > like saying, sure, that car is expensive to buy, expensive to > run, doesn't work well, and tends to kill a lot of people, but > it took less time to design! A simple to parse syntax has non-trivi

Re: dictionary as attribute of a class...

2011-01-05 Thread tinauser
On Jan 5, 4:34 pm, Peter Otten <__pete...@web.de> wrote: > tinauser wrote: > > Hallo list, > > here again I have a problem whose solution might be very obvious, but > > I really cannot see it: > > I have a class having as attribute a dictionary whose keys are names > > and values are instance of an

Re: dictionary as attribute of a class...

2011-01-05 Thread Peter Otten
tinauser wrote: > Hallo list, > here again I have a problem whose solution might be very obvious, but > I really cannot see it: > I have a class having as attribute a dictionary whose keys are names > and values are instance of another class. > This second class has in turn as an attribute a dicti

Re: Trying to decide between PHP and Python

2011-01-05 Thread Tomasz Rola
On Wed, 5 Jan 2011, flebber wrote: > My two cents, I am understanding python far better by learning scheme. > Didn't intentionally set out to achieve that as a goal just a by > product. An excelent resource http://htdp.org and using the racket > scheme ide(as much of an ide as idle), simple thorou

Re: Trying to decide between PHP and Python

2011-01-05 Thread Grant Edwards
On 2011-01-05, Tomasz Rola wrote: > On Tue, 4 Jan 2011, Roy Smith wrote: >> Alan Meyer wrote: >>> On 1/4/2011 4:22 PM, Google Poster wrote: >>> The syntax reminds me of Lots of Interspersed Silly Parentheses (L.I.S.P.), but without the parentheses. >>> >>> I haven't heard that version

Re: dictionary as attribute of a class...

2011-01-05 Thread Benjamin Kaplan
On Wed, Jan 5, 2011 at 10:07 AM, tinauser wrote: > Hallo list, > here again I have a problem whose solution might be very obvious, but > I really cannot see it: > I have a class having as attribute a dictionary whose keys are names > and values are instance of another class. > This second class ha

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Jean-Michel Pichavant
Inyeol wrote: For example: I'm writing simple class: class Numbers: def __init__(self, numbers): self._numbers = numbers def get_all(self): for number in self._numbers: yield number If I want to add another method for yielding even num

dictionary as attribute of a class...

2011-01-05 Thread tinauser
Hallo list, here again I have a problem whose solution might be very obvious, but I really cannot see it: I have a class having as attribute a dictionary whose keys are names and values are instance of another class. This second class has in turn as an attribute a dictionary. I want a function of t

Re: why generator assigned to slice?

2011-01-05 Thread Peter Otten
ana sanchez wrote: > i found this when i read the source of a program in python: > > self.__chunks[start:end] = (chunk for i in xrange(start, end)) > what utility has to assign a generator to a slice??? ?the *final > result* isn't the same as this?: > > self.__chunks[start:end]

why generator assigned to slice?

2011-01-05 Thread ana sanchez
hi!!! i found this when i read the source of a program in python: self.__chunks[start:end] = (chunk for i in xrange(start, end)) and also this: self.__lines[line:line] = (None for i in xrange(count)) what utility has to assign a generator to a slice??? ?the *final result*

Re: Graphing API,

2011-01-05 Thread Tim Harig
On 2011-01-05, Slie wrote: > Is there a graphing API, someone suggests? You should check the archives, variations of this question get asked a lot. I use GNUplot to do my graphing. I simply pipe it commands and data through the subprocess module; but, there are libraries available for interacti

Re: Trying to decide between PHP and Python

2011-01-05 Thread Duncan Booth
Nobody wrote: > On Tue, 04 Jan 2011 12:20:42 -0800, Google Poster wrote: > >> The indentation-as-block is unique, > > Not at all. It's also used in occam, Miranda, Haskell and F#. > Also Yaml. -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Which coding style is better? public API or private method inside class definition

2011-01-05 Thread Carl Banks
On Jan 4, 8:46 pm, Inyeol wrote: > For example: I'm writing simple class: > >     class Numbers: >         def __init__(self, numbers): >             self._numbers = numbers >         def get_all(self): >             for number in self._numbers: >                 yield number > > If I want to add

Re: Trying to decide between PHP and Python

2011-01-05 Thread Alice Bevan–McGregor
On 2011-01-04 12:53:02 -0800, Alan Meyer said: I confess that I haven't used PHP so someone correct me if I'm wrong. [snip] +1 You're pretty much on the ball with your description. I might summarize it as: PHP (PHP: Hypertext Processor) is a templating language with a significant enough st

Re: Problem inserting an element where I want it using lxml

2011-01-05 Thread Alan Meyer
On 01/05/2011 01:16 AM, Josh English wrote: Here's a trimmed down version of how I did this (using ElementTree standalone, but the API should be the same) This is from a class definition and the _elem attribute is a link to an ElementTree.Element object. ... def _add_elem(self, tagName, t

Re: Problem inserting an element where I want it using lxml

2011-01-05 Thread Alan Meyer
On 01/05/2011 02:47 AM, Stefan Behnel wrote: ... Looks trivial to me. ;) ... ".iter()" gives you a recursive iterator that will also yield the "something" Element in your case, thus the incorrect counting. You only want the children, so you should iterate over the Element itself. Thanks Stepha

Re: Graphing API,

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 2:19 AM, Slie wrote: > Is there a graphing API, someone suggests? matplotlib: http://matplotlib.sourceforge.net/ Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to decide between PHP and Python

2011-01-05 Thread Nobody
On Tue, 04 Jan 2011 12:20:42 -0800, Google Poster wrote: > The indentation-as-block is unique, Not at all. It's also used in occam, Miranda, Haskell and F#. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to decide between PHP and Python

2011-01-05 Thread flebber
On Jan 5, 6:48 pm, "Octavian Rasnita" wrote: > From: "Tomasz Rola" > > > On Tue, 4 Jan 2011, Dan M wrote: > > >> As to choice between Python and PHP, I would say learn anything but PHP. > >> Even Perl has fewer tentacles than PHP. > > > However, the quality of code depends heavily on who writes i

Re: Graphing API,

2011-01-05 Thread Nitin Pawar
you can check pywebgraph On Wed, Jan 5, 2011 at 3:49 PM, Slie wrote: > Is there a graphing API, someone suggests? > -- > http://mail.python.org/mailman/listinfo/python-list > -- Nitin Pawar -- http://mail.python.org/mailman/listinfo/python-list

Graphing API,

2011-01-05 Thread Slie
Is there a graphing API, someone suggests? -- http://mail.python.org/mailman/listinfo/python-list

Re: Beautifulsoup html parsing - nested tags

2011-01-05 Thread Selvam
On Wed, Jan 5, 2011 at 2:58 PM, Selvam wrote: > Hi all, > > I am trying to parse some html string with BeatifulSoup. > > The string is, > > > > > > > > Tax > > Base > >

Beautifulsoup html parsing - nested tags

2011-01-05 Thread Selvam
Hi all, I am trying to parse some html string with BeatifulSoup. The string is, Tax Base Amount rtables=soup.findAll(re.