Changing Python Opcodes

2009-08-17 Thread Sreejith K
Hi, I know this is not the best way to do it. But I have to do it at least to make it *hard* to decompile the python bytecode. I want to distribute a software written in Python without the source. So I compiled Python from source changing some opcode values (Taking care of HAVE_ARGUMENT value) an

Re: XML parsing with python

2009-08-17 Thread Stefan Behnel
John Posner wrote: >> Use the iterparse() function of the xml.etree.ElementTree package. > > iterparse() is too big a hammer for this purpose, IMO. How about this: > > from xml.etree.ElementTree import ElementTree > tree = ElementTree(None, "myfile.xml") > for elem in tree.findall('//book/titl

Re: XML parsing with python

2009-08-17 Thread Stefan Behnel
inder wrote: > On Aug 17, 8:31 pm, John Posner wrote: >>> Use the iterparse() function of the xml.etree.ElementTree package. >>> http://effbot.org/zone/element-iterparse.htm >>> http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk >>> Stefan >> iterparse() is too big a hammer for this pur

Re: define class over 2 files

2009-08-17 Thread Steven D'Aprano
On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote: > Is it possible to split up a class definition over multiple files? Not exactly, but you can do variations of this: In file A.py, create: class Parent: def method(self): return "Method" In file B.py, do this: import A class Chil

Re: Need cleanup advice for multiline string

2009-08-17 Thread Steven D'Aprano
On Mon, 17 Aug 2009 21:35:48 -0700, Carl Banks wrote: >> > > > I like how being very friendly means calling people after a guy >> > > > who tried to blow up the English Parliament. >> >> > > So? >> >> > I also like how making an amusing pointless observation >> >> Pointless, yes, but what was amus

Re: XML parsing with python

2009-08-17 Thread inder
On Aug 17, 8:31 pm, John Posner wrote: > > Use the iterparse() function of the xml.etree.ElementTree package. > > >http://effbot.org/zone/element-iterparse.htm > >http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk > > > Stefan > > iterparse() is too big a hammer for this purpose, IMO. H

Re: Data visualization in Python

2009-08-17 Thread abalter
On Aug 17, 12:10 pm, kj wrote: > I'm looking for a good Python package for visualizing > scientific/statistical data.  (FWIW, the OS I'm interested in is > Mac OS X). > > The users of this package will be experimental biologists with > little programming experience (but currently learning Python).

Re: Diversity in Python

2009-08-17 Thread Ben Finney
Steven D'Aprano writes: > The comments were made a week ago -- why the sudden flurry of > attention? In my case, it's because I was ignoring the thread in which they were made. The change of subject drew them to my attention, where I saw the community response was (IMO) insufficient at the time,

Re: define class over 2 files

2009-08-17 Thread Xavier Ho
On Tue, Aug 18, 2009 at 2:45 PM, naveen wrote: > Is it possible to split up a class definition over multiple files? > - Answer in short, I don't think so. Now why would you want to do that? There is another solution - have a main class for shared methods, and have other classes [in different

define class over 2 files

2009-08-17 Thread naveen
Is it possible to split up a class definition over multiple files? -- http://mail.python.org/mailman/listinfo/python-list

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Aahz
In article , Steven D'Aprano wrote: > >The comments were made a week ago -- why the sudden flurry of attention? Mainly an opportunity to flog the new diversity list. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "I saw `cout' being shifted "Hello world" times

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Steven D'Aprano
On Mon, 17 Aug 2009 13:56:13 -0700, Paul Rubin wrote: > Python 3.0 went overboard by actually removing the cmp argument and > requiring use of the key argument. That requires various kludges if the > key is, say, a tree structure that has to be recursively compared with > another such structure.

Re: Need cleanup advice for multiline string

2009-08-17 Thread Steven D'Aprano
On Mon, 17 Aug 2009 18:04:58 -0700, Carl Banks wrote: > On Aug 17, 5:40 pm, Mensanator wrote: >> On Aug 17, 4:06 pm, Carl Banks wrote: >> >> > On Aug 17, 10:03 am, Jean-Michel Pichavant >> > wrote: >> >> > > I'm no English native, but I already heard women/men referring to a >> > > group as "gu

Re: Need cleanup advice for multiline string

