Re: problem adding list values

2005-12-22 Thread Tomasz Lisowski
Dave Hansen wrote: > I think what you want is > >for cr in credlist: > credits += cr > > Which could also be implemented as > >credits = reduce(lambda x,y: x+y, credlist) or even: credits = sum(credlist) Tomasz Lisowski -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: concatenate literals (using jython)

2005-12-22 Thread Tomasz Lisowski
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > >>I'm using Jython (actually WebLogic WLST), and trying to do something >>really simple. I want to create a string from two function calls and a >>literal, like: >> >> serverport = server.getListenAddress() + ':' + server.getListenPort() >> >>

Re: A simple list question.

2005-12-22 Thread Tomasz Lisowski
KraftDiner wrote: > I am trying to implement a two dimensional array. > mylist = [[a,b,c],[d,e,f,c],[g,h,i]] > > So the array is of length 3 here... > So how do I initialize this array and then set each object? > At some point in my code I know there will be 3 lists in the list. > So how do I init

Re: Which Python web framework is most like Ruby on Rails?

2005-12-22 Thread Robert Kern
Paul Rubin wrote: > Hmmm. I seem to remember RMS saying that the GPL didn't extend to > Emacs Lisp functions that the user writes, even though those call > various built-in Emacs functions, as long as they use the documented > API. Those certainly run in the same address space as Emacs. This is

Re: Which Python web framework is most like Ruby on Rails?

2005-12-22 Thread Robert Kern
Paul Rubin wrote: > Jeff Rush <[EMAIL PROTECTED]> writes: > >>Your only solution would be a proprietary license that states you >>purchased this program and don't have the right to pass it on to >>others, similar to ActiveState or somesuch. > > It sounds like that's what Kent wants to do with the

Re: Guido at Google

2005-12-22 Thread Anand
> It's like having James Bond as your very own personal body guard ;) That is such a nice quote that I am going to put it in my email signature ! :) -Anand -- http://mail.python.org/mailman/listinfo/python-list

Re: call static function from extension module - syntaxerror

2005-12-22 Thread Erik Max Francis
Todd wrote: > I'm working right from the example here to make a basic extenstion > module. > http://docs.python.org/ext/intro.html > http://www.dalkescientific.com/writings/diary/archive/2005/04/26/extending_python.html > > I can load my module into python and dir shows my function. But I get >

Re: Which Python web framework is most like Ruby on Rails?

2005-12-22 Thread Paul Rubin
Jeff Rush <[EMAIL PROTECTED]> writes: > Your only solution would be a proprietary license that states you > purchased this program and don't have the right to pass it on to > others, similar to ActiveState or somesuch. It sounds like that's what Kent wants to do with the apps that he's building.

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Alex Martelli
Bengt Richter <[EMAIL PROTECTED]> wrote: ... > If you want to edit text, maybe the best thing is a text editor? > Why not write it into a temp file and start the user's favorite editor Agreed. There's a recipe for that in the online Python Cookbook, and we edited and enhanced that into the 2nd

Re: Which Python web framework is most like Ruby on Rails?

2005-12-22 Thread Jeff Rush
Kent Johnson wrote: >Luis M. Gonzalez wrote: > > >>The only problem with KARRIGELL, I guess, is that its creator is very >>humble and doesn't like to advertise his creature. He is not very fond >>of "marketing" ... >> >> >From my point of view the biggest problem with Karrigell is that it is

call static function from extension module - syntaxerror

2005-12-22 Thread Todd
Hi, I'm working right from the example here to make a basic extenstion module. http://docs.python.org/ext/intro.html http://www.dalkescientific.com/writings/diary/archive/2005/04/26/extending_python.html I can load my module into python and dir shows my function. But I get a syntax error if I tr

Re: print UTF-8 file with BOM

2005-12-22 Thread Kevin Yuan
import codecsdef read_utf8_txt_file (filename):    fileObj = codecs.open( filename, "r", "utf-8" )    content = fileObj.read()    content = content[1:] #exclude BOM     print content     fileObj.close()    read_utf8_txt_file("e:\\u.txt")22 Dec 2005 18:12:28 -0800, [EMAIL PROTECTED] < [EMAIL PROTECT

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Bengt Richter
On 22 Dec 2005 12:42:36 -0800, "planetthoughtful" <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: >> On 22 Dec 2005 08:55:17 -0800, "planetthoughtful" <[EMAIL PROTECTED]> wrote: >> > >> >I would like to include the ability to edit an existing value (drawn >> >from an SQLite table) using a DOS c

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Roger Upole
If you have Pywin32 build 205 installed, you can use the win32console module to add the data to the typeahead buffer before you call raw_input. import win32console stdin=win32console.GetStdHandle(win32console.STD_INPUT_HANDLE) def raw_input_with_default(prompt, default_val): keypresses=[]

