Re: "/a" is not "/a" ?

2009-03-07 Thread Paul Rubin
alex23 writes: > But _you_ only _just_ stated "It does have some (generally small) > performance ramifications as > well" and provided timing examples to show it. Without qualification. The performance difference can be large if the objects are (for example) long lists. -- http://mail.python.org/

Re: "/a" is not "/a" ?

2009-03-07 Thread Albert Hopkins
On Fri, 2009-03-06 at 23:57 -0800, Paul Rubin wrote: > alex23 writes: > > But _you_ only _just_ stated "It does have some (generally small) > > performance ramifications as > > well" and provided timing examples to show it. Without qualification. > > The performance difference can be large if the

Re: "/a" is not "/a" ?

2009-03-07 Thread Albert Hopkins
On Sat, 2009-03-07 at 03:07 -0500, Albert Hopkins wrote: > On Fri, 2009-03-06 at 23:57 -0800, Paul Rubin wrote: > > alex23 writes: > > > But _you_ only _just_ stated "It does have some (generally small) > > > performance ramifications as > > > well" and provided timing examples to show it. Without

Re: "/a" is not "/a" ?

2009-03-07 Thread Steven D'Aprano
Albert Hopkins wrote: > I would think (not having looked) that the implementation of == would > first check for identity (for performance reasons)... For some types, it may. I believe that string equality testing first tests whether the two strings are the same string, then tests if they have the

Re: Help cleaning up some code

2009-03-07 Thread Gerard Flanagan
odeits wrote: I am looking to clean up this code... any help is much appreciated. Note: It works just fine, I just think it could be done cleaner. The result is a stack of dictionaries. the query returns up to STACK_SIZE ads for a user. The check which i think is very ugly is putting another con

Re: Threading and tkinter

2009-03-07 Thread Jani Hakala
gert writes: > After reading the docs and seeing a few examples i think this should > work ? > Am I forgetting something here or am I doing something stupid ? > Anyway I see my yellow screen, that has to count for something :) > I have been using the following scheme: - Pass the root object to

Re: "/a" is not "/a" ?

2009-03-07 Thread Marc 'BlackJack' Rintsch
On Fri, 06 Mar 2009 16:26:46 -0800, Paul Rubin wrote: > Gary Herron writes: >> Experts: Singleton immutable types *may* be compared with "is", > > That is absolutely wrong: > > >>> a = 2^100 > >>> b = 2^100 > >>> a == b > True > >>> a is b > False What should this exa

Re: "/a" is not "/a" ?

2009-03-07 Thread Paul Rubin
Marc 'BlackJack' Rintsch writes: > What should this example show? And where's the singleton here? BTW: I misunderstood at first what you meant by "singleton". Sorry. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way of doing this?

2009-03-07 Thread mattia
Il Sat, 07 Mar 2009 00:05:53 -0200, Gabriel Genellina ha scritto: > En Fri, 06 Mar 2009 21:31:01 -0200, mattia escribió: > >> Thanks, I've found another solution here: >> http://www.obitko.com/tutorials/ >> genetic-algorithms/selection.php >> so here is my implementation: >> >> >> def get_fap(fi

Re: Parsing/Crawler Questions - solution

2009-03-07 Thread Lie Ryan
bruce wrote: john... again the problem i'm facing really has nothing to do with a specific url... the app i have for the usc site works... but for any number of reasons... you might get different results when running the app.. -the server could be screwed up.. -data might be cached -data mi

pass bool values to the Python function in embedded python 3.0

2009-03-07 Thread BigHand
Guys, How do I transfer the parameters ? in python code: traceback.format_exception(exc_type, exc_val, exc_tb, 2, True) in C++ code: obFunc_format_exception = PyObject_GetAttrString(modTB, "format_exception"); tbArgs = Py_BuildValue("OOOii", exc_type, exc_value, exc_tb, 2, 1); tbResultList = PyObj

Re: create boolean

2009-03-07 Thread Lie Ryan
Fencer wrote: Hi, I need a boolean b to be true if the variable n is not None and not an empty list, otherwise b should be false. I ended up with: b = n is not None and not not n which seems to work but is that normally how you would do it? It can be assumed that n is always None or a list that

Re: "/a" is not "/a" ?