2009-08-17 Thread Carl Banks
On Aug 17, 8:49 pm, Mensanator wrote: > On Aug 17, 8:04 pm, Carl Banks wrote: > > > > > > > On Aug 17, 5:40 pm, Mensanator wrote: > > > > On Aug 17, 4:06 pm, Carl Banks wrote: > > > > > On Aug 17, 10:03 am, Jean-Michel Pichavant > > > > wrote: > > > > > > I'm no English native, but I already h

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Steven D'Aprano
On Mon, 17 Aug 2009 14:31:51 -0700, Chris Rebert wrote: >> Oh come on, one newbie making an off-color joke is not any sort of >> reflection of the community as a whole. >> >> Anyway it's pretty naive to expect what is now a large community to >> avoid bad eggs altogether.  Price you pay for popula

Re: Text lost when I write file

2009-08-17 Thread Ben Finney
Chris Rebert writes: > On Mon, Aug 17, 2009 at 8:45 PM, roy...@gmail.com wrote: > > I try to write text into a file but some text lost when the size of > > the text content is over 32K. > > Is that relate to the buffer of the python and any setting can solve > > this problem??. > > Please show us

Re: Text lost when I write file

2009-08-17 Thread Chris Rebert
On Mon, Aug 17, 2009 at 8:45 PM, roy...@gmail.com wrote: > Dear All, > > I try to write text into a file but some text lost when the size of > the text content is over 32K. > Is that relate to the buffer of the python and any setting can solve > this problem??. Please show us the code you're using

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Terry Reedy
Nathan Keel wrote: idiot ... asshole absolutely clueless ... idiot ...incredibly arrogant, yet incredibly clueless. To me, such name-calling is as obnoxious as the intended target. tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread Terry Reedy
exar...@twistedmatrix.com wrote: There's a lot of things in Python that I don't strictly *need*. That doesn't mean that they wouldn't be welcome if I could have them. Getting rid of the range/xrange dichotomy would improve things. The developers agreed a couple of years ago. Starting using 3

Re: Need cleanup advice for multiline string

2009-08-17 Thread Mensanator
On Aug 17, 8:04�pm, Carl Banks wrote: > On Aug 17, 5:40�pm, Mensanator wrote: > > > On Aug 17, 4:06�pm, Carl Banks wrote: > > > > On Aug 17, 10:03�am, Jean-Michel Pichavant > > > wrote: > > > > > I'm no English native, but I already heard women/men referring to a > > > > group as "guys", no mat

Text lost when I write file

2009-08-17 Thread roy...@gmail.com
Dear All, I try to write text into a file but some text lost when the size of the text content is over 32K. Is that relate to the buffer of the python and any setting can solve this problem??. Regards Roy -- http://mail.python.org/mailman/listinfo/python-list

Re: New to python

2009-08-17 Thread Chris Rebert
On Mon, Aug 17, 2009 at 7:49 PM, Allan Fong wrote: > Hi! I'm fairly new to Python.  I understand the basics basics but I'm been > trying to write a simple python code that will let me read input data from > my USB drive and write it in a text file and I am so lost.  Can anyone help > or direct me t

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Rami Chowdhury
My sample interactive session (locale.setlocale and all) was on a 32-bit Vista install of Python 2.5, so it works on that... --- Rami Chowdhury "A man with a watch knows what time it is. A man with two watches is never sure". -- Segal's Law 408-597-7068 (US) / 07875-841-046 (UK) / 0189-24

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread rurpy
On 08/13/2009 08:46 AM, Paul Boddie wrote: > On 13 Aug, 16:05, ru...@yahoo.com wrote: >> All the above not withstanding, I too think a wiki is worth >> trying. But without doing a lot more than just "setting up >> a wiki", I sadly believe even a python.org supported wiki >> is doomed to failure. >

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Ben Finney
Jonathan Gardner writes: > On Aug 17, 5:20 pm, Ben Finney wrote: > > Instead, you should generate the map based on the standard library (in > > this case, the underlying C standard library) locale database > > http://docs.python.org/library/locale.html?highlight=locale%20date#lo...>: > > Does Wi

New to python

