Re: Which is more pythonic?

2008-01-24 Thread Paddy
On Jan 25, 5:14 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a goal function that returns the fitness of a given solution. I > need to wrap that function with a class or a function to keep track of > the best solution I encounter. Which of the following would best serve > my purpose

Re: Python and binary compatibility

2008-01-24 Thread Martin v. Löwis
> All my troubles could apparently be fixed if I > could acquire a copy of VS 2003, but Microsoft has made it incredibly > difficult to find the download for it (I don't think it exists). > > Any suggestions? You can get copies of VS 2003 from ebay fairly easily. Regards, Martin -- http://mail.

Re: Python and binary compatibility

2008-01-24 Thread Thomas Heller
Ambush Commander schrieb: > I'm a newbie to Python; various packages I've used in the past (Lyx, > LilyPond and Inkscape, to name a few) have bundled Python with them > for various scripting needs, and Cygwin also had an install lying > around, so when I started to use Mercurial (also Python) I dec

Re: global/local variables

2008-01-24 Thread Tim Rau
On Jan 24, 7:09 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 24 Jan 2008 15:37:09 -0800, Tim Rau wrote: > > What makes python decide whether a particular variable > > is global or local? > > For starters, if the line of code is not inside a class or function, that > i

Method for intracardiac therapy using sensor for heart wall thickness

2008-01-24 Thread Barathi
Method for intracardiac therapy using sensor for heart wall thickness Localization of muscle gene . rotating and reciprocating piston metering pumps, peristaltic pumps or any ... http://www.freewebs.com/boreqwe/ http://indianfriendfinder.com/go/g931378-pmem http://bigchurch.com/go/

Re: Terminology: "script" versus "program"

2008-01-24 Thread Paul McNett
Steven D'Aprano wrote: > Linux/Unix/Mac admins may be excused for saying that they've never come > across a .BAT file at all. > > $ locate .bat | wc -l > 14 > $ locate .sh | wc -l > 606 $ locate .bat | wc -l 115 $ locate .sh | wc -l 763 $ locate .py | wc -l 44030 Hmmm... that matched all th

Re: Which is more pythonic?

2008-01-24 Thread Travis Jensen
Well, regardless of being "pythonic" or not, the first is far more understandable and therefore more maintainable. Objects were invented to handle holding state; using a function to hold state is, in my opinion, doing a language-based cheat. :) tj On Jan 24, 2008, at 10:14 PM, [EMAIL PROTE

Re: When is min(a, b) != min(b, a)?

2008-01-24 Thread Mark Dickinson
On Jan 24, 7:09 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I'm having a lot of trouble finding the canonical IEEE-754 standard, so > I'm forced to judge by implementations and third party accounts. For > example, this is what IBM says: There's a recent draft of IEEE 754r (

Re: Email module, how to add header to the top of an email?

2008-01-24 Thread David Erickson
On Jan 24, 2:41 pm, Martin Marcher <[EMAIL PROTECTED]> wrote: > On Thursday 24 January 2008 20:32 David Erickson wrote: > > > I have been using the Email module and Message class for awhile, > > however I have been unable to find a way to add a header to the top of > > the email similar to what is

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > > Unix sort does external sorting when needed. > >Ah, someone finally put that in. Good. I hadn't looked at > "sort"'s manual page in many years. Huh? It has been like that from the beginning. It HAD to be. Unix was originally written on a PDP-11.

Which is more pythonic?

2008-01-24 Thread [EMAIL PROTECTED]
I have a goal function that returns the fitness of a given solution. I need to wrap that function with a class or a function to keep track of the best solution I encounter. Which of the following would best serve my purpose and be the most pythonic? class Goal: def __init__(self, goal):

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: >> - Get enough memory to do the sort with an in-memory sort, like >> UNIX "sort" or Python's "sort" function. > > Unix sort does external sorting when needed. Ah, someone finally put that in. Good. I hadn't looked at "sort"

Re: Convert list to file object without creating an actual file.

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 18:57:58 -0800, Bart Kastermans wrote: > I have written a little program that takes as input a text file, ... > Expected since homeworkhtml is in fact not a file. Is there a way to > convert this list to a file object without first writing it to disc and > then opening the re

Re: Convert list to file object without creating an actual file.

2008-01-24 Thread Benjamin
On Jan 24, 8:57 pm, Bart Kastermans <[EMAIL PROTECTED]> wrote: > I have written a little program that takes as input a text file, > converts > it to a list with appropriate html coding (making it into a nice > table). > Finally I want to upload this list as a textfile using ftp. > > If homeworkhtm

Python and binary compatibility

2008-01-24 Thread Ambush Commander
I'm a newbie to Python; various packages I've used in the past (Lyx, LilyPond and Inkscape, to name a few) have bundled Python with them for various scripting needs, and Cygwin also had an install lying around, so when I started to use Mercurial (also Python) I decided that I'd consolidate all of t

Re: [wxPython-users] Issue with docking wx.listctrl window

2008-01-24 Thread tarun
Thanks a lot Robin. I tried using self.log and instead of self.log.list. *Code is attached.* But this gives me a panel and listctrl in it. The extra blank space around the listctrl in window1 is something that I don't need. Please help. Regards, Tarun Devnani On Jan 24, 2008 11:28 PM, Robin Dunn

Re: Ignore exceptions

2008-01-24 Thread Scott David Daniels
Roger Miller wrote: > On Jan 24, 11:30 am, Jonathan Gardner <[EMAIL PROTECTED]> > wrote: >> > >> A few sample good uses of try/except blocks: >> (1) Do something else if an expected exception occurs. >> (2) Show a friendly error message when an exception occurs over ... > I'd add (3) Clean-up

Convert list to file object without creating an actual file.

2008-01-24 Thread Bart Kastermans
I have written a little program that takes as input a text file, converts it to a list with appropriate html coding (making it into a nice table). Finally I want to upload this list as a textfile using ftp. If homeworkhtml contains the list of lines; e.g. homeworkhtml = ["", "", "", "test", "" ...

Re: Text-based data inspector for Python?

2008-01-24 Thread Paddy
On 25 Jan, 00:36, kj <[EMAIL PROTECTED]> wrote: > I've only recently started programming in Python, trying to wean > myself from Perl. One of the things I *really* miss from Perl is > a 100% mouse-free data inspector, affectionally known as the Perl > debugger, PerlDB, or just perl -d. With it I

Re: Python ADO Date Time database fields

2008-01-24 Thread Mike Driscoll
On Jan 24, 5:55 pm, goldtech <[EMAIL PROTECTED]> wrote: > Hi, > > Given an MS-Access table with a date type field with a value of: > 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field. > > I want to print exactly what's in the field, ie. "12:00:00 AM". What I > get printed is: 12/

Re: Text-based data inspector for Python?

2008-01-24 Thread Terry Jones
> "kj" == kj <[EMAIL PROTECTED]> writes: kj> I've only recently started programming in Python, trying to wean kj> myself from Perl. One of the things I *really* miss from Perl is kj> a 100% mouse-free data inspector, affectionally known as the Perl kj> debugger, PerlDB, or just perl -d. Wit

Re: Terminology: "script" versus "program"

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 12:22:04 +, samwyse wrote: >> The term "script" has the strong connotation of a limited-purpose >> program designed to solve a problem expressed almost entirely as a >> simple series of steps. Languages that are often used to write such >> scripts are usually referred to as

Re: Test driven development

2008-01-24 Thread alex23
On Jan 25, 5:44 am, Roel Schroeven <[EMAIL PROTECTED]> wrote: > I guess I just need to try somewhat harder to use TDD in my daily > coding. Apart from books, are there other resources that can help > beginners with TDD? Mailing lists, forums, newsgroups possibly? There's the Testing-in-Python mail

Text-based data inspector for Python?

2008-01-24 Thread kj
I've only recently started programming in Python, trying to wean myself from Perl. One of the things I *really* miss from Perl is a 100% mouse-free data inspector, affectionally known as the Perl debugger, PerlDB, or just perl -d. With it I can examine the most elaborate data structures with e

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > - Get enough memory to do the sort with an in-memory sort, like > UNIX "sort" or Python's "sort" function. Unix sort does external sorting when needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: When is min(a, b) != min(b, a)?

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 16:51:16 +, Pete Forman wrote: > Christian Heimes <[EMAIL PROTECTED]> writes: > > > Antoon Pardon wrote: >>> That doesn't follow. The problem is not that x < nan returns False >>> because that is correct since x isn't smaller than nan. The problem is >>> cmp(x, nan) retur

Re: global/local variables

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 15:37:09 -0800, Tim Rau wrote: > What makes python decide whether a particular variable > is global or local? For starters, if the line of code is not inside a class or function, that is, it's at the top level of a module, it is global. More interesting is if it is inside a

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread John Nagle
[EMAIL PROTECTED] wrote: > Thanks to all who replied. It's very appreciated. > > Yes, I had to double check line counts and the number of lines is ~16 > million (instead of stated 1.6B). OK, that's not bad at all. You have a few options: - Get enough memory to do the sort with an in

Re: creating .pyo with make

2008-01-24 Thread Yann Leboulanger
Diez B. Roggisch wrote: > Yann Leboulanger schrieb: >> Diez B. Roggisch wrote: >>> Yann Leboulanger schrieb: Yann Leboulanger wrote: > Hi, > > I use autoconf / automake to manage my python project, and I'l like > make / make install to create / install .pyo files instead of .p

Python ADO Date Time database fields

2008-01-24 Thread goldtech
Hi, Given an MS-Access table with a date type field with a value of: 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field. I want to print exactly what's in the field, ie. "12:00:00 AM". What I get printed is: 12/30/0/ 00:00:00 I try: import win32com.client from win32.client imp

Re: Problem with Tkinter scrollbar callback

2008-01-24 Thread Ivan Van Laningham
Hi All-- That helps. Doing a get() on the scrollbar before a set(0.0,0.0) returns a 4-tuple: (0.0, 0.0, 0.0, 0.0) ! I did the set(0.0,0.0) and now the callback gets the correct number of arguments. However, I'm still getting the weird behaviour when clicking the arrowheads--and the heads are a

Re: creating .pyo with make

2008-01-24 Thread Diez B. Roggisch
Yann Leboulanger schrieb: > Diez B. Roggisch wrote: >> Yann Leboulanger schrieb: >>> Yann Leboulanger wrote: Hi, I use autoconf / automake to manage my python project, and I'l like make / make install to create / install .pyo files instead of .py files. Is there

Re: global/local variables

2008-01-24 Thread Diez B. Roggisch
Tim Rau schrieb: > What makes python decide whether a particular variable is global or > local? I've got a list and a integer, both defined at top level, no > indentation, right next to each other: > > allThings = [] > nextID = 0 > > and yet, in the middle of a function, python sees one and doesn

Re: When is min(a, b) != min(b, a)?

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 13:34:56 +, Antoon Pardon wrote: > On 2008-01-21, Steven D'Aprano <[EMAIL PROTECTED]> > wrote: >> On Sun, 20 Jan 2008 21:15:02 -0600, Albert Hopkins wrote: >> >> According to the IEEE-754 standard the usual trichotomy of "x is less >> than y, x is equal to y, or x is greate

global/local variables

2008-01-24 Thread Tim Rau
What makes python decide whether a particular variable is global or local? I've got a list and a integer, both defined at top level, no indentation, right next to each other: allThings = [] nextID = 0 and yet, in the middle of a function, python sees one and doesn't see the other: class ship(thi

Re: Problem with Tkinter scrollbar callback

2008-01-24 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "Ivan Van Laningham" <[EMAIL PROTECTED]> wrote: > Hi All-- > I'm having two problems with the scrollbar callback on linux systems > (Fedora 7, Suse 10.1,2 and 3 all exhibit the issues). > > Problem one: on Windows, the callback is called with the arguments as > s

OS X, Python, and Emacs

2008-01-24 Thread Travis Jensen
Honestly, I don't know if this is a python problem or an emacs problem; I'm leaning towards something to do with python, but I'm hoping somebody here might know the answer. The problem is that whenever I start python inside of emacs (both emacs.app and aquamacs), anything I type gets echoed

Re: Reporting Python bugs (was: Can someone explain this unexpectedraw_input behavior?)

2008-01-24 Thread Mike Kent
On Jan 24, 5:13 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ben Finney" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Mike Kent <[EMAIL PROTECTED]> writes: > | > | > A bug issue has been opened in the Python Trac system for this. > | > | Wouldn't it be better to report it

Re: Testing whether something is of type Exception

2008-01-24 Thread Peter Decker
On Jan 24, 2008 5:14 PM, John Nagle <[EMAIL PROTECTED]> wrote: > How can I tell whether an object is of type Exception? > At least in Python 2.4, "Exception" is an old-style class, and > the "type" of Exception objects is "instance". > > Clearly "repr" knows; it returns: > isinsta

read and readline hanging

2008-01-24 Thread Olivier Lefevre
I am calling subprocess.Popen with p = Popen(args, bufsize=-1, stdin=PIPE, stdout=PIPE, stderr=PIPE) and after sending come command to the process, I try to read from p.stdout but after a few calls I hang. What is the correct way to do this, i.e., to read everything w/o getting stuck? I am not fami

Testing whether something is of type Exception

2008-01-24 Thread John Nagle
How can I tell whether an object is of type Exception? At least in Python 2.4, "Exception" is an old-style class, and the "type" of Exception objects is "instance". Clearly "repr" knows; it returns: John Nagle -- http://mail.python.org/mai

Re: Ignore exceptions

2008-01-24 Thread Roger Miller
On Jan 24, 11:30 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > > A few sample good uses of try/except blocks: > > (1) Do something else if an expected exception occurs. > ... > (2) Show a friendly error message when an exception occurs over a > significant chunk of the program. (Useful fo

Anybody has ported talib to Python via SWIG

2008-01-24 Thread Aldo Ceccarelli
Hi Everybody, TaLib (technical analysis package with function indicators coded in C/C ++, http://www.ta-lib.org ) has a complete library with source in C/C+ +. I am new to SWIG (wrapper interface generator) and would really appreciate any Python (.py) port of TaLib to be able to call and test TaLi

Problem with Tkinter scrollbar callback

2008-01-24 Thread Ivan Van Laningham
Hi All-- I'm having two problems with the scrollbar callback on linux systems (Fedora 7, Suse 10.1,2 and 3 all exhibit the issues). Problem one: on Windows, the callback is called with the arguments as specified in the doc: "scroll", "1" or "-1", "units". When I run the identical code on linux,

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Martin Marcher
On Thursday 24 January 2008 20:56 John Nagle wrote: > [EMAIL PROTECTED] wrote: >> Hello all, >> >> I have an Unicode text file with 1.6 billon lines (~2GB) that I'd like >> to sort based on first two characters. > > Given those numbers, the average number of characters per line is > less tha

Re: Email module, how to add header to the top of an email?

2008-01-24 Thread Martin Marcher
On Thursday 24 January 2008 20:32 David Erickson wrote: > I have been using the Email module and Message class for awhile, > however I have been unable to find a way to add a header to the top of > the email similar to what is done with Received: headers... the > add_header method only appends to

Re: Increment Variable Name

2008-01-24 Thread Terry Reedy
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message news:fdff5a3c-376c-41da-bc7c-| > Do you want to do this?: | > locals()['var'+str(1)] = "spam" | | As I recently learnt in this newsgroup, that's not guaranteed to work. | >From http://docs.python.org/lib/built-in-funcs.html | | Warning: The conte

Re: sudoku solver in Python ...

2008-01-24 Thread pataphor
On Thu, 24 Jan 2008 21:09:42 +0100 Thomas Thiel <[EMAIL PROTECTED]> wrote: > Neither fast nor user friendly, but very concise: This is a bit faster: options = set([str(i) for i in range(1, 10)]) def allow(puzzle,i): exclude = set(x if i//9 == j//9 or i%9 == j%9 or i//27 == j//27 an

PyPerforce: How to open file for editing

2008-01-24 Thread Huayang Xia
I'm completely new to pyperforce. I want to open a file (check out a file) for editing. How can I do it from PyPerforce? Another thing is how can I add files to my created label? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reporting Python bugs (was: Can someone explain this unexpectedraw_input behavior?)

2008-01-24 Thread Terry Reedy
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Mike Kent <[EMAIL PROTECTED]> writes: | | > A bug issue has been opened in the Python Trac system for this. | | Wouldn't it be better to report it in the official Python bug tracker | http://bugs.python.org/>, which is Rou

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread John Machin
On Jan 25, 8:26 am, [EMAIL PROTECTED] wrote: > I need to isolate all lines that start with two characters (zz to be > particular) What does "isolate" mean to you? What does this have to do with sorting? What do you actually want to do with (a) the lines starting with "zz" (b) the other lines? Wh

Re: a newbie regex question

2008-01-24 Thread Jonathan Gardner
On Jan 24, 12:14 pm, Shoryuken <[EMAIL PROTECTED]> wrote: > Given a regular expression pattern, for example, \([A-Z].+[a-z]\), > > print out all strings that match the pattern in a file > > Anyone tell me a way to do it? I know it's easy, but i'm completely > new to python > > thanks alot You may

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Stefan Behnel
Stefan Behnel wrote: > [EMAIL PROTECTED] wrote: >>> What are you going to do with it after it's sorted? >> I need to isolate all lines that start with two characters (zz to be >> particular) > > "Isolate" as in "extract"? Remove the rest? > > Then why don't you extract the lines first, without so

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: >> What are you going to do with it after it's sorted? > I need to isolate all lines that start with two characters (zz to be > particular) "Isolate" as in "extract"? Remove the rest? Then why don't you extract the lines first, without sorting the file? (or sort it afterw

Re: Ignore exceptions

2008-01-24 Thread Jonathan Gardner
On Jan 24, 12:13 pm, SMALLp <[EMAIL PROTECTED]> wrote: > Hy. Is there any way to make interrupter ignore exceptions. I'm working > on bigger project and i used to put try catch blocks after writing and > testing code what's boring and it's easy to make mistake. I remember of > something like that

Re: object vs class oriented -- xotcl

2008-01-24 Thread Steven D'Aprano
On Thu, 24 Jan 2008 12:35:44 -0800, William Pursell wrote: > Basically, you can > instantiate an object A of class Foo, and later change A to be an object > of class Bar. Does Python support this type of flexibility? As I > stated above, I've been away from Python for awhile now, and am a bit >

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Ira . Kovac
Thanks to all who replied. It's very appreciated. Yes, I had to doublecheck line counts and the number of lines is ~16 million (insetead of stated 1.6B). Also: >What is a "Unicode text file"? How is it encoded: utf8, utf16, utf16le, >utf16be, ??? If you don't know, do this: The file is UTF-8 >

Reporting Python bugs (was: Can someone explain this unexpected raw_input behavior?)

2008-01-24 Thread Ben Finney
Mike Kent <[EMAIL PROTECTED]> writes: > A bug issue has been opened in the Python Trac system for this. Wouldn't it be better to report it in the official Python bug tracker http://bugs.python.org/>, which is Roundup, not Trac? -- \ "The right to use [strong cryptography] is the right to

Re: object vs class oriented -- xotcl

2008-01-24 Thread Guilherme Polo
2008/1/24, William Pursell <[EMAIL PROTECTED]>: > > I've been away from Python for at least a year, and in the interim > have spent a little time looking at the XOTcl object framework for > Tcl. One of the interesting features of XOTcl is the ability for an > object to change class dynamically. T

Re: object vs class oriented -- xotcl

2008-01-24 Thread Jonathan Gardner
On Jan 24, 12:35 pm, William Pursell <[EMAIL PROTECTED]> wrote: > I'm not sure that describes the method well. Basically, you can > instantiate an object A of class Foo, and later change A to be an > object of class Bar. Does Python support this type of flexibility? > As I stated above, I've bee

Re: Can someone explain this unexpected raw_input behavior?

2008-01-24 Thread Mike Kent
> If it weren't for the documentation... > > "If the prompt argument is present, it is written to *standard output* > without a trailing newline." > > -- > mvh Björn I have reported this issue to the python-dev mailing list, and Guido agrees that this is a bug in Python. It turns out that the ke

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread John Machin
On Jan 25, 6:18 am, [EMAIL PROTECTED] wrote: > Hello all, > > I have an Unicode text file with 1.6 billon lines (~2GB) that I'd like > to sort based on first two characters. If you mean 1.6 American billion i.e. 1.6 * 1000 ** 3 lines, and 2 * 1024 ** 3 bytes of data, that's 1.34 bytes per line. If

object vs class oriented -- xotcl

2008-01-24 Thread William Pursell
I've been away from Python for at least a year, and in the interim have spent a little time looking at the XOTcl object framework for Tcl. One of the interesting features of XOTcl is the ability for an object to change class dynamically. The XOtcl documentation makes the claim that this makes it

Re: Ignore exceptions

2008-01-24 Thread Grant Edwards
On 2008-01-24, SMALLp <[EMAIL PROTECTED]> wrote: > Hy. Hi. > Is there any way to make interrupter ignore exceptions. Nope. Either handle the exceptions or write code that doesn't generate exceptions. > I'm working on bigger project and i used to put try catch > blocks after writing and testin

Re: Ignore exceptions

2008-01-24 Thread Mike Driscoll
On Jan 24, 2:13 pm, SMALLp <[EMAIL PROTECTED]> wrote: > Hy. Is there any way to make interrupter ignore exceptions. I'm working > on bigger project and i used to put try catch blocks after writing and > testing code what's boring and it's easy to make mistake. I remember of > something like that i

Ignore exceptions

2008-01-24 Thread SMALLp
Hy. Is there any way to make interrupter ignore exceptions. I'm working on bigger project and i used to put try catch blocks after writing and testing code what's boring and it's easy to make mistake. I remember of something like that in C++ but I cant find anythin like that for python. SMALLp

a newbie regex question

2008-01-24 Thread Shoryuken
Given a regular expression pattern, for example, \([A-Z].+[a-z]\), print out all strings that match the pattern in a file Anyone tell me a way to do it? I know it's easy, but i'm completely new to python thanks alot -- http://mail.python.org/mailman/listinfo/python-list

Re: sudoku solver in Python ...

2008-01-24 Thread Thomas Thiel
On Wed, 23 Jan 2008 19:02:01 -0800 (PST), Derek Marshall wrote: > This is just for fun, in case someone would be interested and because > I haven't had the pleasure of posting anything here in many years ... > > http://derek.marshall.googlepages.com/pythonsudokusolver > > Appreciate any fee

Smart Debugger (Python)

2008-01-24 Thread kraman
Hi All, Please find the smart debugger for python. it is an enchanced version of python pdb with data rendering feature. http://develsdb.googlecode.com/svn/trunk/python/ http://develsdb.googlecode.com/svn/wiki/SmartDebuggerPython.wiki hope you find this useful. Regards, Karthik -- ht

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread John Nagle
[EMAIL PROTECTED] wrote: > Hello all, > > I have an Unicode text file with 1.6 billon lines (~2GB) that I'd like > to sort based on first two characters. Given those numbers, the average number of characters per line is less than 2. Please check. John

Re: Duplicating a variable

2008-01-24 Thread [EMAIL PROTECTED]
On Jan 24, 9:55 am, [EMAIL PROTECTED] wrote: > > If your variable contains a list, then you can copy it like this: > > >>> l1 = [1, 2, 3] > >>> l2 = l1[:] > >>> l2[1] = 4 > > As you can see now they are two distinct lists: > > >>> l1 > [1, 2, 3] > >>> l2 > > [1, 4, 3] > > If you want to copy any ki

Re: Linux Journal Survey

2008-01-24 Thread Tim Chase
>> want to vote for Python. http://www.linuxjournal.com/node/1006101 > > 18. What is your favorite programming language? > > (15 choices, Python not included) I'm not sure why some folks have their knickers in a knot...I took the survey and there was an "Other" box, so I just wrote in "Python

Re: Test driven development

2008-01-24 Thread Roel Schroeven
Virgil Dupras schreef: > On Jan 24, 1:30 pm, Roel Schroeven <[EMAIL PROTECTED]> > wrote: >> Virgil Dupras schreef: >> >>> I know what you mean by top-down vs. bottom-up and I used to have the >>> same dilemma, but now I would tend to agree with Albert. Your issue >>> with top-down or bottom-up is n

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I have an Unicode text file with 1.6 billon lines (~2GB) that I'd like > to sort based on first two characters. > > I'd greatly appreciate if someone can post sample code that can help > me do this. Use the unix sort command: sort inputfile -o outputfile I think

Email module, how to add header to the top of an email?

2008-01-24 Thread David Erickson
I have been using the Email module and Message class for awhile, however I have been unable to find a way to add a header to the top of the email similar to what is done with Received: headers... the add_header method only appends to the bottom. Is there someway this can be done? Thanks David --

Re: piping into a python script

2008-01-24 Thread Donn
Thanks for the tips, I'll decode and try 'em all out. > Ah yes, Groo. Ever wonder who would win if Groo and Forrest Gump fought > each other? Heh ;) I reckon they'd both die laughing. Be fun to watch -- if anyone else survived! \d -- "A computer without Windows is like chocolate cake without

Sorting Large File (Code/Performance)

2008-01-24 Thread Ira . Kovac
Hello all, I have an Unicode text file with 1.6 billon lines (~2GB) that I'd like to sort based on first two characters. I'd greatly appreciate if someone can post sample code that can help me do this. Also, any ideas on approximately how long is the sort process going to take (XP, Dual Core 2.0

Re: Linux Journal Survey

2008-01-24 Thread Paul Boddie
On 24 Jan, 04:42, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > > The annual Linux Journal survey is online now for any Linux users who > > want to vote for Python. http://www.linuxjournal.com/node/1006101 > > 18. What is your favorite programming lang

Re: Linux Journal Survey

2008-01-24 Thread Russ P.
On Jan 23, 7:42 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: > > > The annual Linux Journal survey is online now for any Linux users who > > want to vote for Python. http://www.linuxjournal.com/node/1006101 > > ... > > 18. What is your favorite progra

Re: Test driven development

2008-01-24 Thread Virgil Dupras
On Jan 24, 1:30 pm, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Virgil Dupras schreef: > > > I know what you mean by top-down vs. bottom-up and I used to have the > > same dilemma, but now I would tend to agree with Albert. Your issue > > with top-down or bottom-up is not relevant in TDD. The only

Re: Problems getting Python scripts to run on server

2008-01-24 Thread 7stud
On Jan 23, 11:30 pm, 7stud <[EMAIL PROTECTED]> wrote: I just wanted to point out that the tag below would go in the httpd.conf file(a config file for apache), which you apparently do not have access to. I was suggesting that you check with your host to make sure they have the right AllowOverride

Re: creating .pyo with make

2008-01-24 Thread Yann Leboulanger
Diez B. Roggisch wrote: > Yann Leboulanger schrieb: >> Yann Leboulanger wrote: >>> Hi, >>> >>> I use autoconf / automake to manage my python project, and I'l like >>> make / make install to create / install .pyo files instead of .py files. >>> >>> Is there something I should add to my Makefile.am

Re: Which reportlab version for python 2.1.3?

2008-01-24 Thread Mike Driscoll
On Jan 24, 8:17 am, LizzyLiz <[EMAIL PROTECTED]> wrote: > Hiya > > Probably me being thick but I can't find which version of reportlab I > should use for python 2.1.3. > > Many thanks > Liz Since ReportLab's website lists dlls for Python 2.1 - 2.5, I think you can just use the latest version. Just

Re: Test driven development

2008-01-24 Thread Roel Schroeven
Virgil Dupras schreef: > I know what you mean by top-down vs. bottom-up and I used to have the > same dilemma, but now I would tend to agree with Albert. Your issue > with top-down or bottom-up is not relevant in TDD. The only thing that > is relevant is to reach your current milestone as soon as p

Re: Can someone explain this unexpected raw_input behavior?

2008-01-24 Thread BJörn Lindqvist
On Jan 24, 2008 8:08 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 24 Jan 2008 01:00:53 -0200, Mike Kent <[EMAIL PROTECTED]> escribió: > > > Gabriel, thank you for clarifying the source of this behavior. Still, > > I'm surprised it would be hard-coded into Python. Consider an > > int

Re: pythonic backtrace with gdb

2008-01-24 Thread Dieter Maurer
Hynek Hanke <[EMAIL PROTECTED]> writes on Wed, 23 Jan 2008 14:30:22 +0100: > ... > I've also tried to use the backtrace script here > http://mashebali.com/?Python_GDB_macros:The_Macros:Backtrace > But I get a different error: > (gdb) pbt > Invalid type combination in ordering comparison. > > I'm u

RE: piping into a python script

2008-01-24 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Donn > Sent: Thursday, January 24, 2008 12:03 PM > To: Michał Bentkowski > Cc: python-list@python.org > Subject: Re: piping into a python script > > I have tested getopt and it strips the lone '

Re: [wxPython-users] Issue with docking wx.listctrl window

2008-01-24 Thread Robin Dunn
tarun wrote: > Hello All, > > I'm trying to create a Frame with AuiManager. The code is attached. > > *Problem:* > - I want 2 windows to be docked in the frame. One is a text control and > other is a list control. > - The text control gets docked, but on trying to dock the list control, > all

Re: Duplicating a variable

2008-01-24 Thread bearophileHUGS
Hans: > I have run into a bit of a subtle problem. How do I go about > duplicating a variable (particularly a list of lists) in python. I > was surprised when simple assignment didn't work. Python is quite high-level language, but now and then it too accepts some compromises to increase its spee

Re: piping into a python script

2008-01-24 Thread Hexamorph
Donn Ingle wrote: > Paddy wrote: >> fileinput is set to process each file a line at a time unfortunately. > Wow. So there seems to be no solution to my OP. I'm amazed, I would have > thought a simple list of strings, one from stdin and one from the args, > would be easy to get. > > I *really* don'

Re: Duplicating a variable

2008-01-24 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have run into a bit of a subtle problem. How do I go about > duplicating a variable (particularly a list of lists) in python. using the deepcopy function of the copy module. > I > was surprised when simple assignment didn't work. For example, let y = > [1,2,3] >

Re: Designing website

2008-01-24 Thread Bruno Desthuilliers
joe jacob a écrit : > Hi All, > > I am planning to design a website using windows, apache, mysql, > python. But I came to know that python cgi is very slow. The problem here is not with Python, but with how cgi works - that is, by launching a new process for each request. Trying to write Java cg

Re: Beginner Pyserial Question

2008-01-24 Thread JAMoore84
I've solved the problem- Thanks for steering me in the right direction. The problem is that your traditional "COM1" does not exist on this computer (Thanks Grant). A trip to the Device manager listed all the COM ports on the computer. After successfully connecting to COM7 (port = serial.Serial(6)

Re: Duplicating a variable

2008-01-24 Thread Jeff McNeil
Have a look at the copy module if you have a somewhat "complex" object graph to duplicate. Remember, you're essentially just creating another reference to a singular list object with simple assignment (a = b). >>> a = [1,2,3,4, ['5a', '5b', '5c', ['6a', '6b','6c']], 7,8] >>> b = a >>> a [1, 2, 3,

Re: Duplicating a variable

2008-01-24 Thread [EMAIL PROTECTED]
On Jan 24, 9:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have run into a bit of a subtle problem. How do I go about > duplicating a variable (particularly a list of lists) in python. I > was surprised when simple assignment didn't work. For example, let y = > [1,2,3] > > >>> x = y >

Duplicating a variable

2008-01-24 Thread [EMAIL PROTECTED]
I have run into a bit of a subtle problem. How do I go about duplicating a variable (particularly a list of lists) in python. I was surprised when simple assignment didn't work. For example, let y = [1,2,3] >>> x = y >>> x[2] = 5 >>> y [1,2,5] It seems that simply assigning x to y allows furthe

Re: translating Python to Assembler

2008-01-24 Thread Torsten Bronger
Hallöchen! Carl Banks writes: > On Jan 24, 10:14 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: > >> [...] >> >> But never mind, it depends on how you define "compile" in the >> end. > > If you define "compile" as "interpret", yeah. Well, it is just-in-time-compiled command by command. :o)

Re: Beginner Pyserial Question

2008-01-24 Thread Tim Spens
COM = 0 #for COM1 BAUD = 115200 class serial_port(): def __init__(self): self.start_time = None self.end_time = None self.asleep_duration = None self.device = serial.Serial() self.device.timeout = 1 self.device.baudrate = BAUD self.devic

Re: translating Python to Assembler

2008-01-24 Thread Chris Mellon
On Jan 24, 2008 9:14 AM, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Tim Roberts wrote: > > Bjoern Schliessmann <[EMAIL PROTECTED]> > > >> So, how do processors execute Python scripts? :) > > > > Is that a rhetorical question? > > A little bit. > > > Grant is quite correct; Python scripts (in

Re: translating Python to Assembler

2008-01-24 Thread Carl Banks
On Jan 24, 10:14 am, Bjoern Schliessmann wrote: > Tim Roberts wrote: > > Grant is quite correct; Python scripts (in the canonical CPython) > > are NOT compiled into assembly language. Scripts are compiled to > > an intermediate language. Processors execute Python scripts when > > the interpreter

  1   2   >