2009-03-07 Thread Lie Ryan
Steven D'Aprano wrote: Albert Hopkins wrote: I would think (not having looked) that the implementation of == would first check for identity (for performance reasons)... For some types, it may. I believe that string equality testing first tests whether the two strings are the same string, then

Re: pass bool values to the Python function in embedded python 3.0

2009-03-07 Thread BigHand
On Mar 7, 5:38 pm, BigHand wrote: > Guys, How do I transfer the parameters ? > in python code: > traceback.format_exception(exc_type, exc_val, exc_tb, 2, True) > > in C++ code: > obFunc_format_exception = PyObject_GetAttrString(modTB, > "format_exception"); > tbArgs = Py_BuildValue("OOOii", exc_ty

Re: Indentations and future evolution of languages

2009-03-07 Thread Kay Schluehr
On 6 Mrz., 02:53, bearophileh...@lycos.com wrote: > This is an interesting post, it shows me that fitness plateau where > design of Python syntax lives is really small, you can't design > something just similar: > > http://unlimitednovelty.com/2009/03/indentation-sensitivity-post-mort... > > Living

Re: Parsing/Crawler Questions - solution

2009-03-07 Thread lkcl
On Mar 7, 12:19 am, rounderwe...@gmail.com wrote: > So, it sounds like your update means that it is related to a specific > url. > > I'm curious about this issue myself. I've often wondered how one > could properly crawl anAJAX-ish site when you're not sure how quickly > the data will be returned

ANN: eric 4.3.1 released

2009-03-07 Thread Detlev Offenbach
Hi, I just uploaded eric 4.3.1. It is a maintenance release fixing some bugs. It is available via the eric4 web site. http://eric-ide.python-projects.org/index.html Eric is a Python (and Ruby) IDE that comes with batteries included. Please see the a.m. web site for more details. Regards, Detlev

Re: create boolean

2009-03-07 Thread Paul Rubin
Fencer writes: > Hi, I need a boolean b to be true if the variable n is not None and > not an empty list, otherwise b should be false > It can be assumed that n is always None or a list that might be empty b = bool(n) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way of doing this?

2009-03-07 Thread Lie Ryan
mattia wrote: Il Sat, 07 Mar 2009 00:05:53 -0200, Gabriel Genellina ha scritto: En Fri, 06 Mar 2009 21:31:01 -0200, mattia escribió: Thanks, I've found another solution here: http://www.obitko.com/tutorials/ genetic-algorithms/selection.php so here is my implementation: def get_fap(fitness

Re: Is there a better way of doing this?

2009-03-07 Thread Peter Otten
Lie Ryan wrote: > mattia wrote: >> Yes, sorry, I have to recycle! But how about this: > rw = [[2,4], [4,5,6],[5,5]] > rw += [[1,1]]*2 > rw >> [[2, 4], [4, 5, 6], [5, 5], [1, 1], [1, 1]] >> How can I recicle in this way using append? > > Not .append() but .extend() Whether you use

Re: ANN: eric 4.3.1 released

2009-03-07 Thread BigHand
On Mar 7, 6:59 pm, Detlev Offenbach wrote: > Hi, > > I just uploaded eric 4.3.1. It is a maintenance release fixing some bugs. > It is available via the eric4 web site. > > http://eric-ide.python-projects.org/index.html > > Eric is a Python (and Ruby) IDE that comes with batteries included. > Plea

Re: Help cleaning up some code

2009-03-07 Thread andrew cooke
ah, yes, i didn't see that clearly. in this case it might be better to have: def copy(src, dst, name, null): value = src[name] dst[name] = null if value is None else value and then make it explicit in both cases: copy(row, ad, name, null=None) ... copy(row, ad, name, null='None') andrew Pa

Re: retrieve traceback in embedded python of Python3.0?

2009-03-07 Thread Gabriel Genellina
En Sat, 07 Mar 2009 01:43:05 -0200, BigHand escribió: On Mar 7, 11:40 am, BigHand wrote: Guys: I have a embedded python in MFC app. to execute a py script of a.py, the is only one line in a.py, it "a()" , normally ,excute this script file ,you will get a  "the exception type is " "The exceptio

Re: "/a" is not "/a" ?

2009-03-07 Thread Mel
Emanuele D'Arrigo wrote: > Gary, thanks for your reply: your explanation does pretty much answer > my question. One thing I can add however is that it really seems that > non-alphanumeric characters such as the forward slash make the > difference, not just the number of characters. I.e. (Actually,

Re: "/a" is not "/a" ?

2009-03-07 Thread Mel
wrote: > Steven D'Aprano writes: >> It is never >> correct to avoid using "is" when you need to compare for identity. > > When is it ever necessary to compare for identity? Ho-hum. MUDD game. def broadcast (sender, message): for p in all_players: if p is not sender: p

can't print the exception cause/context in Python3.0?

2009-03-07 Thread BigHand
Here is copy from my IDLE of python 3.0 >>> import sys >>> import traceback >>> def a(): b() >>> def b(): return tuple()[0] >>> try: a() except: exc_typ, exc_val, exc_tb = sys.exc_info() >>> traceback.print_tb(exc_tb) File "", line 2, in File "", line 2, i

Re: "/a" is not "/a" ?

2009-03-07 Thread Christian Heimes
Steven D'Aprano wrote: > Yes. Floating point NANs are required to compare unequal to all floats, > including themselves. It's part of the IEEE standard. As far as I remember that's not correct. It's just the way C has interpreted the standard and Python inherited the behavior. But you may proof me

Re: doctest + shelve question

2009-03-07 Thread Gabriel Genellina
En Fri, 06 Mar 2009 19:56:07 -0200, Sebastian Bartos escribió: I have a question. I'm writing a simple object serialization module using shelve to write arbitrary objects to a file (M.py). Now I have the problem, that if I create a simple object in the doctest documentation file M.txt like th

Re: pass bool values to the Python function in embedded python 3.0

2009-03-07 Thread Gabriel Genellina
En Sat, 07 Mar 2009 07:38:29 -0200, BigHand escribió: how do I pass True to the Python function in the C++ code? (I've already suggested using PyErr_Print/PyTraceback_Print instead) See the section "Boolean Objects" in the C API Reference: "PyObject* Py_True The Python True object. This obj

Re: ANN: Dao, the official 1.0 version is released

2009-03-07 Thread Limin Fu
I don't think there is confusion here, because the Microsoft database access method DAO is not a programming language. > > Whatever it is, the name does tend to lend confusion with the older > Microsoft database access method DAO (which was superceded by ADO). > -- >Wulfraed

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
odeits wrote: I am looking to clean up this code... any help is much appreciated. Note: It works just fine, I just think it could be done cleaner. The result is a stack of dictionaries. the query returns up to STACK_SIZE ads for a user. The check which i think is very ugly is putting another con

Re: Eclipse And PyDev

2009-03-07 Thread Fabio Zadrozny
> I realize this question may not belong here but I am going to ask anyway to > the current users of Eclipse and PyDev.  It's regarding the auto-complete > feature.  Say you want to type "sys.path.append('yada yada yada')", using > say Komodo or IDLE.  When you get to "sys.path.ap" and type a "(",

Re: can't print the exception cause/context in Python3.0?

2009-03-07 Thread Gabriel Genellina
En Sat, 07 Mar 2009 11:46:08 -0200, BigHand escribió: Here is copy from my IDLE of python 3.0 traceback.print_tb(exc_tb) File "", line 2, in File "", line 2, in a File "", line 2, in b but this doesn't output the cause/context like 2.6: or on the sample of: http://docs.python.org/3.

Re: ANN: Dao, the official 1.0 version is released

2009-03-07 Thread MRAB
Limin Fu wrote: > Dennis Lee Bieber wrote: Whatever it is, the name does tend to lend confusion with the older Microsoft database access method DAO (which was superceded by ADO). I don't think there is confusion here, because the Microsoft database access method DAO is not a programming langua

Re: Translating pysnmp oids to human readable strings

2009-03-07 Thread SpamMePlease PleasePlease
On Fri, Mar 6, 2009 at 2:14 PM, Shantanu Joshi wrote: > > SpamMePlease PleasePlease writes: > >> >> I actually tried to load the new file with following code: >> >> print builder.MibBuilder().getMibPath() >> mibBuilder = builder.MibBuilder().loadModules('jnx-bgpmib2') >> >> but I am experiencing

Re: ANN: Dao, the official 1.0 version is released

2009-03-07 Thread Limin Fu
On Sat, Mar 7, 2009 at 5:14 PM, MRAB wrote: > Limin Fu wrote: > > Dennis Lee Bieber wrote: > >> Whatever it is, the name does tend to lend confusion with the older >>> Microsoft database access method DAO (which was superceded by ADO). >>> >> >> I don't think there is confusion here, because the

Re: "/a" is not "/a" ?

2009-03-07 Thread Emanuele D'Arrigo
On Mar 6, 10:46 pm, "Martin v. Löwis" wrote: > For b), the rationale is that such string literals > in source code are often used to denote names, e.g. > for getattr() calls and the like. As all names are interned, > name-like strings get interned also. Thank you Martin, and all others who have r

Import, Inheritance, Scoping -- I'm doing something wrong with one of these

2009-03-07 Thread Elijah Newren
Hi, I have three files in a simple testcase, and when I run $ main.py callee.options This comes back with a Traceback pointing out the following error: File "callee.options", line 5, in __init__ Foo.__init__(self, value) NameError: global name 'Foo' is not defined The three files are: -

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
Martin P. Hellwig wrote: def query_parser(QUERY, USER, STACK_SIZE): indexes = ['ni','adid','rundateid','rundate','city','state','status'] empty = 'None' stack = [] query_result = self.con.execute(QUERY,(USER,STACK_SIZE)).fetchall() ni = indexes[0] for row in query_resul

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
Martin P. Hellwig wrote: while I am at it :-) if ignore == False: is probably cleaner when written if not ignore: -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Import, Inheritance, Scoping -- I'm doing something wrong with one of these