Re: Wingide is a beautiful application

2005-12-22 Thread jussij
> I gave Zeus a try and it passed loading of a large (100 MByte) > text file (many other text editors fail here). Zeus is not designed as a large file editor :( It will try to load the entire file into memory so when you open these very large files the RAM is quickly used up. > It looks at the f

Re: Guido at Google

2005-12-22 Thread Alex Martelli
Bugs <[EMAIL PROTECTED]> wrote: > So when *is* someone (either Guido himself or Google) going to > officially announce that Guido has moved to Google? If at all? I don't think any official announcement is planned. > Also, it would be nice to know from Guido's perspective what, if any at > all,

Re: Guido at Google

2005-12-22 Thread Alex Martelli
rbt <[EMAIL PROTECTED]> wrote: ... > > His founder, Mark Shuttleworth, is a python fan. > > Aren't most all intelligent people Python fans? No: I know many intelligent people who are not Python fans, ranging from the Perl crowd (lot of great, bright people who however prefer Perl to Python) to

Re: Guido at Google

2005-12-22 Thread Alex Martelli
Bengt Richter <[EMAIL PROTECTED]> wrote: > On Thu, 22 Dec 2005 09:07:26 -0800, [EMAIL PROTECTED] (Alex Martelli) > wrote: > > >Renato <[EMAIL PROTECTED]> wrote: > > > >> all of the native administration tools of RedHat (all versions) and > >> Fedora Core are written in python (system-config-* and

Re: Guido at Google

2005-12-22 Thread Ilias Lazaridis
Greg Stein wrote: > Guido would acknowledge a query, but never announce it. That's not his > style. > > This should have a positive impact on Python. His job description has a > *very* significant portion of his time dedicated specifically to > working on Python. (much more than his previous "one

Re: Guido at Google

2005-12-22 Thread Alex Martelli
Nicola Musatti <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Renato <[EMAIL PROTECTED]> wrote: > > > > > all of the native administration tools of RedHat (all versions) and > > > Fedora Core are written in python (system-config-* and/or > > > redhat-config-* ). And even more importantly, y

Re: Guido at Google

2005-12-22 Thread Ilias Lazaridis
Thomas Wouters wrote: [...] thank you for your comments. - TAG.python.evolution.negate . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Ilias Lazaridis
Fredrik Lundh wrote: > Gary Herron wrote: > > >>So how about it... What's your complaint, what's your solution, and why >>should we listen? > > Nobody will ever know. simply review this explanations: http://lazaridis.com/core/index.html some people have already understood this in the past.

Re: Guido at Google

2005-12-22 Thread Robert Kern
[EMAIL PROTECTED] wrote: > This is interesting. With more Python time in Guido's hands maybe Py > 3.0 is a bit closer... :-) > > I don't know if this is a silly idea: > A small part of the wealth of a modern state is probably determined by > the software it uses/produces, and a small part of this

Re: Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Noah wrote: > This looks like a bug in your build of Python 2.4.2 for Windows. > Basically it means that C's malloc() function in the Python interpreter > failed. > On a second trial, it's also failed on Python 2.3.5 for Windows, Python 2.3.3 for Windows, and Python 2.2.3 for Windows. So this se

Re: Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Fredrik Lundh wrote: > try adding a print statement to lib/imaplib.py, just before that read > statement, > > print size, read, size-read > data = self.sslobj.read(size-read) > > and let us know what it prints. 14130601 0 14130601 14130601 16353 14114248 14130601 32737 14097864 1

Re: Guido at Google

2005-12-22 Thread Ilias Lazaridis
[EMAIL PROTECTED] wrote: > Ilias Lazaridis wrote: [...] >> http://lazaridis.com/case/lang/python.html [...] > Hi there, I wonder what comments you would have about XOTCL, or other > OO extensions for tcl, like snit, and dozens more. I looked at the > various scripting languages available to me

Re: Wingide is a beautiful application

2005-12-22 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: >>I don't like, that one of the latest UltraEdit releases >>was buggy causing 100%CPU load and 2MByte of harddisk >>data traffic beeing idle, so I am looking for an alternative >>for years, but instead of finding it I was forced lately >>to spend money again on renewing my

[ANN] python-dateutil 1.1

2005-12-22 Thread Gustavo Niemeyer
Changes since 1.0 - - Fixed rrule byyearday handling. Abramo Bagnara pointed out that RFC2445 allows negative numbers. - Fixed --prefix handling in setup.py (by Sidnei da Silva). - Now tz.gettz() returns a tzlocal instance when not given any arguments and no other timezone i

"Humane" programmer interfaces

2005-12-22 Thread Dave Benjamin
There's been a lot of discussion lately regarding Ruby and the notion of a "humane" interface to objects like arrays and maps, as opposed to "minimalist" ones. I believe the article that started the debates was this one by Martin Fowler: http://www.developertesting.com/archives/month200512/20051

print UTF-8 file with BOM

2005-12-22 Thread davihigh
Hi Friends: fileObj = codecs.open( filename, "r", "utf-8" ) u = fileObj.read() # Returns a Unicode string from the UTF-8 bytes in the file print u It says error: UnicodeEncodeError: 'gbk' codec can't encode character u'\ufeff' in position 0: illegal multiby

Re: Run Oracle stored procedure without ODBC

2005-12-22 Thread hubbardmail
Try http://www.computronix.com/utilities.shtml Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread bearophileHUGS
This is interesting. With more Python time in Guido's hands maybe Py 3.0 is a bit closer... :-) I don't know if this is a silly idea: A small part of the wealth of a modern state is probably determined by the software it uses/produces, and a small part of this software is open source or free. This

Re: Guido at Google

2005-12-22 Thread Luis M. González
[EMAIL PROTECTED] wrote: > JB wrote: > > > long life to Guido & Goole ! many things to come ;) > > Google is merely the new Microsoft and surely just as unethical > at its core. > > And your spelling Goole is probably closer to the mark, > since it is merely the next ghoulish big company, > come to

Re: Run Oracle stored procedure without ODBC

2005-12-22 Thread Jorge Godoy
"John61" <[EMAIL PROTECTED]> writes: > Is there a way to call a stored procedure on an Oracle database using Python > with a runtime connection? There seems to be a cxOracle (something like that) module that allows connecting to Oracle. With it you can connect and call the stored procedure.

Run Oracle stored procedure without ODBC

2005-12-22 Thread John61
Is there a way to call a stored procedure on an Oracle database using Python with a runtime connection? -- http://mail.python.org/mailman/listinfo/python-list

Re: Wingide is a beautiful application

2005-12-22 Thread jussij
> The best not free overall text editing tool on Windows > is UltraEdit As I mentioned before, you should give Zeus a test drive. Many Zeus users think it is the best programming tool for the Windows platform: http://www.zeusedit.com/awards.html Jussi Jumppanen Author: Zeus for Windows --

Re: Socket programming design problem

2005-12-22 Thread Dan Sommers
On Thu, 22 Dec 2005 22:12:09 +, David <[EMAIL PROTECTED]> wrote: > a) Big problem, I can't see how to receive from more than one socket > at once. I need to do this so that data from the TCP connection can > be sent out on the UDP one and vice versa. Do I need a thread for > each, or is ther