2009-08-17 Thread Allan Fong
Hi! I'm fairly new to Python. I understand the basics basics but I'm been trying to write a simple python code that will let me read input data from my USB drive and write it in a text file and I am so lost. Can anyone help or direct me to some resources? Thank you! -- http://mail.python.org/ma

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Jonathan Gardner
On Aug 17, 5:18 pm, "Rami Chowdhury" wrote: > > >>> import locale > >>> locale.setlocale(locale.LC_ALL, 'FR') locale is nice when you only have a single thread. Webservers aren't single threaded. You can't serve up one page for one locale and then another in another locale without seeing very, v

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Jonathan Gardner
On Aug 17, 7:06 pm, Ben Finney wrote: > Jonathan Gardner writes: > > Unfortunately, there isn't any string to date parsers in the built- > > ins. > > Fortunately, Python 2.5 or later has the ‘datetime.strptime’ function. > Hate to weasel out of this one, but the language that strptime provides i

Re: unittest

2009-08-17 Thread Ben Finney
Mag Gam writes: > all, thank you very much!!! > > Now my question is You would do well to ask more about testing in Python on the focussed forum for that topic, the ‘testing-in-python’ mailing list http://lists.idyll.org/listinfo/testing-in-python>. -- \“If it ain't bust don't fix it

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Jonathan Gardner
On Aug 17, 5:20 pm, Ben Finney wrote: > > Instead, you should generate the map based on the standard library (in > this case, the underlying C standard library) locale database > http://docs.python.org/library/locale.html?highlight=locale%20date#lo...>: > Does Windows support POSIX locales? --

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Ben Finney
Jonathan Gardner writes: > Unfortunately, there isn't any string to date parsers in the built- > ins. Fortunately, Python 2.5 or later has the ‘datetime.strptime’ function. -- \ “You could augment an earwig to the point where it understood | `\ nuclear physics, but it would still

Re: unittest

2009-08-17 Thread Mag Gam
all, thank you very much!!! Now my question is, how do I simulate a argv? My program has take an argv, like "foo.py File" is necessary. How and where do I put it in my test? I suppose in the setUp(), but I am not sure how. any thoughts or ideas? TIA On Sun, Aug 16, 2009 at 9:25 AM, Mag Gam wrot

Re: Need cleanup advice for multiline string

2009-08-17 Thread Carl Banks
On Aug 17, 5:40 pm, Mensanator wrote: > On Aug 17, 4:06 pm, Carl Banks wrote: > > > On Aug 17, 10:03 am, Jean-Michel Pichavant > > wrote: > > > > I'm no English native, but I already heard women/men referring to a > > > group as "guys", no matter that group gender configuration. It's even > > >

Re: Need cleanup advice for multiline string

2009-08-17 Thread Mensanator
On Aug 17, 4:06 pm, Carl Banks wrote: > On Aug 17, 10:03 am, Jean-Michel Pichavant > wrote: > > > I'm no English native, but I already heard women/men referring to a > > group as "guys", no matter that group gender configuration. It's even > > used for group composed exclusively of women. Moreove

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Ben Finney
Gilles Ganault writes: > I need to convert DD MM dates into the MySQL-friendly > -MM-DD This is not specific to MySQL. It is the common international standard date representation format defined by ISO 8601. > and translate the month name from literal French to its numeric > equiv

Re: GUI interface builder for python

2009-08-17 Thread Che M
On Aug 17, 2:26 pm, axl456 wrote: > On Aug 17, 1:59 am, "l...@d@n" wrote: > > > Which is the best GUI interface builder with drag and drop > > capabilities. > > I am using Ubuntu GNU/Linux. > > Please help me. > > Thank you. > > boa is really nice.. Boa (Boa Constructor) is really nice for wxPyt

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Rami Chowdhury
Correct me if I'm wrong, but doesn't http://docs.python.org/library/datetime.html#datetime.datetime.strptime do this? import locale locale.setlocale(locale.LC_ALL, 'FR') 'French_France.1252' date_str = '05 Mai 2009 - 18h25' fmt = '%d %B %Y - %Hh%M' date_obj = datetime.strptime(date_str,

Re: Strongly typed list