2009-03-07 Thread Peter Otten
Elijah Newren wrote: > Hi, > > I have three files in a simple testcase, and when I run > $ main.py callee.options > This comes back with a Traceback pointing out the following error: > File "callee.options", line 5, in __init__ > Foo.__init__(self, value) > NameError: global name 'Foo' is

Re: Can Python do shopping cart?

2009-03-07 Thread Tino Wildenhain
Muddy Coder wrote: Hi Folks, I know PHP can do shopping cart, such as Zen Cart. I wonder can Python do such a thing? Thanks! No, python cannot "do" that. I also doubt there are many other computer languages, much less PHP that can "do" that. You or somebody else has to write the code - but of

Re: create boolean

2009-03-07 Thread Scott David Daniels
Lie Ryan wrote: Fencer wrote: The literal translation of that would be: if n is not None and n != []: b = True else: b = False it is a bit verbose, so one might want to find something shorter b = True if n is not None and n != [] else False I always feel if and in-line if to be easier and

Re: Should I use stackless python or threads?

2009-03-07 Thread John Nagle
Minesh Patel wrote: On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone wrote: On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel wrote: I am trying to figure out the best approach to solve this problem: I want to poll various directories(can be run in the main thread). Once I notice a file has

should i move on to python3

2009-03-07 Thread Wensui Liu
i started learning python with earlier version and am happy with it and all related packages, such as scipy, pywin, and so on. right now, i am wondering if i should move to python3. if i do, will all packages working on earlier version still work in python3? this is my major concern. my another que