Re: Please enlighten me about PyPy

2005-12-22 Thread Luis M. González
> Thanks for clearing up some of my confusion with PyPy, Luis! Hey, I'm glad you brought up this topic! This thread really helped me to understand some dark corners of this exciting project. I also want to thank Carl and all the other Pypy developers for their outstanding work! I've been quietly

Re: Wingide is a beautiful application

2005-12-22 Thread jussij
> I don't like, that one of the latest UltraEdit releases > was buggy causing 100%CPU load and 2MByte of harddisk > data traffic beeing idle, so I am looking for an alternative > for years, but instead of finding it I was forced lately > to spend money again on renewing my license. Have you tried

Re: The Varieties of Pythonic Experience

2005-12-22 Thread Kent Johnson
Robert Hicks wrote: > You mean Jython is still going? ; ) Yes, I see the smiley but there are too many "is Jython dead?" posts on the Jython lists for me to leave this alone... Jython is going strong. Thanks to Brian Zimmer and a grant from PSF it is under active development again and workin

Re: Please enlighten me about PyPy

2005-12-22 Thread Bugs
Scott David Daniels wrote: > [snip] The big trick is that you can specialize the interpreter for > running _its_ input (a Python program), thus giving you a new > interpreter that only runs your Python program -- a very specialized > interpreter indeed. > Now THAT will be slick! What is the curr

