Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Aahz wrote: In article , Tom Reed wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission considering the batteries included philosophy, particularly balanced bina

Re: No trees in the stdlib?

2009-06-26 Thread Jason Scheirer
On Jun 25, 10:32 pm, a...@pythoncraft.com (Aahz) wrote: > In article , > Tom Reed   wrote: > > > > >Why no trees in the standard library, if not as a built in? I searched > >the archive but couldn't find a relevant discussion. Seems like a > >glaring omission considering the batteries included phil

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Ulrich Eckhardt
Robert Kern wrote: > I wish people would stop representing decimal floating point arithmetic as > "more accurate" than binary floating point arithmetic. Those that failed, learned. You only see those that haven't learnt yet. Dialog between two teachers: T1: Oh those pupils, I told them hundred ti

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Jason Scheirer wrote: On Jun 25, 10:32 pm, a...@pythoncraft.com (Aahz) wrote: In article , Tom Reed wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission considering the batte

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Stefan Behnel wrote: João Valverde wrote: Besides some interface glitches, like returning None on delete if I recall correctly. That's actually not /that/ uncommon. Operations that change an object are not (side-effect free) functions, so it's just purity if they do not have a return v

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Stefan Behnel wrote: João Valverde wrote: Besides some interface glitches, like returning None on delete if I recall correctly. That's actually not /that/ uncommon. Operations that change an object are not (side-effect free) functions, so it's just purity if they

naming packages for pypi

2009-06-26 Thread Aljosa Mohorovic
is it possible to have 2 packages with same name registered at pypi? are packages unique per name or also per category or something else? if package is unique per name how do you name you packages? do you name them something like -myapp, -myapp, -myapp, ... if this is current situation is this so

Re: No trees in the stdlib?

2009-06-26 Thread Chris Rebert
On Fri, Jun 26, 2009 at 12:09 AM, João Valverde wrote: > João Valverde wrote: >> >> Aahz wrote: >>> >>> In article , >>> Tom Reed   wrote: >>> Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glar

validating HTTPS certificates?

2009-06-26 Thread Andras.Horvath
Hi, (disclaimer: this might be a FAQ entry somewhere but I honestly did use Google) I'm in the process of picking a language for a client application that accesses a HTTPS (actually SOAP) server. This would be easy enough in Python, but I came across a strange fact: neither httplib nor urllib of

Re: fileinput.input, readlines and ...

2009-06-26 Thread Kushal Kumaran
On Thu, Jun 25, 2009 at 10:32 AM, Private Private wrote: > On Jun 24, 12:23 pm, Przemyslaw Bak wrote: >> Hello, >> >> I many files with log data. The structure of the file is quite > > Each requested value is in separated file. > While traversing using os.path.walk I have noticed that I get files

Re: naming packages for pypi

2009-06-26 Thread Chris Rebert
On Fri, Jun 26, 2009 at 12:54 AM, Aljosa Mohorovic wrote: > is it possible to have 2 packages with same name registered at pypi? > are packages unique per name or also per category or something else? > > if package is unique per name how do you name you packages? > do you name them something like -

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: João Valverde wrote: Aahz wrote: In article , Tom Reed wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission considering the batteries included philosophy, part

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Carl Banks
On Jun 25, 11:20 pm, Stefan Behnel wrote: > Carl Banks wrote: > > On Jun 25, 10:11 pm, Stefan Behnel wrote: > >> Carl Banks wrote: > Why isn't et.parse the only way to do this? Why have XML or fromstring   > at all? > >>> Because Fredrick Lundh wanted it that way.  Unlike most Python > >

Re: Best way to enumerate classes in a module