Re: create boolean

2009-03-07 Thread Andre Engels
On Sat, Mar 7, 2009 at 6:03 AM, Grant Edwards wrote: > Putting in the second comparison in makes the code match the > stated requirement.  Otherwise you have to start making > assumptions about what n might be besides None or the empty > list. But the stated requirement already assumes that n is

Re: Eclipse And PyDev

2009-03-07 Thread Steve Phillips
Thanks. I noticed that when I was on my windows box at work and I would check it and click apply then ok and when I go back to those prefs and it isn't checked. I did that a few times. I will try it on my Linux box tomorrow at home and see if I have the same results. Thanks again Steve > > On 3/

RELEASED Python 3.1 alpha 1

2009-03-07 Thread Benjamin Peterson
On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 3.1. Python 3.1 focuses on the stabilization and optimization of features and changes Python 3.0 introduced. The new I/O system has been rewritten in C for speed. Other featu

Re: Should I use stackless python or threads?

2009-03-07 Thread MRAB
John Nagle wrote: Minesh Patel wrote: On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone wrote: On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel wrote: I am trying to figure out the best approach to solve this problem: I want to poll various directories(can be run in the main thread). Once

Re: Should I use stackless python or threads?

2009-03-07 Thread Diez B. Roggisch
John Nagle schrieb: Minesh Patel wrote: On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone wrote: On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel wrote: I am trying to figure out the best approach to solve this problem: I want to poll various directories(can be run in the main thread). Onc