Re: GUI and graph

2005-12-22 Thread Kent Johnson
questions? wrote: > I have a graph with different parameters along different parts of the > graph. > > I want to have a program that can display the graph with coloring for > different part of the graph. Is this possible in Python? What should I > read? pydot is pretty amazing in its abilitity to

Re: File object question

2005-12-22 Thread Kent Johnson
S. D. Rose wrote: > Hello all. > If I read a binary file: > > file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the > object, d/l from website another... > file.read() > > is there anyway I can determine the 'size' of the object file? (Without > going to the filesystem and rea

Re: Guido at Google

2005-12-22 Thread x600y
JB wrote: > long life to Guido & Goole ! many things to come ;) Google is merely the new Microsoft and surely just as unethical at its core. And your spelling Goole is probably closer to the mark, since it is merely the next ghoulish big company, come to restrict our freedoms and blot out the s

Re: serialize object in jython, read into python

2005-12-22 Thread Kent Johnson
py wrote: > I want to serialize an object in jython and then be able to read it in > using python, and vice versa. > > Any suggestions on how to do this? pickle doesnt work, nor does using > ObjectOutputStream (from jython). > > I prefer to do it file based ...something like > > pickle.dump(som

Re: GUI and graph

2005-12-22 Thread Avell Diroll
questions? wrote: > I have a graph with different parameters along different parts of the > graph. > > I want to have a program that can display the graph with coloring for > different part of the graph. Is this possible in Python? What should I > read? > > Thanks for any comments > I would sug

Re: Guido at Google

2005-12-22 Thread Bugs
Greg Stein wrote: > 50% "on" > 100% "with" > Wow, that's great to know, thanks Greg! -- http://mail.python.org/mailman/listinfo/python-list

Re: Please enlighten me about PyPy

2005-12-22 Thread Ray
Carl Friedrich Bolz wrote: > Hi! > > some more pointers in addition to the good stuff that Luis wrote... Thanks Carl! That solidified my mental picture of PyPy a lot more :) Warm regards, Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: Please enlighten me about PyPy

2005-12-22 Thread Ray
Luis M. González wrote: > Well, first and foremost, when I said that I leave the door open for > further explanations, I meant explanations by other people more > knowlegeable than me :-) Thanks for clearing up some of my confusion with PyPy, Luis! Cheers, Ray -- http://mail.python.org/mailma

Re: Guido at Google

2005-12-22 Thread Greg Stein
50% "on" 100% "with" On 12/22/05, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On Dec 22, 2005, at 2:20 PM, Greg Stein wrote: > > Guido would acknowledge a query, but never announce it. That's not his > > style. > > > > This should have a positive impact on Python. His job description has a > > *very

Re: serialize object in jython, read into python

2005-12-22 Thread Erik Max Francis
Noah wrote: > You can give up on pickle, because pickle is only > guaranteed to work with the exact same version of the Python > interpreter. Not true. You're thinking of marshal. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && A

Re: File object question

2005-12-22 Thread Tim Williams (gmail)
On 22/12/05, S. D. Rose <[EMAIL PROTECTED]> wrote: Hello all.  If I read a binary file:file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get theobject, d/l from website another...file.read()is there anyway I can determine the 'size' of the object file? (Without going to the filesystem

Re: How to check if a string "is" an int?

2005-12-22 Thread Peter Otten
Steven D'Aprano wrote: > But since you're going to take my protests about regexes more seriously > than I intended you to, it is ironic that you supplied a regex that > is nice and fast but doesn't work: I think you said that "exceptions are cheap" elsewhere in this thread and I read your post ab

Re: A simple list question.

2005-12-22 Thread Kent Johnson
KraftDiner wrote: > I am trying to implement a two dimensional array. > mylist = [[a,b,c],[d,e,f,c],[g,h,i]] > > So the array is of length 3 here... > So how do I initialize this array and then set each object? > At some point in my code I know there will be 3 lists in the list. > So how do I init

Re: Guido at Google

2005-12-22 Thread Tim Peters
[Greg Stein] >>> Guido would acknowledge a query, but never announce it. That's not his >>> style. He's been very low-key about it, but did make an informal announcement on the PSF-Members mailing list. >>> This should have a positive impact on Python. His job description has a >>> *very* signifi

Re: How do I get a dictionary of argument names with their default values?

2005-12-22 Thread Noah
Thanks! Much more handy than what I was trying to do and it looks like I might even learn something new :-) Yours, Noah -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IMAP4 Memory Error