2009-08-17 Thread Jonathan Gardner
On Aug 17, 2:19 pm, هاني الموصلي wrote: > Please could you lead me to a way or a good IDE that makes developing > huge projects in python more easier than what i found.Now i am using > eclips. Actually it is very hard to remember all my classes methods > and attributes or copy and paste them each

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Jonathan Gardner
On Aug 17, 3:26 pm, Gilles Ganault wrote: >         I need to convert DD MM dates into the MySQL-friendly > -MM-DD, and translate the month name from literal French to its > numeric equivalent (eg. "Janvier" into "01"). > > Here's an example: > > SELECT dateinscription, dateconnexion FROM

Re: Need cleanup advice for multiline string

2009-08-17 Thread John Machin
On Aug 12, 6:52 am, Robert Dailey wrote: > On Aug 11, 3:40 pm, Bearophile wrote: > > > Robert Dailey: > > > > This breaks the flow of scope. Would you guys solve this > > > problem by moving failMsg into global scope? > > > Perhaps through some other type of syntax? > > > There are gals too here.

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Che M
On Aug 17, 6:26 pm, Gilles Ganault wrote: > Hello, > >         I need to convert DD MM dates into the MySQL-friendly > -MM-DD, and translate the month name from literal French to its > numeric equivalent (eg. "Janvier" into "01"). > > Here's an example: > > SELECT dateinscription, datecon

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Jonathan Gardner
On Aug 17, 3:26 pm, Gilles Ganault wrote: > Hello, > >         I need to convert DD MM dates into the MySQL-friendly > -MM-DD, and translate the month name from literal French to its > numeric equivalent (eg. "Janvier" into "01"). > > Here's an example: > > SELECT dateinscription, datecon

Re: A Exhibition Of Tech Geekers Incompetence: Emacs whitespace-mode

2009-08-17 Thread Jason Earl
Xah Lee writes: > Fresh out of the oven: > > • How to use and setup Emacs's whitespace-mode > http://xahlee.org/emacs/whitespace-mode.html > > Xah > ∑ http://xahlee.org/ Xah, I disagree with you about the usefulness of whitespace-mode's defaults, and I certainly disagree with the need to us

Re: Need cleanup advice for multiline string

2009-08-17 Thread Ben Finney
Robert Dailey writes: > On Aug 11, 3:40 pm, Bearophile wrote: > > Robert Dailey: > > > This breaks the flow of scope. Would you guys solve this > > > problem by […] > > There are gals too here. > > It's a figure of speech. Indeed. When I use the term “guys” as a form of address, it's intended

Re: Splitting a string into substrings of equal size

2009-08-17 Thread Gregor Lingl
Simon Forman schrieb: On Aug 14, 8:22 pm, candide wrote: Suppose you need to split a string into substrings of a given size (except possibly the last substring). I make the hypothesis the first slice is at the end of the string. A typical example is provided by formatting a decimal string with

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Raymond Hettinger
[Xah Lee] > This part i don't particular agree: > > > * The reason for implementing the key= parameter had nothing to do > > with limitations of Python's compiler.  Instead, it was inspired by > > the > > decorate-sort-undecorate pattern. > > The decorate-sort-undecorate pattern is a compiler limi

Converting DD MM YYYY into YYYY-MM-DD?

2009-08-17 Thread Gilles Ganault
Hello, I need to convert DD MM dates into the MySQL-friendly -MM-DD, and translate the month name from literal French to its numeric equivalent (eg. "Janvier" into "01"). Here's an example: SELECT dateinscription, dateconnexion FROM membres LIMIT 1; 26 Mai 2007|17 Août 2009 - 09

Re: Embedding a python console inside a python application

2009-08-17 Thread Zorigaman
On 17 août, 20:46, Zorigaman wrote: > Hi, > > I am starting an application in which I would like to have some > scripting functionality. It will obviously be done in Python. The > thing is that I would like my scripts to have access to the rest of > the application as an object it could manipulate

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Nathan Keel
Jon Harrop wrote: > Xah Lee wrote: >> On Aug 12, 12:15 pm, Raymond Hettinger wrote: >>> * The reason for implementing the key= parameter had nothing to do >>> with limitations of Python's compiler. Instead, it was inspired by >>> the >>> decorate-sort-undecorate pattern. >> >> The decorate-sort

Re: Need cleanup advice for multiline string