2009-06-26 Thread Steven D'Aprano
On Thu, 25 Jun 2009 11:30:03 -0500, Nick Craig-Wood wrote: >> Something makes me think that module.__dict__ was only added to Python >> fairly recently, but I'm not sure. > > It exists in python2.1 - I don't have an older python to check at the > moment. $ python1.5 Python 1.5.2 (#1, Apr 1 20

Re: naming packages for pypi

2009-06-26 Thread Carl Banks
On Jun 26, 12:54 am, Aljosa Mohorovic wrote: > is it possible to have 2 packages with same name registered at pypi? > are packages unique per name or also per category or something else? > > if package is unique per name how do you name you packages? > do you name them something like -myapp, -myap

Re: Best way to enumerate classes in a module

2009-06-26 Thread Michele Simionato
On Jun 24, 7:07 pm, Terry Reedy wrote: > Дамјан Георгиевски wrote: > > I need to programmaticaly enumerate all the classes in a given module. > > Currently I'm using dir(module) but the Notice on the documentation page > > [1]  says "dir() is supplied primarily as a convenience for use at an > > i

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Steven D'Aprano
On Thu, 25 Jun 2009 12:41:13 -0600, Michael Torrie wrote: > If you want accurate math, check out other types like what is in the > decimal module: > import decimal a=decimal.Decimal('3.2') print a * 3 > 9.6 Not so. Decimal suffers from the exact same problem, just with different

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Steven D'Aprano
On Thu, 25 Jun 2009 12:31:05 -0700, Mark Dickinson wrote: >> We all know that IEEE floating point is a horribly inaccurate >> representation [...] > > That's a bit extreme! Care to elaborate? Well, 0.1 requires an infinite number of binary places, and IEEE floats only have a maximum of 53 or s

Re: No trees in the stdlib?

2009-06-26 Thread Steven D'Aprano
On Fri, 26 Jun 2009 00:09:06 -0700, Jason Scheirer wrote: > I once wrote a binary sorted tree data structure for Python in C. It > performed anywhere from 15-40% worse than dicts. I think with > optimization it will only perform 10% worse than dicts at best. > > Oh hey maybe that is why trees are

seeking thru a file

2009-06-26 Thread Mag Gam
I have a compressed CSV gziped file. I was wondering if it is possible to seek thru a file For example: I want to load the first 100 lines into an array. Process the data Seek from 101 line to 200 lines. Process the data (remove lines 0 - 100) from memory Seek 201 to 300 line. Process the data

Re: Reading a large csv file

2009-06-26 Thread Mag Gam
Thankyou everyone for the responses! I took some of your suggestions and my loading sped up by 25% On Wed, Jun 24, 2009 at 3:57 PM, Lie Ryan wrote: > Mag Gam wrote: >> Sorry for the delayed response. I was trying to figure this problem >> out. The OS is Linux, BTW > > Maybe I'm just being pedant

Re: extending method descriptors

2009-06-26 Thread Michael Sliczniak
On Jun 25, 2:30 pm, Carl Banks wrote: Thank you for the very good reply. In fact delegating is the approach that works. The main thing to notice is that for an uninstantiated class the first arg to __get__ is None: class desc(object): __slots__ = ('x') def __init__(self, desc):

Re: No trees in the stdlib?

2009-06-26 Thread Paul Rubin
Stefan Behnel writes: > > Besides some interface glitches, like returning None > > on delete if I recall correctly. > > That's actually not /that/ uncommon. Operations that change an object are > not (side-effect free) functions, so it's just purity if they do not have a > return value. But dele

Re: No trees in the stdlib?

2009-06-26 Thread Paul Rubin
Chris Rebert writes: > > Simple example usage case: Insert string into data structure in > > sorted order if it doesn't exist, else retrieve it. > > That's pretty much the bisect module in a nutshell. It manipulates a > sorted list using binary search. That lets you find an existing entry in log

Re: No trees in the stdlib?

2009-06-26 Thread Stefan Behnel
Paul Rubin wrote: > Stefan Behnel writes: >>> Besides some interface glitches, like returning None >>> on delete if I recall correctly. >> That's actually not /that/ uncommon. Operations that change an object are >> not (side-effect free) functions, so it's just purity if they do not have a >> retu

file transfer in python

2009-06-26 Thread jayesh bhardwaj
i am trying to find something useful in python to transfer html files from one terminal to other. Can this be done with some module or shall i start coding my own module using low level socket interface. If u know about some books on this topic or any online help then plz help. -- http://mail.pyth

Re: It's ...

2009-06-26 Thread Angus Rodgers
On Thu, 25 Jun 2009 18:22:48 +0100, MRAB wrote: >Angus Rodgers wrote: >> On Thu, 25 Jun 2009 10:31:47 -0500, Kirk Strauser >> wrote: >> >>> At 2009-06-24T19:53:49Z, Angus Rodgers writes: >>> print ''.join(map(detab, f.xreadlines())) >>> An equivalent in modern Pythons: >>> >> print

Re: file transfer in python

2009-06-26 Thread Doron Tal
On Fri, Jun 26, 2009 at 2:38 PM, jayesh bhardwaj wrote: > i am trying to find something useful in python to transfer html files > from one terminal to other. Can this be done with some module or shall > i start coding my own module using low level socket interface. If u > know about some books on

Re: file transfer in python

2009-06-26 Thread Francesco Bochicchio
On 26 Giu, 13:38, jayesh bhardwaj wrote: > i am trying to find something useful in python to transfer html files > from one terminal to other. Can this be done with some module or shall > i start coding my own module using low level socket interface. If u > know about some books on this topic or a

Re: Python simple web development

2009-06-26 Thread bijoy franco
Hi, I am learning pylons..It seems to be very simple and flexible.. Just give a try if it seems interesting for you Thanks Bijoy On Fri, Jun 26, 2009 at 3:02 AM, Gabriel Genellina wrote: > En Thu, 25 Jun 2009 04:29:28 -0300, Private Private > escribió: > > I am looking for a python library w

Re: seeking thru a file

2009-06-26 Thread Nils Rüttershoff
Hi Mag, Mag Gam wrote: > I have a compressed CSV gziped file. I was wondering if it is possible > to seek thru a file > > For example: > > I want to load the first 100 lines into an array. Process the data > > Seek from 101 line to 200 lines. Process the data (remove lines 0 - > 100) from memory >

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Sebastian Pająk
2009/6/26 norseman : > Sebastian Pająk wrote: >>> >>> Can, but should not. >>> I read that the problem is when using the Polish language only. Otherwise >>> things work normally. Is that correct? >> >> Yes, correct >> >>> If so then byte swap may be a problem.  Using the u'string' should solve >>>

Re: seeking thru a file

2009-06-26 Thread Bruno Desthuilliers
Mag Gam a écrit : I have a compressed CSV gziped file. Then gunzip it first... I was wondering if it is possible to seek thru a file For example: I want to load the first 100 lines into an array. Process the data Seek from 101 line to 200 lines. Process the data (remove lines 0 - 100) from

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Sebastian Pająk
>  in place where polish >> accented character should be (like "ęłąśł" etc) >> This problem is only on mac os x and it doesn't apply to button widget >> (where characters are correct) > > I see. So it is a font problem: if the square box is displayed, it means > that the font just doesn't have a gl

Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in both flavors of Python: 2.6.2 and 3.0.1 (CPython) The code: #!/usr/bin/env python def remaining_peg (peg1, peg2): return (6 - peg1 - peg2) def hanoi (num_discs, start, end): if (1 == num_discs):

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread pdpi
On Jun 26, 11:01 am, Steven D'Aprano wrote: > On Thu, 25 Jun 2009 12:41:13 -0600, Michael Torrie wrote: > > If you want accurate math, check out other types like what is in the > > decimal module: > > import decimal > a=decimal.Decimal('3.2') > print a * 3 > > 9.6 > > Not so. Decima

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Stefan Behnel
Udyant Wig wrote: > I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > The code: > #!/usr/bin/env python > def remaining_peg (peg1, peg2): > return (6 - peg1 - peg2) > > def hanoi (num_discs, start, end): > if

Re: No trees in the stdlib?

2009-06-26 Thread Hallvard B Furuseth
Stefan Behnel writes: >João Valverde wrote: >> Besides some interface glitches, like returning None >> on delete if I recall correctly. > > That's actually not /that/ uncommon. Operations that change an object are > not (side-effect free) functions, so it's just purity if they do not have a > retur

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
On Jun 26, 7:14 pm, Stefan Behnel wrote: > Udyant Wig wrote: > > I implemented this ->http://www.apl.jhu.edu/~hall/lisp/Hanoi.lispin > > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > > The code: > > #!/usr/bin/env python > > def remaining_peg (peg1, peg2): > >    return (6 - peg1 - peg2) >

Re: No trees in the stdlib?

2009-06-26 Thread Stefan Behnel
Hallvard B Furuseth wrote: > Stefan Behnel writes: >> João Valverde wrote: >>> Besides some interface glitches, like returning None >>> on delete if I recall correctly. >> That's actually not /that/ uncommon. Operations that change an object are >> not (side-effect free) functions, so it's just pur

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Scott David Daniels
pdpi wrote: ... But since 10 = 2 * 5, all numbers that can be finitely represented in binary can be represented finitely in decimal as well, with the exact same number of places for the fractional part (and no more digits than the binary representation in the integer part) OK, so base 30 is th

"The system cannot execute the specified program."

2009-06-26 Thread Tim Slattery
Our office has a copy of Python 3.0 installed on a network share device. When I try to run it I get this message: "The system cannot execute the specified program." When I googled that message, the links that came up had to do with missing DLLs. So I fired up Dependency Walker and found out that t

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Paul Moore
2009/6/26 Udyant Wig : > I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > The code: > #!/usr/bin/env python > def remaining_peg (peg1, peg2): >        return (6 - peg1 - peg2) > > def hanoi (num_discs, start, end): >      

Re: naming packages for pypi

2009-06-26 Thread Aljosa Mohorovic
On Jun 26, 11:15 am, Carl Banks wrote: > Your post seems to suggest some conflating of these concepts so you > need to make it clear what you really mean. my example: when creating website example.com (django project) it contains multiple django apps which i package separately. most of websites h

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Andre Engels
On Fri, Jun 26, 2009 at 5:07 PM, Scott David Daniels wrote: > pdpi wrote: >> >> ... But since 10 = 2 * 5, all numbers that can be finitely represented in >> binary can be represented finitely in decimal as well, with the exact >> same number of  places for the fractional part (and no more digits >>

Re: Recipes for trace statements inside python programs?

2009-06-26 Thread cassiope
On Jun 25, 1:33 am, Francesco Bochicchio wrote: > Hi all, > > as many - I think - python programmers, I find muself debugging my > scripts by placing print statements in strategic places rather than > using the python debugger, and commenting/uncommenting them according > to myy deugging needs.  A

Re: "The system cannot execute the specified program."

2009-06-26 Thread Tim Golden
Tim Slattery wrote: Our office has a copy of Python 3.0 installed on a network share device. When I try to run it I get this message: "The system cannot execute the specified program." To be honest, I'd look at one of the Portable Python installations, specifically designed to be run off a stic

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Sebastian Pająk
Maybe this picture will tell you more: http://files.getdropbox.com/u/1211593/tkinter.png The original script: http://files.getdropbox.com/u/1211593/test1.py May someone can confirm this osx behaviour? 2009/6/26 Sebastian Pająk : > 2009/6/26 norseman : >> Sebastian Pająk wrote: Can, bu

R-tree implemetation in python without external C_libraries

2009-06-26 Thread News123
Hi, I'd like to have a small rtree library for a small python project. ( good data structure for 2D searches ) For this mini - project I'd prefer, to have no C-library dependencies Does anyone have a small implementation which I'm allowed to use and modify, which does not use an external C-libra

opening a https web page

2009-06-26 Thread Addy
Dear sir, i am not being able to open "https://"; web pages using urllib2 or urllib. I am being able to open "http" pages though. i am connecting the internet through a proxy server. I am being able to open "https://"; pages if i am using an ineternet connection that does not connect thro

handling https sites

2009-06-26 Thread padfoot
Sir, Is there any module in python to open https sites through a proxy.I am connectyed to the net via a proxy server and i am unable to crawl https sites. -- http://mail.python.org/mailman/listinfo/python-list

MultiValueDict?

2009-06-26 Thread BarakatX2
, , ]}> for f in files['rqFiles']: print f.name This gives me an "'str' object has no attribute 'name'" error. I don't know if there is a special way to access MultiValueDicts values, but I assumed each key has a list that is accessed just like any other list. Any help is appreciated.