2005-12-22 Thread Fredrik Lundh
Dody Suria Wijaya wrote: > Hi, I encountered a Memory Error Exception on using IMAP4 just like in > Python documentation example, on a specially large email (10 MB). Any > idea how to fix/circumvent this? > > >>> typ, data = M.fetch(89, '(RFC822)') > Traceback (most recent call last): >File "

Re: Socket programming design problem

2005-12-22 Thread John J. Lee
David <[EMAIL PROTECTED]> writes: [...] > a) Big problem, I can't see how to receive from more than one socket at > once. I need to do this so that data from the TCP connection can be sent > out on the UDP one and vice versa. Do I need a thread for each, or is > there some other way I can listen

Re: Guido at Google

2005-12-22 Thread casioculture
Ilias Lazaridis wrote: > Greg Stein wrote: > > Yeah... we recognize that we could certainly open-source more of our > > software. While we've released some stuff > > (code.google.com/projects.html), there is a LOT more that we want to > > http://code.google.com/projects.html > > > do. Getting engi

Re: How do I get a dictionary of argument names with their default values?

2005-12-22 Thread Fredrik Lundh
"Noah" <[EMAIL PROTECTED]> wrote: > Is there a simple way to get a dictionary of > argument names and their default values for > a method or function? I came up with one solution, but > I feel like Python must have a simpler way. >>> import inspect >>> help(inspect.getargspec) Help on function ge

Re: Faster copying of composite new-class objects

2005-12-22 Thread John J. Lee
"Alex" <[EMAIL PROTECTED]> writes: > My program requires copying thousands of composite new-class objects. I > found that the following: objCopy=cPickle.loads(cPickle.dumps(obj, > protocol=2)) works about 4 times faster than > copyObj=copy.deepcopy(obj). Is there any way to do it even faster? > >

Re: Guido at Google

2005-12-22 Thread Robert Kern
Jay Parlar wrote: > On Dec 22, 2005, at 2:20 PM, Greg Stein wrote: > >>Guido would acknowledge a query, but never announce it. That's not his >>style. >> >>This should have a positive impact on Python. His job description has a >>*very* significant portion of his time dedicated specifically to >>w

Re: A simple list question.

2005-12-22 Thread KraftDiner
I am trying to implement a two dimensional array. mylist = [[a,b,c],[d,e,f,c],[g,h,i]] So the array is of length 3 here... So how do I initialize this array and then set each object? At some point in my code I know there will be 3 lists in the list. So how do I initialize this list such that I can

Re: Guido at Google

2005-12-22 Thread Jay Parlar
On Dec 22, 2005, at 2:20 PM, Greg Stein wrote: > Guido would acknowledge a query, but never announce it. That's not his > style. > > This should have a positive impact on Python. His job description has a > *very* significant portion of his time dedicated specifically to > working on Python. (much

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >[EMAIL PROTECTED] (Aahz) writes: >> >> What's wrong with >> >> def foo(): >> if False: yield None > >Does the following work? > >def foo(): >raise StopIteration Nope. -- Aahz ([EMAIL PROTECTED]

How do I get a dictionary of argument names with their default values?

2005-12-22 Thread Noah
Is there a simple way to get a dictionary of argument names and their default values for a method or function? I came up with one solution, but I feel like Python must have a simpler way. Python provide a way to get a sequence of argument names and a different way to get a sequence of default argu

Re: GUI and graph

2005-12-22 Thread mneyer
Look up the information on graphical displays in Tk for python. http://www.pythonware.com/library/tkinter/introduction/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > What's wrong with > > def foo(): > if False: yield None Does the following work? def foo(): raise StopIteration -- http://mail.python.org/mailman/listinfo/python-list

Re: The Varieties of Pythonic Experience (was: Guido at Google)

2005-12-22 Thread Robert Hicks
You mean Jython is still going? ; ) Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Will McGugan
Kenneth McDonald wrote: > I recently had need to write the following code: > > def compileOuter(self): > if False: yield None > else: return > > "compileOuter" is a generator function which is implemented in various > classes. In this particular class, it always yields nothi