2009-08-17 Thread MRAB
Carl Banks wrote: On Aug 17, 10:03 am, Jean-Michel Pichavant wrote: I'm no English native, but I already heard women/men referring to a group as "guys", no matter that group gender configuration. It's even used for group composed exclusively of women. Moreover it looks like a *very* friendly fo

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Chris Rebert
On Mon, Aug 17, 2009 at 2:12 PM, Carl Banks wrote: > On Aug 17, 8:44 am, a...@pythoncraft.com (Aahz) wrote: >> In article >> <461cc6f1-fc23-4bc7-a719-6f29babf8...@o15g2000yqm.googlegroups.com>, >> Robert Dailey   wrote: >> >It's a figure of speech. And besides, why would I want programming >> >adv

Re: python doc available in emacs info format?

2009-08-17 Thread Xah Lee
> Please do not slag off a project if you want people to help; > it tends to put the goat up. a healthy community needs both positive comment as well as negative to grow. emacs's user base has been rotting off from i estimate more than 50% of programers to less that 1% today. the particular obse

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Carl Banks
On Aug 17, 8:44 am, a...@pythoncraft.com (Aahz) wrote: > In article > <461cc6f1-fc23-4bc7-a719-6f29babf8...@o15g2000yqm.googlegroups.com>, > Robert Dailey   wrote: > > > > >It's a figure of speech. And besides, why would I want programming > >advice from a woman? lol. Thanks for the help. > > Well

Re: Strongly typed list

2009-08-17 Thread Fabio Zadrozny
> Hello, I am using eclips for python and i am facing a problem. I have > many classes with many properties and want a list of objects from one > of my declared classes. The problem is:When i am accessing any item > from the list, the IDE does not know it's type because in python we do > not declar

Re: Need cleanup advice for multiline string

2009-08-17 Thread Carl Banks
On Aug 17, 10:03 am, Jean-Michel Pichavant wrote: > I'm no English native, but I already heard women/men referring to a > group as "guys", no matter that group gender configuration. It's even > used for group composed exclusively of women. Moreover it looks like a > *very* friendly form, so there

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Paul Rubin
Jon Harrop writes: > You mean people use that pattern as a fast alternative in languages where > user-defined functions are very slow, like Python and Mathematica? It really doesn't matter whether the language is fast or slow--there are going to be applications where calling the comparison functi

Re: Barcodes

2009-08-17 Thread Tim Chase
My company needs a small inventory management app. Does python have any libraries to help with reading and writing bar codes? I've written bar code apps and python really doesn't enter into that part of things. Printers generally have bar code printing capabilities so you just send the right es

Strongly typed list

2009-08-17 Thread هاني الموصلي
Hello, I am using eclips for python and i am facing a problem. I have many classes with many properties and want a list of objects from one of my declared classes. The problem is:When i am accessing any item from the list, the IDE does not know it's type because in python we do not declare the vari

Re: Barcodes

2009-08-17 Thread Emile van Sebille
On 8/17/2009 1:18 PM Ronn Ross said... My company needs a small inventory management app. Does python have any libraries to help with reading and writing bar codes? I've written bar code apps and python really doesn't enter into that part of things. Printers generally have bar code printing c

Re: Data visualization in Python

2009-08-17 Thread jordilin
On 17 ago, 21:10, kj wrote: > I'm looking for a good Python package for visualizing > scientific/statistical data.  (FWIW, the OS I'm interested in is > Mac OS X). > > The users of this package will be experimental biologists with > little programming experience (but currently learning Python). >

Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 1:44 pm, John Yeung wrote: > Thanks, Aaron, for confirming that it's not just me! yea, unfortunately this kind of thing happens in monopolies that have no viable competition anymore... Sometimes I begin to suspect that I'm seeing the results that I should want rather than the results I

Barcodes

2009-08-17 Thread Ronn Ross
My company needs a small inventory management app. Does python have any libraries to help with reading and writing bar codes? -- http://mail.python.org/mailman/listinfo/python-list

Re: zip codes