Re: handling https sites

2009-06-26 Thread Shawn Milochik
On Jun 26, 2009, at 12:08 PM, padfoot wrote: Sir, Is there any module in python to open https sites through a proxy.I am connectyed to the net via a proxy server and i am unable to crawl https sites. -- http://mail.python.org/mailman/listinfo/python-list Check out the "Scrape the Web" ser

Re: handling https sites

2009-06-26 Thread cgoldberg
> Is there any module in python to open https > sites through a proxy. yes, you can use "urllib2". from the urllib2 docs: "The default is to read the list of proxies from the environment variables" So if you have a proxy setup, it should detect it from your environment vars. If you want to spec

Re: "The system cannot execute the specified program."

2009-06-26 Thread Tim Slattery
Tim Slattery wrote: >Our office has a copy of Python 3.0 installed on a network share >device. When I try to run it I get this message: "The system cannot >execute the specified program." I should add that before I knew about our shared installation, I downloaded the AS distribution of Python 2.

Re: "The system cannot execute the specified program."

2009-06-26 Thread Duncan Booth
Tim Slattery wrote: > Our office has a copy of Python 3.0 installed on a network share > device. When I try to run it I get this message: "The system cannot > execute the specified program." > > When I googled that message, the links that came up had to do with > missing DLLs. So I fired up Depe