Re: should i move on to python3

2009-03-07 Thread Martin P. Hellwig
Wensui Liu wrote: i started learning python with earlier version and am happy with it and all related packages, such as scipy, pywin, and so on. right now, i am wondering if i should move to python3. if i do, will all packages working on earlier version still work in python3? this is my major con

Re: Translating pysnmp oids to human readable strings

2009-03-07 Thread rdmurray
SpamMePlease PleasePlease wrote: > On Fri, Mar 6, 2009 at 2:14 PM, Shantanu Joshi wrote: > > > > SpamMePlease PleasePlease writes: > > > >> I actually tried to load the new file with following code: > >> > >> print builder.MibBuilder().getMibPath() > >> mibBuilder = builder.MibBuilder().loadModu

Re: Import, Inheritance, Scoping -- I'm doing something wrong with one of these

2009-03-07 Thread Elijah Newren
Hi, For some reason, Peter Otten's response is not showing up in my inbox, but did show up in the mailing list archives (http://mail.python.org/pipermail/python-list/2009-March/703850.html). So I'll respond to my own email, quote him, and respond that way. On Sat, Mar 7, 2009 at 9:46 AM, Elijah

Re: [Python-Dev] RELEASED Python 3.1 alpha 1

2009-03-07 Thread Benjamin Peterson
2009/3/7 Gerard Flanagan : > Benjamin Peterson wrote: > On the release page, the bzip link says '3.0' not '3.1'. That should be fixed now. > >> See PEP 375 for release schedule details: >> >>     http://www.python.org/dev/peps/pep-0361/ That URL is actually supposed to be http://www.python.org/d

Re: RichCompare and RichCompareBool

2009-03-07 Thread Aaron Brady
On Mar 3, 12:42 am, Aaron Brady wrote: > On Mar 2, 9:24 pm, Terry Reedy wrote: > > > > > Gabriel Genellina wrote: > > > En Mon, 02 Mar 2009 17:54:09 -0200, Terry Reedy > > > escribió: > > > >> Aaron Brady wrote: > > >>> Hi, > > >>>  In the source for 3.0.1, PyObject_RichCompareBool seems to perf

Re: Translating pysnmp oids to human readable strings

2009-03-07 Thread SpamMePlease PleasePlease
On Sat, Mar 7, 2009 at 8:33 PM, wrote: > SpamMePlease PleasePlease wrote: >> On Fri, Mar 6, 2009 at 2:14 PM, Shantanu Joshi >> wrote: >> > >> > SpamMePlease PleasePlease writes: >> > >> >> I actually tried to load the new file with following code: >> >> >> >> print builder.MibBuilder().getMib

strings for beginers

2009-03-07 Thread Sapote
I am attempting to modify a python program (Discspan) that I downloaded from sourceforge. I know nothing of Python and little of programming. The program will back ups large numbers of files to to multiple DVDs. The burning routine was rather primitive I have modified the burn burn_cmd to write

Re: should i move on to python3

2009-03-07 Thread R. David Murray
"Martin P. Hellwig" wrote: > Wensui Liu wrote: > > i started learning python with earlier version and am happy with it > > and all related packages, such as scipy, pywin, and so on. > > right now, i am wondering if i should move to python3. if i do, will > > all packages working on earlier version

Re: Import, Inheritance, Scoping -- I'm doing something wrong with one of these

2009-03-07 Thread Peter Otten
Elijah Newren wrote: > Hi, > > For some reason, Peter Otten's response is not showing up in my inbox, > but did show up in the mailing list archives > (http://mail.python.org/pipermail/python-list/2009-March/703850.html). > So I'll respond to my own email, quote him, and respond that way. > > O

Re: Help cleaning up some code

2009-03-07 Thread Scott David Daniels
odeits wrote: I am looking to clean up this code... any help is much appreciated. Note: It works just fine, I just think it could be done cleaner. The result is a stack of dictionaries. the query returns up to STACK_SIZE ads for a user. The check which i think is very ugly is putting another con

Re: should i move on to python3

2009-03-07 Thread Martin P. Hellwig
R. David Murray wrote: Comparing Python releases to Windows releases is...disturbing :) That was why I was very carefully in this example for choosing 2000 :-) -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] RELEASED Python 3.1 alpha 1