2009-08-17 Thread Piet van Oostrum
> Grant Edwards (GE) wrote: >GE> On 2009-08-16, Shailen wrote: >>> Thanks Martin and Aahz. Anyone know if zip code information is >>> copyrighted for the US? >GE> You can't copyright "information" as such. Only concrete >GE> expressions of information. A particular publication >GE> contai

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread Carl Banks
On Aug 17, 12:59 pm, Carl Banks wrote: > The cost doesn't even remotely justify it. I mean, it doesn't even remotely justify the cost. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread Carl Banks
On Aug 17, 12:41 pm, exar...@twistedmatrix.com wrote: > There's a lot of things in Python that I don't strictly *need*.  That > doesn't mean that they wouldn't be welcome if I could have them. > Getting rid of the range/xrange dichotomy would improve things.  Yes, I > can work around it until the r

comparing XML files to eachother

2009-08-17 Thread David Brochu
I need to compare one xml document to another to see if the content matches. Unfortunately, the formatting (spacing) and order of elements may change between files from run to run. I have looked into xml dom minidom but can't seem to find how to accomplish this. Does anyone know how I can do a comp

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread exarkun
On 06:32 pm, pavlovevide...@gmail.com wrote: On Aug 17, 4:40�am, exar...@twistedmatrix.com wrote: On 02:12 am, pavlovevide...@gmail.com wrote: >On Aug 16, 3:35�pm, sturlamolden wrote: >>On 16 Aug, 14:57, Dennis Lee Bieber wrote: >> > � � � � Well, the alternative would be to ha

Re: Data visualization in Python

2009-08-17 Thread Grant Edwards
On 2009-08-17, Grant Edwards wrote: > On 2009-08-17, kj wrote: > >> I'm looking for a good Python package for visualizing >> scientific/statistical data. (FWIW, the OS I'm interested in >> is Mac OS X). > > Both matplotlib and gnuplot-py can produce pretty good results > with a minimum of effort

Re: Data visualization in Python

2009-08-17 Thread Grant Edwards
On 2009-08-17, kj wrote: > I'm looking for a good Python package for visualizing > scientific/statistical data. (FWIW, the OS I'm interested in > is Mac OS X). Both matplotlib and gnuplot-py can produce pretty good results with a minimum of effort: http://matplotlib.sourceforge.net/ http:/

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Paul Boddie
On 17 Aug, 19:23, Jean-Michel Pichavant wrote: > > Are you suggesting this list reject part of the community regarding its > sexual orientation, ethnicity, size, culture? If that was the case I'd > like to know about it. Careful: you probably meant to write "rejects", not "reject". That changes t

Re: python doc available in emacs info format?

2009-08-17 Thread Bruce Stephens
"Colin S. Miller" writes: [...] > Ubuntu maintains a package search site, it is on > http://packages.ubuntu.com/ > > However, there seems to be no files named > python.*info (regexp) And yet there are info files in python2.5-doc: .

Data visualization in Python