Re: validating HTTPS certificates?

2009-06-26 Thread Nobody
On Fri, 26 Jun 2009 10:04:21 +0200, Andras.Horvath wrote: > (disclaimer: this might be a FAQ entry somewhere but I honestly did use > Google) > > I'm in the process of picking a language for a client application that > accesses a HTTPS (actually SOAP) server. This would be easy enough in > Pytho

Re: No trees in the stdlib?

2009-06-26 Thread Paul Rubin
Stefan Behnel writes: > > But deletes in an AVL tree should not cause mutation. They should > > just allocate a new root and path up to where the deleted node was. > I doubt that there are many AVL implementations that do that. Plus, if > deletion doesn't delete, I'd happily consider that a bug.

Re: No trees in the stdlib?

2009-06-26 Thread Aahz
In article <006078f0$0$9721$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > >Hash tables (dicts) are useful for many of the same things that trees are >useful for, but they are different data structures with different >strengths and weaknesses, and different uses. To argue that we don't ne

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
On Jun 26, 8:01 pm, Paul Moore wrote: > 2009/6/26 Udyant Wig : > > > > > > > I implemented this ->http://www.apl.jhu.edu/~hall/lisp/Hanoi.lispin > > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > > The code: > > #!/usr/bin/env python > > def remaining_peg (peg1, peg2): > >        return (6