2009-03-07 Thread Raymond Hettinger
[Benjamin Peterson] On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 3.1. Thanks for the good work. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: strings for beginers

2009-03-07 Thread Tim Wintle
On Sat, 2009-03-07 at 12:53 -0800, Sapote wrote: > I have an incrementing variable disc_num that I could insert in the > line below to create discspanisoX.iso where X is incrementing... > > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso.iso -graft- > points --path-list %s" %(temp_list)

Re: strings for beginers

2009-03-07 Thread Tim Wintle
On Sat, 2009-03-07 at 21:25 +, Tim Wintle wrote: > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso%d.iso > -graft-points --path-list %s" %(x,temp_list) obviously I meant to say burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso% d.iso-graft-points --path-list %s" %(disc_num,temp_

Themed TK (tk Tile) at last?!

2009-03-07 Thread Python Nutter
Looks like we finally get tkinter GUI based programs according to Issue# 2983 in Python 3.1a so our programs don't look like something out of early 1980's and can be themed to more closely match the underlying Operating Systems widget set! This is a big deal in that while tkinter came with (just a

Re: Email Program

2009-03-07 Thread Ville M. Vainio
J wrote: > Is it possible to make a GUI email program in Python that stores > emails, composes, ect? Here's one with less than 600 lines: http://code.google.com/p/pyqtimap/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Themed TK (tk Tile) at last?!

2009-03-07 Thread cgoldberg
> This is a big deal in that while tkinter came with (just about) every > Python the desire to use wxWidgets or Qt etc was high because tkinter > widgets just look so horrid. I liked Tk a lot, but also moved to wx because of Tk's L&F. Tk is great for simple tool interfaces. Great news. -Corey -

RE: Parsing/Crawler Questions - solution

2009-03-07 Thread bruce
and this solution will somehow allow a user to create a web parsing/scraping app for parising links, and javascript from a web page? -Original Message- From: python-list-bounces+bedouglas=earthlink@python.org [mailto:python-list-bounces+bedouglas=earthlink@python.org]on Beha

Re: Themed TK (tk Tile) at last?!

2009-03-07 Thread Benjamin Peterson
Python Nutter gmail.com> writes: > The Python 3.1a web page still had what's new in Python 2.7 on the web > page so does this also enter the Python 2.x branch? I don't know yet. > But it so I might have a push to move off of 2.5.4 finally for the so > simple GUi based apps I have. Yes, it will b

Re: Chandler, Python, speed

2009-03-07 Thread Ville M. Vainio
Alan G Isaac wrote: > 3. Chandler is not really an email client. So specifically, > which of its functionalities is it slow, and what evidence > if any is there that Python is causing this? I remember reading "somewhere" that the cause of slowness is/was architectural - perhaps it was that chand

speeding up reading files (possibly with cython)

2009-03-07 Thread per
hi all, i have a program that essentially loops through a textfile file thats about 800 MB in size containing tab separated data... my program parses this file and stores its fields in a dictionary of lists. for line in file: split_values = line.strip().split('\t') # do stuff with split_value

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread Scott David Daniels
Benjamin Peterson wrote: On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 3.1. Congratulations on the release. I know 3.0 didn't have installers built for the alphas, will that be the case for 3.1? --Scott David Daniels

Re: should i move on to python3

2009-03-07 Thread Python Nutter
Maybe if everyone shares their own thinking for their own situations it may help. I know the 2.x branch rather well, and cut my teeth on it. My work involves x509 cryptographic materials and I cut my own binaries and then wrap them in python to extend and enhance or build a lot of automation arou

Ban Xah Lee

2009-03-07 Thread Xah Lee
Of interest: • Why Can't You Be Normal? http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html • Ban Xah Lee http://xahlee.org/Netiquette_dir/ban_Xah_Lee.html I consider this post relevant because i've been perennially gossiped about in comp.lang.* groups today and in the past 5 or 10

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread Carl Banks
On Mar 7, 10:53 am, Benjamin Peterson wrote: > On behalf of the Python development team and the Python community, I'm > happy to announce the first alpha release of Python 3.1. > > Python 3.1 focuses on the stabilization and optimization of features and > changes > Python 3.0 introduced.  The new

Re: speeding up reading files (possibly with cython)

2009-03-07 Thread skip
>> about 800 MB in size containing tab separated data... my program >> parses this file and stores its fields in a dictionary of lists. ... >> currently, this is very slow in python, even if all i do is break up >> each line using split() and store its values in a dictionary,

Re: should i move on to python3

2009-03-07 Thread Terry Reedy
Python Nutter wrote: silently troll python submitters and got the feeling 3.1 was what 3.0 was supposed to be ;-) I would say that it will be what the developers wish 3.0 had been. Part of the problem was that not enough people downloaded and tested the 3.0 betas to discover certain problem