2009-08-17 Thread kj
I'm looking for a good Python package for visualizing scientific/statistical data. (FWIW, the OS I'm interested in is Mac OS X). The users of this package will be experimental biologists with little programming experience (but currently learning Python). (I normally visualize data using R or

Re: XPath support?

2009-08-17 Thread kj
In Kev Dwyer writes: >On Sun, 16 Aug 2009 20:29:15 +, kj wrote: >> I'm looking for a XML parser that produces an object with full XPath >> support. What I've been using up to now, xml.etree.ElementTree, fails >> to support Xpath predicates, as in "sp...@eggs='3']/ham". >> >> What I'm try

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread J�rgen Exner
Jon Harrop wrote: >Xah Lee wrote: [...] Please do not feed this well-known troll. He is known to spew some remotely on-topic junk into a bunch of unrelated NGs and to enjoy the ensuing confusion. jue -- http://mail.python.org/mailman/listinfo/python-list

Embedding a python console inside a python application

2009-08-17 Thread Zorigaman
Hi, I am starting an application in which I would like to have some scripting functionality. It will obviously be done in Python. The thing is that I would like my scripts to have access to the rest of the application as an object it could manipulate. I made some research and I found the code modu

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread Carl Banks
On Aug 17, 4:40 am, exar...@twistedmatrix.com wrote: > On 02:12 am, pavlovevide...@gmail.com wrote: > > > > >On Aug 16, 3:35 pm, sturlamolden wrote: > >>On 16 Aug, 14:57, Dennis Lee Bieber wrote: > > >> >         Well, the alternative would be to have two keywords for > >>looping: one > >> > for

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-17 Thread Jon Harrop
Xah Lee wrote: > On Aug 12, 12:15 pm, Raymond Hettinger wrote: >> * The reason for implementing the key= parameter had nothing to do >> with limitations of Python's compiler. Instead, it was inspired by >> the >> decorate-sort-undecorate pattern. > > The decorate-sort-undecorate pattern is a com

Re: GUI interface builder for python

2009-08-17 Thread axl456
On Aug 17, 1:59 am, "l...@d@n" wrote: > Which is the best GUI interface builder with drag and drop > capabilities. > I am using Ubuntu GNU/Linux. > Please help me. > Thank you. boa is really nice.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Uninstalling mac python2.5 to install python2.6

2009-08-17 Thread Ned Deily
In article <83423f73-83da-436b-a3ba-e83cd61cd...@cs.stir.ac.uk>, Farhan Sheikh wrote: > i originally had python2.5 on my mac at the univeristy and had to get > 2.6 to get NEST and pyNN to work together. however now as those are > now installed, i had to install numpy. > > As i installed nump

Re: Using a Callback Function - ftplib

2009-08-17 Thread seldan24
On Aug 17, 1:51 pm, David <71da...@libero.it> wrote: > Il Mon, 17 Aug 2009 10:43:33 -0700 (PDT), seldan24 ha scritto: > > > Hello, > > > I'm utterly confused by something which is most likely trivial.  I'm > > attempting to connect to an FTP server, retrieve a list of files, and > > store than in a

Re: Using a Callback Function - ftplib

2009-08-17 Thread David
Il Mon, 17 Aug 2009 10:43:33 -0700 (PDT), seldan24 ha scritto: > Hello, > > I'm utterly confused by something which is most likely trivial. I'm > attempting to connect to an FTP server, retrieve a list of files, and > store than in an array. I.e.: > > import ftplib > > ftp = ftplib.FTP(server

Re: off topic: google groups sucks?

2009-08-17 Thread John Yeung
On Aug 17, 12:41 pm, Aaron Watters wrote: > I'm having better luck now using the advanced search option > with queries like > >    gadfly group:comp.lang.python > > The "search this group" feature still needs fixing, however. Thanks, Aaron, for confirming that it's not just me! I've been noticin

Using a Callback Function - ftplib

2009-08-17 Thread seldan24
Hello, I'm utterly confused by something which is most likely trivial. I'm attempting to connect to an FTP server, retrieve a list of files, and store than in an array. I.e.: import ftplib ftp = ftplib.FTP(server) ftp.login(user, pass) ftp.cwd(conf['testdir']) ftp.retrlines('NLST ' + "testfile

Re: flatten a list of list

2009-08-17 Thread Tim Cook
On Aug 16, 6:47 am, Terry wrote: > Hi, > > Is there a simple way (the pythonic way) to flatten a list of list? > rather than my current solution: > > new_list=[] > for l in list_of_list: >     new_list.extend(l) > > or, > > new_list=reduce(lambda x,y:x.extend(y), list_of_list) > > br, Terry Well,

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Rami Chowdhury
You'll know that Python is sexist the day you'll find the title 'No women allowed' on the python main document page. Good God I hope you're being ironic. On Mon, 17 Aug 2009 10:23:39 -0700, Jean-Michel Pichavant wrote: Aahz wrote: In article <461cc6f1-fc23-4bc7-a719-6f29babf8...@o15g20

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Jean-Michel Pichavant
Aahz wrote: In article <461cc6f1-fc23-4bc7-a719-6f29babf8...@o15g2000yqm.googlegroups.com>, Robert Dailey wrote: It's a figure of speech. And besides, why would I want programming advice from a woman? lol. Thanks for the help. Well, I'm sorry to see this, it means I was wrong about t

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread Ethan Furman
Emmanuel Surleau wrote: Dr. Phillip M. Feldman wrote: [snip] def is_prime(n): for j in range(2,n): if (n % j) == 0: return False return True It seems as though Python is actually expanding range(2,n) into a list of numbers, even though this is incredibly wasteful of memory. There

Re: Need cleanup advice for multiline string

2009-08-17 Thread Piet van Oostrum
> Simon Brunning (SB) wrote: >SB> 2009/8/11 Robert Dailey : >>> On Aug 11, 3:40 pm, Bearophile wrote: There are gals too here. >>> >>> It's a figure of speech. And besides, why would I want programming >>> advice from a woman? lol. Thanks for the help. >SB> Give the attitudes still pr

Re: Need cleanup advice for multiline string

2009-08-17 Thread Jean-Michel Pichavant
Grant Edwards wrote: On 2009-08-11, Bearophile wrote: Robert Dailey: This breaks the flow of scope. Would you guys solve this problem by moving failMsg into global scope? Perhaps through some other type of syntax? There are gals too here. Straying a bit OT, but I find t

Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 10:05 am, Aaron Watters wrote: > Just a note.  It seems that google groups is increasing the > sucks coefficient. I'm having better luck now using the advanced search option with queries like gadfly group:comp.lang.python which become http://groups.google.com/groups/search?q=g

Re: Need cleanup advice for multiline string

2009-08-17 Thread Grant Edwards
On 2009-08-11, Bearophile wrote: > Robert Dailey: > >> This breaks the flow of scope. Would you guys solve this >> problem by moving failMsg into global scope? Perhaps through >> some other type of syntax? > > There are gals too here. Straying a bit OT, but I find this particular issue rather fas

Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-17 Thread Aahz
In article <461cc6f1-fc23-4bc7-a719-6f29babf8...@o15g2000yqm.googlegroups.com>, Robert Dailey wrote: > >It's a figure of speech. And besides, why would I want programming >advice from a woman? lol. Thanks for the help. Well, I'm sorry to see this, it means I was wrong about the lack of sexism in

Re: zip codes

2009-08-17 Thread Nigel Rantor
MRAB wrote: Sjoerd Mullender wrote: Martin P. Hellwig wrote: Shailen wrote: Is there any Python module that helps with US and foreign zip-code lookups? I'm thinking of something that provides basic mappings of zip to cities, city to zips, etc. Since this kind of information is so often used fo

Re: XML parsing with python

2009-08-17 Thread John Posner
Use the iterparse() function of the xml.etree.ElementTree package. http://effbot.org/zone/element-iterparse.htm http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk Stefan iterparse() is too big a hammer for this purpose, IMO. How about this: from xml.etree.ElementTree import E

Re: off topic: google groups sucks?

2009-08-17 Thread Stefan Behnel
jkn wrote: > On Aug 17, 3:05 pm, Aaron Watters wrote: >> Just a note. It seems that google groups is increasing the >> sucks coefficient. >> >> I search for things using "group search" for comp.lang.python >> and I get no results even though I know there are results from >> a few months or weeks

Re: httplib incredibly slow :-(

2009-08-17 Thread Chris Withers
i3dmaster wrote: Just wanted to check if you can try turning on the debug mode for httplib and see if you can read a bit more debug info on where the calls get hung. In your example, it would be conn.set_debuglevel(1) I had a look through the code this debug level controls and I don't see any

Re: off topic: google groups sucks?

2009-08-17 Thread jkn
On Aug 17, 3:05 pm, Aaron Watters wrote: > Just a note.  It seems that google groups is increasing the > sucks coefficient. > > I search for things using "group search" for comp.lang.python > and I get no results even though I know there are results from > a few months or weeks ago. There seems t

off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
Just a note. It seems that google groups is increasing the sucks coefficient. I search for things using "group search" for comp.lang.python and I get no results even though I know there are results from a few months or weeks ago. What is the best alternative for this kind of trawling? gmane? W

Re: Python 'for' loop is memory inefficient

2009-08-17 Thread David Robinow
On Sun, Aug 16, 2009 at 11:10 PM, Nobody wrote: > Java also has iterators; it's more a case of people coming from C and BASIC. > > Although, some of those may have come *through* Java without abandoning > old habits. You see the same thing with people coming from BASIC to C and > writing: > >      

Re: ignored test cases in unittest

2009-08-17 Thread Terry Yin
On Aug 17, 8:23 pm, David House wrote: > > Note that the unittest module now supports the `skip' and > `expectedFailure' decorators, which seem to describe some of the > solutions here. > > Seehttp:// docs.python.org/3.1/library/unittest.html#skipping-tests-and-e... > > -- > -David Yes, indeed! I'

  1   2   >