Re: No trees in the stdlib?

2009-06-26 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: > (In particular, WRT the bisect module, although insertion and deletion > are O(N), the constant factor for doing a simple memory move at C speed > swamps bytecode until N gets very large -- and we already have > collections.deque() for some other common use cas

Re: No trees in the stdlib?

2009-06-26 Thread Daniel Stutzbach
On Fri, Jun 26, 2009 at 1:54 AM, Miles Kaufmann wrote: > On Jun 26, 2009, at 2:23 AM, Chris Rebert wrote: > >> That's pretty much the bisect module in a nutshell. It manipulates a >> sorted list using binary search. >> > > With O(n) insertions and removals, though. A decent self-balancing binary

Re: "The system cannot execute the specified program."

2009-06-26 Thread Trent Mick
Tim Slattery wrote: Tim Slattery wrote: Our office has a copy of Python 3.0 installed on a network share device. When I try to run it I get this message: "The system cannot execute the specified program." I should add that before I knew about our shared installation, I downloaded the AS dist

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Aahz wrote: In article <006078f0$0$9721$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: Hash tables (dicts) are useful for many of the same things that trees are useful for, but they are different data structures with different strengths and weaknesses, and different uses. To argue that

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread norseman
Scott David Daniels wrote: norseman wrote: ... A note here: In reading the original posting I get symbols that are not familiar to me as alphabet. From the line in your original: Label(root, text='ęóąśłżźćń').pack() I see text=' then an e with a goatee a capi

Re: os.system vs subprocess

2009-06-26 Thread Nate
I ended up going with this: http://code.activestate.com/recipes/440554/ seems to feed me new lines of output atleast before the subprocess finishes, with some adjustment of the time delays. I'll guess I'll just be packing winpy into the installer. Or something. -- http://mail.python.org/mailma

Re: No trees in the stdlib?

2009-06-26 Thread Stefan Behnel
João Valverde wrote: > What's lacking is an associative array that preserves ordering, doesn't > require a hash function and has fast insertions and deletions in > O(log(n)). > [...] > I'm genuinely surprised to know > there are no data structures that efficiently support such a common need > in Py

Re: No trees in the stdlib?

2009-06-26 Thread Aahz
In article , =?ISO-8859-1?Q?Jo=E3o_Valverde?= wrote: > >What's lacking is an associative array that preserves ordering, doesn't >require a hash function and has fast insertions and deletions in >O(log(n)). The particular algorithm to achieve this is a secondary >issue. It's a BST for sure, AVL

alternative to JoinableQueue's please

2009-06-26 Thread Filipe Fernandes
I'm currently using the multiprocessing package and I'm hugely impressed at its simplicity (thanks very much Jesse Noller). Although, it seems that there's a bug in JoinableQueue's which renders using it pointless over a regular Queue as per Issue 4660 http://bugs.python.org/issue4660 To re-iter

Re: No trees in the stdlib?

2009-06-26 Thread Carl Banks
On Jun 26, 7:35 am, Hallvard B Furuseth wrote: > Stefan Behnel writes: > >João Valverde wrote: > >> Besides some interface glitches, like returning None > >> on delete if I recall correctly. > > > That's actually not /that/ uncommon. Operations that change an object are > > not (side-effect free)

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Robert Kern
On 2009-06-26 02:17, Ulrich Eckhardt wrote: Robert Kern wrote: I wish people would stop representing decimal floating point arithmetic as "more accurate" than binary floating point arithmetic. Those that failed, learned. You only see those that haven't learnt yet. Dialog between two teachers:

change the first character of the line to uppercase in a text file

2009-06-26 Thread powah
How to change the first character of the line to uppercase in a text file? e.g. input is: abc xyz Bd ef gH ij output should be: Abc xyz Bd ef GH ij -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Kee Nethery
First, thanks to everyone who responded. Figured I'd test all the suggestions and provide a response to the list. Here goes ... On Jun 25, 2009, at 7:38 PM, Nobody wrote: Why do you need an ElementTree rather than an Element? XML(string) returns the root element, as if you had used et.parse(

Re: "The system cannot execute the specified program."

2009-06-26 Thread Tim Slattery
Trent Mick wrote: >Tim Slattery wrote: >> Tim Slattery wrote: >> >>> Our office has a copy of Python 3.0 installed on a network share >>> device. When I try to run it I get this message: "The system cannot >>> execute the specified program." >> >> I should add that before I knew about our shar

Re: "The system cannot execute the specified program."

2009-06-26 Thread Tim Slattery
Duncan Booth wrote: >Tim Slattery wrote: > >> Our office has a copy of Python 3.0 installed on a network share >> device. When I try to run it I get this message: "The system cannot >> execute the specified program." >> >> When I googled that message, the links that came up had to do with >> mi

Re: "The system cannot execute the specified program."

2009-06-26 Thread Trent Mick
Tim Slattery wrote: That's what it is. They give you a choice of MSI or AS. The AS choice is a zip file that you unzip, then run the bat file on the top level. There's no indication that it's "not intended for wide use". Granted not much, other than it isn't listed in the main download tables:

Re: change the first character of the line to uppercase in a text file

2009-06-26 Thread Emile van Sebille
On 6/26/2009 12:43 PM powah said... How to change the first character of the line to uppercase in a text file? e.g. input is: abc xyz Bd ef gH ij output should be: Abc xyz Bd ef GH ij How far have you gotten? Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: "The system cannot execute the specified program."

2009-06-26 Thread Terry Reedy
Tim Slattery wrote: Tim Slattery wrote: Our office has a copy of Python 3.0 installed on a network share device. When I try to run it I get this message: "The system cannot execute the specified program." Slightly OT, but do try to replace that with 3.1 as soon as you can. Significant improv

Re: change the first character of the line to uppercase in a text file

2009-06-26 Thread Chris Rebert
On Fri, Jun 26, 2009 at 12:43 PM, powah wrote: > How to change the first character of the line to uppercase in a text > file? > e.g. > input is: > abc xyz > Bd ef > gH ij > > output should be: > Abc xyz > Bd ef > GH ij We're not in the business of doing homework. Some hints though: `s.upper()` co

Re: change the first character of the line to uppercase in a text file

2009-06-26 Thread Tim Chase
powah wrote: How to change the first character of the line to uppercase in a text file? e.g. input is: abc xyz Bd ef gH ij output should be: Abc xyz Bd ef GH ij While you're asking the Python list, I'd just use GNU sed: sed -i 's/./\U&/' myfile.txt I don't know if the "\U"=="make the repla

Re: change the first character of the line to uppercase in a text file

2009-06-26 Thread Scott David Daniels
powah wrote: How to change the first character of the line to uppercase in a text file? Here is an English hint on the above: The "How ... file" above is a noun phrase, and is not a sentence, never mind a question. Putting a question mark after the noun phrase does not make that phrase a qu

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Scott David Daniels
norseman wrote: Scott David Daniels wrote: norseman wrote: ... A note here: In reading the original posting I get ... then an e with a goatee Here's something to try in any future circumstances: Good thought, good idea, useful tool. BUT - compare your output to what I *see*.

Re: alternative to JoinableQueue's please

2009-06-26 Thread Raymond Hettinger
[Filipe Fernandes] > The reasons for using JoinableQueue I think are obvious.  I want to > block the main processing using queue.join() until the tasks that have > been placed on the queue have been finished by the worker processes. > > I can't be the only one experiencing this (besides Brian)... a

Re: Python simple web development

2009-06-26 Thread Charles Yeomans
Or you could try my approach and write your own web app. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Python simple web development

2009-06-26 Thread Daniel Fetchinson
>> What I've read about Django, Turbogears is that they are powerful >> enough to create big web-based portals, applications, etc. >> I need just simple forms without any sophisticated functionality. >> So again: why I am wrong ? > > Just because something is powerful doesn't mean you can't do simp

Re: Python simple web development

2009-06-26 Thread Thomas Allen
On Jun 25, 3:29 am, Private Private wrote: > Hi, > > I am looking for a python library which will allow me to do a simple > web development. I need to use > some forms (but nice looking :-) ), creating images based on input > from those forms, etc. I have read a bit about Django and TurboGears > b