Re: speeding up reading files (possibly with cython)

2009-03-07 Thread skip
me> reader = csv.reader(open(fname, "rb")) me> for row in reader: me> ... duh... How about reader = csv.reader(open(fname, "rb"), delimiter='\t') for row in reader: ... S -- http://mail.python.org/mailman/listinfo/python-list

Re: can't print the exception cause/context in Python3.0?

2009-03-07 Thread BigHand
On 3月7日, 下午11时21分, "Gabriel Genellina" wrote: > En Sat, 07 Mar 2009 11:46:08 -0200, BigHand escribió: > > > > > Here is copy from my IDLE of python 3.0 > > traceback.print_tb(exc_tb) > >   File "", line 2, in > >   File "", line 2, in a > >   File "", line 2, in b > > > but this doesn't out

Re: pass bool values to the Python function in embedded python 3.0

2009-03-07 Thread BigHand
On 3月7日, 下午10时38分, "Gabriel Genellina" wrote: > En Sat, 07 Mar 2009 07:38:29 -0200, BigHand escribió: > > > how do I pass True to the Python function in the C++ code? > > (I've already suggested using PyErr_Print/PyTraceback_Print instead) > > See the section "Boolean Objects" in the C API Refere

Re: Ban Xah Lee

2009-03-07 Thread Dirk Bruere at NeoPax
Xah Lee wrote: Of interest: • Why Can't You Be Normal? http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html • Ban Xah Lee http://xahlee.org/Netiquette_dir/ban_Xah_Lee.html I consider this post relevant because i've been perennially gossiped about in comp.lang.* groups today and in

Re: "/a" is not "/a" ?

2009-03-07 Thread Robert Kern
On 2009-03-07 02:11, Albert Hopkins wrote: On Sat, 2009-03-07 at 03:07 -0500, Albert Hopkins wrote: On Fri, 2009-03-06 at 23:57 -0800, Paul Rubin wrote: alex23 writes: But _you_ only _just_ stated "It does have some (generally small) performance ramifications as well" and provided timing exam

Re: "/a" is not "/a" ?

2009-03-07 Thread Robert Kern
On 2009-03-07 08:14, Christian Heimes wrote: Steven D'Aprano wrote: Yes. Floating point NANs are required to compare unequal to all floats, including themselves. It's part of the IEEE standard. As far as I remember that's not correct. It's just the way C has interpreted the standard and Python

Re: speeding up reading files (possibly with cython)

2009-03-07 Thread Tim Chase
i have a program that essentially loops through a textfile file thats about 800 MB in size containing tab separated data... my program parses this file and stores its fields in a dictionary of lists. for line in file: split_values = line.strip().split('\t') # do stuff with split_values curre

Re: speeding up reading files (possibly with cython)

2009-03-07 Thread John Machin
On Mar 8, 9:06 am, per wrote: > hi all, > > i have a program that essentially loops through a textfile file thats > about 800 MB in size containing tab separated data... my program > parses this file and stores its fields in a dictionary of lists. > > for line in file: >   split_values = line.stri

Candidate for a new itertool

2009-03-07 Thread Raymond Hettinger
The existing groupby() itertool works great when every element in a group has the same key, but it is not so handy when groups are determined by boundary conditions. For edge-triggered events, we need to convert a boundary-event predicate to groupby-style key function. The code below encapsulates

Re: speeding up reading files (possibly with cython)

2009-03-07 Thread John Machin
On Mar 8, 9:06 am, per wrote: > hi all, > > i have a program that essentially loops through a textfile file thats > about 800 MB in size containing tab separated data... my program > parses this file and stores its fields in a dictionary of lists. > > for line in file: >   split_values = line.stri

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread Benjamin Peterson
Scott David Daniels Acm.Org> writes: > > Benjamin Peterson wrote: > > On behalf of the Python development team and the Python community, I'm > > happy to announce the first alpha release of Python 3.1. > > Congratulations on the release. > I know 3.0 didn't have installers built for the alphas,

Parsing unicode (devanagari) text with xml.dom.minidom

2009-03-07 Thread rparimi
Hello, I am trying to process an xml file that contains unicode characters (see http://vyakarnam.wordpress.com/). Wordpress allows exporting the entire content of the website into an xml file. Using xml.dom.minidom, I wrote a few lines of python code to parse out the xml file, but am stuck with t

Re: should i move on to python3

2009-03-07 Thread Mensanator
On Mar 7, 5:09�pm, Terry Reedy wrote: > Python Nutter wrote: > > silently troll python submitters and got the feeling 3.1 was what 3.0 > > was supposed to be ;-) > > I would say that it will be what the developers wish 3.0 had been. �Part > of the problem was that not enough people downloaded and

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread bearophileHUGS
Are the computed gotos used in the future pre-compiled Windows binary (of V.3.1) too? Is such optimization going to be backported to the 2.x series too, like Python 2.7? Bye and thank you for your work, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Themed TK (tk Tile) at last?!

2009-03-07 Thread Tim Wintle
On Sun, 2009-03-08 at 08:37 +1100, Python Nutter wrote: > Looks like we finally get tkinter GUI based programs according to > Issue# 2983 in Python 3.1a so our programs don't look like something > out of early 1980's and can be themed to more closely match the > underlying Operating Systems widget

Re: Indentations and future evolution of languages

2009-03-07 Thread Tim Roberts
Tim Rowe wrote: > >I don't think the article is right that "it's silly to have some >expression/statement groupings indentation based and some grouped by >enclosing tokens" -- provided it's done right. The OCAML-based >language F# accepts OCAML enclosing tokens, but if you mark the groups >with in

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread Benjamin Peterson
lycos.com> writes: > > Are the computed gotos used in the future pre-compiled Windows binary > (of V.3.1) too? I doubt it. I don't think they've even been built yet. Martin will now, though. > > Is such optimization going to be backported to the 2.x series too, > like Python 2.7? Probably n

Re: should i move on to python3

2009-03-07 Thread Tim Wintle
On Sun, 2009-03-08 at 09:15 +1100, Python Nutter wrote: > Maybe if everyone shares their own thinking for their own situations > it may help. Well, at work I do a mixture of things, some of which require python 2.3 (I know...), and some of which I can write to whatever version I want. I generally

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread Christian Heimes
bearophileh...@lycos.com wrote: > Are the computed gotos used in the future pre-compiled Windows binary > (of V.3.1) too? No, the MS Visual C compiler doesn't supported labels as values [1]. The feature is only supported by some compilers like GCC. Christian [1] http://gcc.gnu.org/onlinedocs/gcc

Re: Ban Xah Lee

2009-03-07 Thread D Herring
Xah Lee wrote: This page is a short collection of online communities that banned me, in a way that i don't consider just. It illustrates the political nature among the tech geeking males. If anybody on this list visits Boston, contact me to claim your free beer. :) -- http://mail.python.org/

Re: RELEASED Python 3.1 alpha 1

2009-03-07 Thread bearophileHUGS
Benjamin Peterson: >It provides a good incentive for people to upgrade. :)< Sometimes at work you are forced you to use Python 2.x, so incentives aren't much relevant. Christian Heimes: > No, the MS Visual C compiler doesn't supported labels as values [1]. The > feature is only supported by som

Re: Candidate for a new itertool

2009-03-07 Thread bearophileHUGS
Raymond Hettinger, maybe it can be useful to add an optional argument flag to tell such split_on to keep the separators or not? This is the xsplit I usually use: def xsplit(seq, key=bool, keepkeys=True): """xsplit(seq, key=bool, keepkeys=True): given an iterable seq and a predicate key, s

Re: Python3 on the Web

2009-03-07 Thread Paul Rubin
Tim Roberts writes: > At that level of load, CGI is perfectly workable, and it's certainly the > easiest of the choices for development and exploration. One problem of CGI even at very low loads is that it's harder to handle the case where two hits arrive at the same time and want to save data.

  1   2   >