Socket programming design problem

2005-12-22 Thread David
After programming with Python for a few hours, I've come up with some code: http://p.shurl.net/3n. However, now I've realised there's a bit of a problem with the original design. I have a number of questions, if anybody could answer I'd be grateful. a) Big problem, I can't see how to receive fro

Re: Guido at Google

2005-12-22 Thread Greg Stein
Guido would acknowledge a query, but never announce it. That's not his style. This should have a positive impact on Python. His job description has a *very* significant portion of his time dedicated specifically to working on Python. (much more than his previous "one day a week" jobs have given hi

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Kenneth McDonald <[EMAIL PROTECTED]> wrote: > >I recently had need to write the following code: > > def compileOuter(self): > if False: yield None > else: return What's wrong with def foo(): if False: yield None -- Aahz ([EMAIL PRO

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Duncan Booth
Kenneth McDonald wrote: > I recently had need to write the following code: > > def compileOuter(self): > if False: yield None > else: return > > "compileOuter" is a generator function which is implemented in > various classes. In this particular class, it always yields n

Re: How to check if a string "is" an int?

2005-12-22 Thread Steven D'Aprano
On Thu, 22 Dec 2005 09:33:20 +0100, Peter Otten wrote: > Steven D'Aprano wrote: > >> On Wed, 21 Dec 2005 16:39:19 +0100, Daniel Schüle wrote: >> >>> [EMAIL PROTECTED] wrote: How do I check if a string contains (can be converted to) an int? I want to do one thing if I am parsing and int

sorting with expensive compares?

2005-12-22 Thread Dan Stromberg
Hi folks. Python appears to have a good sort method, but when sorting array elements that are very large, and hence have very expensive compares, is there some sort of already-available sort function that will merge like elements into a chain, so that they won't have to be recompared as many time

Re: Guido at Google

2005-12-22 Thread Bugs
So when *is* someone (either Guido himself or Google) going to officially announce that Guido has moved to Google? If at all? Also, it would be nice to know from Guido's perspective what, if any at all, impact this will have on Python? Maybe here? http://www.artima.com/weblogs/index.jsp?blogg

GUI and graph

2005-12-22 Thread questions?
I have a graph with different parameters along different parts of the graph. I want to have a program that can display the graph with coloring for different part of the graph. Is this possible in Python? What should I read? Thanks for any comments -- http://mail.python.org/mailman/listinfo/pyth

Interesting little "gotcha" with generators

2005-12-22 Thread Kenneth McDonald
I recently had need to write the following code: def compileOuter(self): if False: yield None else: return "compileOuter" is a generator function which is implemented in various classes. In this particular class, it always yields nothing. However, none of the following

Re: serialize object in jython, read into python