Re: Dynamic method invocation

2009-06-26 Thread jythonuser
Sorry for being a little vague. The last part of your response seems like what I would need. So here are more details on what I am trying to do. I have an extensible command shell in java where commmand providers plug in to supply new commands. I have a java class called MyShell which has execC

Re: Dynamic method invocation

2009-06-26 Thread jythonuser
Actually let me add that in jython I don't need to always use MyShell. It may be ok to wrapper it with some Jython class which then delegates to MyShell. So something like shell = MyJythonShell() shell.grep (grep_args) So MyJythonShell is defined in Jython which calls MyShell. Am wondering how

Re: 3.2*2 is 9.6 ... or maybe it isn't?

2009-06-26 Thread Michael Torrie
Robert Kern wrote: > In the former case, you can claim that decimal floating point is more > accurate > *for those problems*. But as soon as you have a division operation, decimal > floating point has the same accuracy problems as binary floating point. True. Poor choice of words on my part.

Re: Python simple web development

2009-06-26 Thread Petr Messner
What about Werkzeug? I like its simplicity (well, basically everything I need are WSGI request/response objects :) + some templating library). Petr 2009/6/25 Private Private : > Hi, > > I am looking for a python library which will allow me to do a simple > web development. I need to use > some f

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Martin v. Löwis
> And I do not see any f3 anywhere except in the doc ref I copy/duped and > in this file. That surely is a bug in your email program - get a better one. Take a look at http://mail.python.org/pipermail/python-list/2009-June/717666.html which displays correctly - maybe you can find a web browser

Re: No trees in the stdlib?

2009-06-26 Thread Raymond Hettinger
[Tom Reed] > Why no trees in the standard library, if not as a built in? The sqlite3 module is built on a binary-tree structure. It can be used with persistent data or kept in-memory. The gdbm module has similar flexibility (see the F mode). FWIW, there are some ASPN implementing various types of

Re: No trees in the stdlib?

2009-06-26 Thread Raymond Hettinger
[João Valverde] > What's lacking is an associative array that preserves ordering, doesn't > require a hash function and has fast insertions and deletions in > O(log(n)). FWIW, Py3.1 has an OrderedDict() that preserves insertion order. It has O(1) lookup, deletion, insertion, and popping; and O(n)

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Piet van Oostrum
> Sebastian Pająk (SP) wrote: >SP> Maybe this picture will tell you more: >SP> http://files.getdropbox.com/u/1211593/tkinter.png >SP> The original script: >SP> http://files.getdropbox.com/u/1211593/test1.py >SP> May someone can confirm this osx behaviour? Yes, I get the same. But it is a p

Re: MultiValueDict?

2009-06-26 Thread John Machin
On Jun 27, 2:09 am, BarakatX2 wrote: > png)>, , > ]}> There is nothing in this schema to suggest that any object has a .name attribute . > >     for f in files['rqFiles']: >         print f.name > > This gives me an "'str' object has no attribute 'name'" error. I don't > know if there is a spec