2005-12-22 Thread Fredrik Lundh
"Noah" <[EMAIL PROTECTED]> wrote: > > Thanks for the help in advance. > > You can give up on pickle, because pickle is only guaranteed > to work with the exact same version of the Python interpreter. nope. maybe you're thinking of marshalled bytecode, but I don't think that's what the OP was tal

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Kent Johnson
planetthoughtful wrote: > I think that would be a great solution if the value being 'edited' was > relatively short, or numeric, etc. But the values I want to 'edit' can > be several hundred characters long (ie they're text fields containing > todo notes), and using your method, I'd either accept t

Re: serialize object in jython, read into python

2005-12-22 Thread Paul Rubin
"py" <[EMAIL PROTECTED]> writes: > Noah wrote: > > You can give up on pickle, because pickle is only > > guaranteed to work with the exact same version of the Python > > interpreter. > > :( No that's confusing pickle with marshal. Pickle is supposed to work across versions, though it has recentl

Re: serialize object in jython, read into python

2005-12-22 Thread py
Noah wrote: > You can give up on pickle, because pickle is only > guaranteed to work with the exact same version of the Python > interpreter. :( > How complex of a serialization do you need? simple I just wrote the info out to a file. then i have a thread which reads in the files and parses t

Re: Guido at Google

2005-12-22 Thread blumberg
lazy bastard -- http://mail.python.org/mailman/listinfo/python-list

Re: File object question

2005-12-22 Thread mrmakent
See http://www.python.org/doc/2.4.2/lib/os-file-dir.html for the 'stat' function import os os.stat(path).st_size This will return the size in bytes of the file designated by 'path'. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pydev questions: versions and keybindings

2005-12-22 Thread S. D. Rose
Would (Eclipse) Help | About -> [Plug-in Details] | Plug-in Name -> PyDev - Python Development Environment do the trick for you? -Dave "Kenneth McDonald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to find out if I have the most recent version of Pydev for > Eclipse

File object question

2005-12-22 Thread S. D. Rose
Hello all. If I read a binary file: file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the object, d/l from website another... file.read() is there anyway I can determine the 'size' of the object file? (Without going to the filesystem and reading the filesize from the directory

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22/12/05, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: On 22 Dec 2005 10:14:10 -0800, KraftDiner < [EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfObjects.append(self.cur

Re: Python's ontology and governance

2005-12-22 Thread Martin v. Löwis
Cameron Laird wrote: > Apart from a few very mild constraints that prohibit you from little > more than saying that you're Guido and you invented Python, you have > remarkable liberty to adapt Python to your own needs. Moreover, this > freedom is not merely a theoretical principle; *numerous* wo

Re: serialize object in jython, read into python

2005-12-22 Thread Noah
py wrote: > I want to serialize an object in jython and then be able to read it in > using python, and vice versa. > > Any suggestions on how to do this? pickle doesnt work, nor does using > ObjectOutputStream (from jython). > > I prefer to do it file based ...something like > > pickle.dump(someOb

Re: problem adding list values

2005-12-22 Thread mrmakent
Glad to help. Your relevant code: > i = 0 > for i in credlist: > credits += credlist[i] > i = i + 1 credlist is your list of credits, which are floating point numbers. You use a for-loop to iterate thru this list of floating point numbers, so each time thru the loop, the

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22 Dec 2005 10:14:10 -0800, KraftDiner <[EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfObjects.append(self.currentObject)elif:  

Re: A simple list question.

2005-12-22 Thread Larry Bates
KraftDiner wrote: > Is there a cleaner way to implement this code? > > if len(self.listOfObjects) == 0: > self.listOfObjects.append(self.currentObject) > elif: > self.listOfObjects[self.currentS

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread keirr
planetthoughtful wrote: > Hi Kier, > > Any idea where I'd find documentation on using this extension? I've > downloaded and installed, but haven't had any luck finding docs for it. > As it's a windows version of the standard readline module (usually available on Unix only) I'd _guess_ that you coul

Re: problem adding list values

2005-12-22 Thread andy
David M. Synck wrote: >Hi all, > >I am fairly new to Python and trying to figure out a syntax error >concerning lists and iteration through the same. What I am trying to do is >sum a list of float values and store the sum in a variable for use later. > >The relevant code looks like this - > >def

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread planetthoughtful
Hi Kier, Any idea where I'd find documentation on using this extension? I've downloaded and installed, but haven't had any luck finding docs for it. Much warmth, planetthoughtful -- http://mail.python.org/mailman/listinfo/python-list

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread planetthoughtful
Bengt Richter wrote: > On 22 Dec 2005 08:55:17 -0800, "planetthoughtful" <[EMAIL PROTECTED]> wrote: > > >I would like to include the ability to edit an existing value (drawn > >from an SQLite table) using a DOS console Python app, but my gut > >feeling from reading what I can find about raw_input

Re: Please enlighten me about PyPy

2005-12-22 Thread Carl Friedrich Bolz
Hi! Scott David Daniels wrote: > Luis M. González wrote: > > >>At this moment, the traslated python-in-python version is, or intends >>to be, something more or less equivalent to Cpython in terms of >>performance. > > Actually, I think here it is more or less equivalent in behavior. Yes, apart

Re: problem adding list values

2005-12-22 Thread Dave Hansen
On Thu, 22 Dec 2005 19:43:15 GMT in comp.lang.python, "David M. Synck" <[EMAIL PROTECTED]> wrote: [...] >temp = float(raw_input("Please enter the first credit \n")) > >while temp != 0: >credlist.append(temp) >temp = float(raw_input("Please enter the next credit \n")) Here

Re: pyUnit and dynamic test functions

2005-12-22 Thread Sakcee
Excellent , your example is elegant and runs beautifully so the idea is to create a testcase which runs a general function "testRun" (which calls the function defined in file )and loads data based on type , add this testcase to suite and run suite. thanks , this is exactly what I was looking for

  1   2   3   >