Re: Tkinter - non-ASCII characters in text widgets problem

2009-06-26 Thread Sebastian Pająk
2009/6/27 Piet van Oostrum : >> Sebastian Pająk (SP) wrote: > >>SP> Maybe this picture will tell you more: >>SP> http://files.getdropbox.com/u/1211593/tkinter.png > >>SP> The original script: >>SP> http://files.getdropbox.com/u/1211593/test1.py > >>SP> May someone can confirm this osx behaviou

Replacing a built-in method of a module object instance

2009-06-26 Thread David Hirschfield
I have a need to replace one of the built-in methods of an arbitrary instance of a module in some python code I'm writing. Specifically, I want to replace the __getattribute__() method of the module I'm handed with my own __getattribute__() method which will do some special work on the attribu

looking for a book on python

2009-06-26 Thread Randy Foiles
Hello and thank you for taking your time to read this. I was interested in learning about python. In the long ago past I did learn some programing but I have not used any of it for years. I do remember some basics however so the book does not have to be for a total beginner. (C, C++, BASIC,

Re: alternative to JoinableQueue's please

2009-06-26 Thread Filipe Fernandes
Raymond Hettinger wrote: > [Filipe Fernandes] >> The reasons for using JoinableQueue I think are obvious. I want to >> block the main processing using queue.join() until the tasks that have >> been placed on the queue have been finished by the worker processes. >> >> I can't be the only one exper

Re: looking for a book on python

2009-06-26 Thread Horace Blegg
Hello, http://diveintopython.org/ - might be a good place to start. There are also a bunch of free programming books (some related to python, some not) to be found here: http://www.e-booksdirectory.com/programming.php#python - How good these books may or may not be is up to you to find out. Also,

  1   2   >