Re: Logging exceptions to a file

2009-05-06 Thread Lawrence D'Oliveiro
In message <597627b8- d30b-4b74-9202-9cd46fb1d...@s28g2000vbp.googlegroups.com>, Pierre GM wrote: > ... I'd like to record (possibly unhandled) exceptions in the logfile. python myscript.py 2>error.log -- http://mail.python.org/mailman/listinfo/python-list

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Steven D'Aprano
On Thu, 07 May 2009 00:39:28 -0400, Terry Reedy wrote: > Functions that refer to neither the class nor an instance thereof can > usually be moved outside the class altogether. Python is not Java. I > believe staticmethod() was mainly added because it is needed for > .__new__(), at least in some

Re: problem in using sendmail in multi thread

2009-05-06 Thread gganesh
On May 6, 7:10 pm, Jean-Paul Calderone wrote: > On Tue, 5 May 2009 22:17:35 -0700 (PDT), gganesh wrote: > >On May 5, 9:25 pm, Piet van Oostrum wrote: > >> > gganesh (g) wrote: > >> >g> hi, > >> >g> I'm a beginner in using Python script > >> >g> I'm trying to send mails using multi-thread >

Re: Code works fine except...

2009-05-06 Thread John Yeung
On May 7, 12:30 am, Ross wrote: > > If I were to set up a dictionary that counted players used in the bye > list and only allowed players to be added to the bye list if they were > within 2 of the least used player, would this be a good approach for > managing bye selection or would using a dictio

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Terry Reedy
Kurt Symanzik wrote: But you might consider decorating the method as a static method instead since in your example you are not using the parameter at all. A static method would not require a parameter. @staticmethod def print_hello(): print "hello" Functions that refer to neither the

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Re: Self function

2009-05-06 Thread Terry Reedy
Steven D'Aprano wrote: I am writing a book (with Python package) on algorithms that has *lots* of recursive functions. I have also discovered that changing names can be a pain. So in the text, (but not code) I have tried the equivalent of # real_name def f(params): ... f(args) (This also

Re: Parsing text

2009-05-06 Thread C or L Smith
> Hi, > I'm trying to write a fairly basic text parser to split up scenes and > acts in plays to put them into XML. I've managed to get the text split > into the blocks of scenes and acts and returned correctly but I'm > trying to refine this and get the relevant scene number when the split > is ma

Re: Code works fine except...

2009-05-06 Thread Ross
On May 6, 3:14 pm, John Yeung wrote: > On May 6, 3:29 am, MRAB wrote: > > > I have the feeling that if the number of rounds is restricted then the > > difference between the minimum and maximum number of byes could be 2 > > because of the requirement that players shouldn't play each other more >

Logging exceptions to a file

2009-05-06 Thread Pierre GM
All, I need to log messages to both the console and a given file. I use the following code (on Python 2.5) >>> import logging >>> # >>> logging.basicConfig(level=logging.DEBUG,) >>> logfile = logging.FileHandler('log.log') >>> logfile.setLevel(level=logging.INFO) >>> logging.getLogger('').addHandl

Re: Simple way of handling errors

2009-05-06 Thread TomF
On 2009-05-06 19:41:29 -0700, Steven D'Aprano said: On Wed, 06 May 2009 16:40:19 -0700, TomF wrote: As a relative newcomer to Python, I like it a lot but I'm dismayed at the difficulty of handling simple errors. In Perl if you want to anticipate a file-not-found error you can simply do: op

Re: Could this expression parser be more 'Pythonic'?

2009-05-06 Thread John Machin
On May 7, 9:23 am, Amr wrote: > Hello all, > > I've been spending the last few weeks learning Python, and I've just > started to use it to write a simple BASIC compiler. I'm writing a > mathematical expression parser and wrote a function that would take a > string and split it into high level toke

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Kurt Symanzik
Jianchun Zhou wrote on 2009-05-07 10:49:33 AM +0800 I have a sample code as bellow: #!/usr/bin/env python class Hello: def __init__(self): print "Hello __init__" @classmethod def print_hello(self): print "hello" Hello.print_hello() If I move "self" parameter of pr

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Chris Rebert
On Wed, May 6, 2009 at 7:49 PM, Jianchun Zhou wrote: > Hi, ALL: > > I have a sample code as bellow: > > #!/usr/bin/env python > > class Hello: >     def __init__(self): >     print "Hello __init__" >     @classmethod >     def print_hello(self): >     print "hello" > > Hello.print_hello()

Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Jianchun Zhou
Hi, ALL: I have a sample code as bellow: #!/usr/bin/env python class Hello: def __init__(self): print "Hello __init__" @classmethod def print_hello(self): print "hello" Hello.print_hello() If I move "self" parameter of print_hello away, this code fragment won't work

Re: Simple way of handling errors

2009-05-06 Thread Steven D'Aprano
On Wed, 06 May 2009 16:40:19 -0700, TomF wrote: > As a relative newcomer to Python, I like it a lot but I'm dismayed at > the difficulty of handling simple errors. In Perl if you want to > anticipate a file-not-found error you can simply do: > > open($file) or die("open($file): $!"); > > and y

Re: call function of class instance with no assigned name?

2009-05-06 Thread George Oliver
On May 6, 3:07 pm, Carl Banks wrote: > I'm going to guess that you want the keyboardHandler to call method of > commandHandler. There's no reason for commandHandler to be a handler > at all then: keyboardHandler is already handling it. Thanks Carl, you've got it right and your following exampl

Re: Self function

2009-05-06 Thread Luis Alberto Zarrabeitia Gomez
Quoting Steven D'Aprano : > But regardless, everyone is missing the most important point: why are you > copying and pasting code in the first place? That is surely very close to > the top of the list of Worst Ever Anti-Patterns, and it should be avoided > whenever possible. [btw, I took this

Re: Copy & Paste in a Dos box

2009-05-06 Thread Scott David Daniels
Dave Angel wrote: Mensanator wrote: ... After which, you can dispense with the menus (except when pasting), just select the text and hit . To paste into a DOS box, once Quick Edit is enabled, use Right-Click. They keystrokes will be sent to the command editor. Note that the interpretation i

Re: list comprehension question

2009-05-06 Thread Steven D'Aprano
On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: > Emile van Sebille writes: > >> On 5/5/2009 9:15 AM J Kenneth King said... >> >>> List comprehensions can make a reader of your code apprehensive >>> because it can read like a run-on sentence and thus be difficult to >>> parse. The Pyth

Tkinter Caesar Cipher GUI (speed errors?)

2009-05-06 Thread Andrew Free
I have been told the mailing lists talk a lot about Tkinter and I have not been able to find anyone who knows the answer to this question. This is also the first time I have used the mailing lists, so hey guys :D. I decided to work on a GUI for this because I need the practice. However I

[RELEASED] Python 3.1 beta 1

2009-05-06 Thread Benjamin Peterson
On behalf of the Python development team, I'm thrilled to announce the first and only beta release of Python 3.1. Python 3.1 focuses on the stabilization and optimization of features and changes Python 3.0 introduced. For example, the new I/O system has been rewritten in C for speed. File system

Re: removing row from table. PyQT

2009-05-06 Thread MRAB
Ani wrote: I'm trying to remove the selected rows from the table, but it's not working, i've tried many ways, don't know what I'm missing. code below: [snip] def remove(self): print "removendo da tabela" #self.tableWidget.removeRow(self.tableView.selectedIndexes())

Re: hex(dummy)[2:] - issue...

2009-05-06 Thread Tim Chase
I need some advice :-) I'm using hex(dummy)[2:] to represent a color in hexadecimal format for the bgcolor in an html file. dummy is the color value in RGB of course... Now, if there's an R, G or B value of zero, this command only prints one single 0 instead of two. What's wrong with the code?

Re: Copy & Paste in a Dos box

2009-05-06 Thread Shawn Milochik
> Damn! I may just go back to using Python from the command prompt > instead of using IDLE. > > On second thought, IDLE is way too useful for indenting, dedenting, > commenting and uncommenting blocks of code. Can't go back to using > Notepad. > You might want to check out iPython, then -- it's

Re: Self function

2009-05-06 Thread Steven D'Aprano
On Thu, 07 May 2009 01:59:02 +0100, Rhodri James wrote: > On Wed, 06 May 2009 23:33:20 +0100, Luis Alberto Zarrabeitia Gomez > wrote: > >> Quoting Rhodri James : >>> So the answer to my question would be "nothing"? >> >> Indeed, there is nothing broken with the search and replace feature of >> h

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Christian Heimes
Steven D'Aprano wrote: > Are you saying that Intrepid uses Python3.0 as it's default Python? > > If not, then just use the default Python installed. Possibly Python 2.5. > The differences between 2.5 and 2.6 are minor. Ubuntu 9.04 has Python 2.6.2 as default Python interpreter. It's also shipped

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Steven D'Aprano
On Wed, 06 May 2009 18:25:48 -0400, Evan Kroske wrote: > I'm planning on learning Python, and I'd like to know which version to > start with. I know that Python 3.0 isn't ready for production and it > doesn't have enough libraries yet, so I thought I should learn Python > 2.6. Unfortunately, insta

Re: Self function

2009-05-06 Thread Rhodri James
On Wed, 06 May 2009 23:33:20 +0100, Luis Alberto Zarrabeitia Gomez wrote: Quoting Rhodri James : So the answer to my question would be "nothing"? Indeed, there is nothing broken with the search and replace feature of his editor. When he is copying a non-recursive function, it is _useles

Re: Copy & Paste in a Dos box

2009-05-06 Thread Dave Angel
Mensanator wrote: On May 6, 6:15 pm, MRAB wrote: Mensanator wrote: On May 6, 3:46 pm, Dave Angel wrote: Mensanator wrote: And when prompted, do "(.) modify shortcut that started this window" After which, you can dispense with the menus (except when pasting), just se

Re: Threading and GIL

2009-05-06 Thread Carl Banks
On May 6, 5:13 pm, googler.1.webmas...@spamgourmet.com wrote: > Hi! > > I have a big problem I can't solve and I hope anyone of you can help > me. I use the Python C API and in C++ I have a class which represets a > thread object, similiar to the thread class of the known Python Thread > class but

[ANN] BPT (Boxed Package Tool) 0.3

2009-05-06 Thread Giuseppe Ottaviano
Hi all, I am happy to announce BPT 0.3 http://pypi.python.org/pypi/bpt This release solves some important bugs, and the documentation has less TODOs. Version 0.3 === - Improved documentation - Fixed a bug that prevented the ``env`` script to be ``source``\'d (Works only with bash

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Christian Heimes
Evan Kroske schrieb: > I'm planning on learning Python, and I'd like to know which version to > start with. I know that Python 3.0 isn't ready for production and it > doesn't have enough libraries yet, so I thought I should learn Python > 2.6. Unfortunately, installing Python 2.6 on my Linux distro

Re: Copy & Paste in a Dos box

2009-05-06 Thread Dave Angel
norseman wrote: On a straight box - that doesn't work either. The select all does, but paste yanked something from hours ago. Once you have Quick Edit enabled, paste will work using right-click. If it got something from hours ago, then that must be the last time you copied anything to the r

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Dave Angel
Mensanator wrote: On May 6, 3:46 pm, Dave Angel wrote: Mensanator wrote: And when prompted, do "(.) modify shortcut that started this window" After which, you can dispense with the menus (except when pasting), just select the text and hit . To paste into a DOS bo

Threading and GIL

2009-05-06 Thread googler . 1 . webmaster
Hi! I have a big problem I can't solve and I hope anyone of you can help me. I use the Python C API and in C++ I have a class which represets a thread object, similiar to the thread class of the known Python Thread class but with some needed additions so thats the reason why I have to built my own

Re: How do I escape slashes the string formatting operator? (or: why is it behaving this way?)

2009-05-06 Thread Dustan
On May 6, 6:51 pm, marek.ro...@wp.pl wrote: > Dustan napisa³(a): > > > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit > > (Intel)] on > > win32 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> 'HELP!%(xyz)/' % {'xyz':' PLEASE! '} > > Traceback

Re: How do I escape slashes the string formatting operator? (or: why is it behaving this way?)

2009-05-06 Thread marek . rocki
Dustan napisał(a): > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> 'HELP!%(xyz)/' % {'xyz':' PLEASE! '} > Traceback (most recent call last): > File "", line 1, in > ValueError

How do I escape slashes the string formatting operator? (or: why is it behaving this way?)

2009-05-06 Thread Dustan
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 'HELP!%(xyz)/' % {'xyz':' PLEASE! '} Traceback (most recent call last): File "", line 1, in ValueError: unsupported format character '/

Simple way of handling errors

2009-05-06 Thread TomF
As a relative newcomer to Python, I like it a lot but I'm dismayed at the difficulty of handling simple errors. In Perl if you want to anticipate a file-not-found error you can simply do: open($file) or die("open($file): $!"); and you get an intelligible error message. In Python, to get the

Re: Copy & Paste in a Dos box

2009-05-06 Thread Mensanator
On May 6, 6:15 pm, MRAB wrote: > Mensanator wrote: > > On May 6, 3:46 pm, Dave Angel wrote: > >> Mensanator wrote: > >>> > >>> And when prompted, do "(.) modify shortcut that started this window" > >>> After which, you can dispense with the menus (except when pasting), > >>> just select the text

Re: Copy & Paste in a Dos box

2009-05-06 Thread norseman
Dave Angel wrote: Tim Chase wrote: > for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and selections are blockwise rectangula

Could this expression parser be more 'Pythonic'?

2009-05-06 Thread Amr
Hello all, I've been spending the last few weeks learning Python, and I've just started to use it to write a simple BASIC compiler. I'm writing a mathematical expression parser and wrote a function that would take a string and split it into high level tokens. The code can be found at http://paste

Re: Copy & Paste in a Dos box

2009-05-06 Thread MRAB
Mensanator wrote: On May 6, 3:46 pm, Dave Angel wrote: Mensanator wrote: And when prompted, do "(.) modify shortcut that started this window" After which, you can dispense with the menus (except when pasting), just select the text and hit . To paste into a DOS box, once Quick Edit is enabled,

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-06 Thread Martin P. Hellwig
Jelle Smet wrote: Hi list, My goals is to have concurrent and separated client sessions using xmlrpc. Initially my though was that SimpleXMLRPCServer was able to create a new object instance for each incoming request. But this doesn't appear to be the case, unless I'm overlooking something, if s

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Gary Herron
Evan Kroske wrote: I'm planning on learning Python, and I'd like to know which version to start with. I know that Python 3.0 isn't ready for production and it doesn't have enough libraries yet, so I thought I should learn Python 2.6. Unfortunately, installing Python 2.6 on my Linux distro (Ubun

Re: Copy & Paste in a Dos box

2009-05-06 Thread norseman
Mensanator wrote: On May 6, 12:54 pm, Tim Chase wrote: for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and selections are block

Re: About ODFPY links

2009-05-06 Thread Terry Reedy
shruti surve wrote: hey all, For my project, i am using ODFpy open office spreadsheets. I am creating ledgers in python ie.ledger.py . So when i run ledger.py, spreadsheet will be opened in open office. since ledger is made of number of accounts, i am creating multiple t

Re: Copy & Paste in a Dos box

2009-05-06 Thread norseman
Shawn Milochik wrote: On Wed, May 6, 2009 at 1:54 PM, Tim Chase wrote: for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and sele

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Terry Reedy
Evan Kroske wrote: I'm planning on learning Python, and I'd like to know which version to start with. I know that Python 3.0 isn't ready for production and it 3.1 will be. The first beta will be out very soon and 3.1 in less than 2 months. doesn't have enough libraries yet, That will tak

Re: Self function

2009-05-06 Thread Luis Alberto Zarrabeitia Gomez
Quoting Rhodri James : > >> I'm sorry, but while I'm mildly positive towards the proposal (and more > >> so towards Aaron's decorator), I don't buy this argument at all. What > >> is broken about your editor's global search-and-replace function that > >> makes it "usually useless" for making the

removing row from table. PyQT

2009-05-06 Thread Ani
I'm trying to remove the selected rows from the table, but it's not working, i've tried many ways, don't know what I'm missing. code below: class MonitorUi(QWidget): def __init__(self,parent = None): QWidget.__init__(self,parent) self._initalTable = [["none","none","none"],

Python 2.6 worth the hassle?

2009-05-06 Thread Evan Kroske
I'm planning on learning Python, and I'd like to know which version to start with. I know that Python 3.0 isn't ready for production and it doesn't have enough libraries yet, so I thought I should learn Python 2.6. Unfortunately, installing Python 2.6 on my Linux distro (Ubuntu Intrepid Ibex) h

Re: Code works fine except...

2009-05-06 Thread John Yeung
On May 6, 3:29 am, MRAB wrote: > I have the feeling that if the number of rounds is restricted then the > difference between the minimum and maximum number of byes could be 2 > because of the requirement that players shouldn't play each other more > than once, meaning that the players have to be

Re: call function of class instance with no assigned name?

2009-05-06 Thread Carl Banks
On May 5, 12:17 pm, George Oliver wrote: > A handler would be something like a key input handler. The key input > handler is defined separately from the command handler in the case I > want to use a different method of input, for example a mouse or > joystick. > > In the dictionary of key inputs I

SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-06 Thread Jelle Smet
Hi list, My goals is to have concurrent and separated client sessions using xmlrpc. Initially my though was that SimpleXMLRPCServer was able to create a new object instance for each incoming request. But this doesn't appear to be the case, unless I'm overlooking something, if so please point me ou

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Mensanator
On May 6, 3:46 pm, Dave Angel wrote: > Mensanator wrote: > > > > > And when prompted, do "(.) modify shortcut that started this window" > > > After which, you can dispense with the menus (except when pasting), > > just select the text and hit . > > To paste into a DOS box, once Quick Edit is enab

Re: call function of class instance with no assigned name?

2009-05-06 Thread Carl Banks
On May 5, 7:55 pm, Dave Angel wrote: > George Oliver wrote: > > On May 5, 11:59 am, Dave Angel wrote: > > >> 1) forget about getattr() unless you have hundreds of methods in your > >> map.  The real question is why you need two maps. What good is the > >> "command string" doing you?   Why not jus

SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-06 Thread J
Hi list, My goals is to have concurrent and separated client sessions using xmlrpc. Initially my though was that SimpleXMLRPCServer was able to create a new object instance for each incoming request. But this doesn't appear to be the case, unless I'm overlooking something, if so please point me ou

Re: fcntl and siginfo_t in python

2009-05-06 Thread ma
Sure, I'll send you the source files when I get a chance! --Sent from my iPhone On May 6, 2009, at 4:03 PM, Philip wrote: ma gmail.com> writes: Ok! So, I decided to write a C-extension instead of using ctypes... This works beautifully. Now, I want to release this to the public, so I'm thi

Re: Self function

2009-05-06 Thread Rhodri James
On Wed, 06 May 2009 04:59:59 +0100, Gabriel Genellina wrote: En Tue, 05 May 2009 22:35:08 -0300, Rhodri James escribió: On Tue, 05 May 2009 21:43:16 +0100, wrote: wolfram.hinde...: It is easy to change all references of the function name, except for those in the function body itself?

Re: Parsing text

2009-05-06 Thread Rhodri James
On Wed, 06 May 2009 19:32:28 +0100, iainemsley wrote: Hi, I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and ge

Re: list comprehension question

2009-05-06 Thread Emile van Sebille
On 5/6/2009 6:48 AM J Kenneth King said... Emile van Sebille writes: On 5/5/2009 9:15 AM J Kenneth King said... The Python documentation discourages their use and I believe for good reason. Can you provide a link for this? I'd like to see specifically what's being discouraged, as I'd be sur

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Dave Angel
Mensanator wrote: And when prompted, do "(.) modify shortcut that started this window" After which, you can dispense with the menus (except when pasting), just select the text and hit . To paste into a DOS box, once Quick Edit is enabled, use Right-Click. They keystrokes will be sent t

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Dave Angel
Tim Chase wrote: > for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and selections are blockwise rectangular rather than line

Re: Completion of The Python Papers Volume 4 Issue 1

2009-05-06 Thread Maurice Ling
My apologies. It should be Volume 4 Issue 1 instead of Issue 4 Volume 1. Thank you Scott for pointing this out. Regards Maurice On May 6, 10:08 pm, "mauricel...@acm.org" wrote: > Welcome to Issue 4 Volume 1 of The Python Papers. This marks our 4th > year in business. It is my pleasure to annou

[ANN] Completion of The Python Papers Volume 4 Issue 1

2009-05-06 Thread mauricel...@acm.org
Welcome to Issue 4 Volume 1 of The Python Papers. This marks our 4th year in business. It is my pleasure to announce 4 improvements made to The Python Papers Anthology. Firstly, we had created a class of editorial members in our team – the Editorial Reviewers (ER). This is in addition to the exist

Re: list comprehension question

2009-05-06 Thread Roel Schroeven
John Yeung schreef: > Essentially, if you see [B A] over and over and over again, when > finally confronted with LCs of more "elements", it's not immediately > clear that the pattern of increasing nestedness is > > [B A] => [C A B] => [D A B C] => etc. > > rather than > > [B A] => [C B A] =>

Re: list comprehension question

2009-05-06 Thread J Kenneth King
Emile van Sebille writes: > On 5/5/2009 9:15 AM J Kenneth King said... > >> List comprehensions can make a reader of your code apprehensive >> because it can read like a run-on sentence and thus be difficult to >> parse. The Python documentation discourages their use and I believe >> for good rea

Re: list comprehension question

2009-05-06 Thread John Yeung
On May 5, 11:36 pm, alex23 wrote: > Apart from the presence of 'item' at the beginning of the > list comprehension as opposed to 'b.append(item)' at the > end of the for-loop, how exactly does the listcomp force > you to "bounce [..] back and forth" to follow the logic? It's precisely the fact t

Re: Code works fine except...

2009-05-06 Thread John Yeung
On May 5, 10:49 am, Ross wrote: > I'm interested to see what you did. From your description, > it sounds like I've tried what you've done, but when I > implemented my version, it took minutes to evaluate for > bigger numbers. If that isn't the case with yours, I'd be > interested in seeing your im

About ODFPY links

2009-05-06 Thread shruti surve
hey all, For my project, i am using ODFpy open office spreadsheets. I am creating ledgers in python ie.ledger.py. So when i run ledger.py, spreadsheet will be opened in open office. since ledger is made of number of accounts, i am creating multiple tables for all accounts in single spreadsheet. S

SQLObject 0.9.10

2009-05-06 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.10, a minor bugfix release of 0.9 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy

SQLObject 0.10.5

2009-05-06 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.5, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Mensanator
On May 6, 12:54 pm, Tim Chase wrote: > > for windows this works: > > (can't cut and paste from a dos box!###%*&!!!) > > Depending on how it was spawned, you can either right-click in > the window and choose Mark/Paste (when marking, use to > terminate the selection; and selections are blockwise r

Re: fcntl and siginfo_t in python

2009-05-06 Thread Philip
ma gmail.com> writes: > > Ok! So, I decided to write a C-extension instead of using ctypes... > > This works beautifully. Now, I want to release this to the public, so > I'm thinking of making a bit of code cleanup. Should I just pack the > entire siginfo_t struct, right now I just use the fd, i

Re: Separate Windows versions of Python

2009-05-06 Thread Terry Reedy
Scott David Daniels wrote: On windows, major versions (..., 2.5, 2.6, 2.7, , 3.0, 3.1, ...) can coexist quite successfully. Find and run an installer for the latest version of 2.5 (2.5.4, I believe) on the Python download page. That will make 2.5 your default Python. believe the insta

Re: Parsing text

2009-05-06 Thread Stefan Behnel
iainemsley wrote: > for scene in text.split('Scene'): > num = re.compile("^\s\[0-9, i{1,4}, v]", re.I) > textNum = num.match(scene) Not related to your problem, but to your code - I'd write this as follows: match_scene_num = re.compile("^\s\[0-9, i{1,4}, v]", re.I).match

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Grant Edwards
On 2009-05-06, Shawn Milochik wrote: >>> That way, you can basically use PuTTY to shell into your >>> Windows box. >> >> Better yet, set up sshd in your Cygwin install, and then use >> whatever terminal you normally use on your Linux/MacOS box to >> ssh into the Cygwin box. ??When run that way, w

Re: Parsing text

2009-05-06 Thread Tim Chase
I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and get the relevant scene number when the split is made but I keep g

Re: Parsing text

2009-05-06 Thread MRAB
iainemsley wrote: Hi, I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and get the relevant scene number when the spl

Re: Parsing text

2009-05-06 Thread Scott David Daniels
iainemsley wrote: Hi, I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and get the relevant scene number when the spl

Re: Parsing text

2009-05-06 Thread Shawn Milochik
On Wed, May 6, 2009 at 2:32 PM, iainemsley wrote: > Hi, > I'm trying to write a fairly basic text parser to split up scenes and > acts in plays to put them into XML. I've managed to get the text split > into the blocks of scenes and acts and returned correctly but I'm > trying to refine this and g

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Shawn Milochik
On Wed, May 6, 2009 at 2:39 PM, Grant Edwards wrote: > On 2009-05-06, Shawn Milochik wrote: > >> I know I'm coming to the conversation late, but here's what I do*: >> >> 1. Use Cygwin. (http://www.cygwin.com/) >> 2. Use PuttyCYG (http://code.google.com/p/puttycyg/) >> >> That way, you can basical

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Grant Edwards
On 2009-05-06, Shawn Milochik wrote: > I know I'm coming to the conversation late, but here's what I do*: > > 1. Use Cygwin. (http://www.cygwin.com/) > 2. Use PuttyCYG (http://code.google.com/p/puttycyg/) > > That way, you can basically use PuTTY to shell into your > Windows box. Better yet, set

Parsing text

2009-05-06 Thread iainemsley
Hi, I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and get the relevant scene number when the split is made but I kee

Re: Iphone Going 3G!

2009-05-06 Thread stermen
Notebooks stocks priced http://rover.ebay.com/rover/1/711-53200-19255-0/1?type=3&campid=5336229480&toolid=10001&customid=&ext=notebook&satitle=notebook "Shafiq" ha scritto nel messaggio news:4908115...@news.tm.net.my... apalah kau ni tak belajar ke bahasa menunjukkan bangsa "news.tm

Re: hex(dummy)[2:] - issue...

2009-05-06 Thread MRAB
Florian Wollenschein wrote: Hi there, I need some advice :-) I'm using hex(dummy)[2:] to represent a color in hexadecimal format for the bgcolor in an html file. dummy is the color value in RGB of course... Now, if there's an R, G or B value of zero, this command only prints one single 0 ins

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Shawn Milochik
On Wed, May 6, 2009 at 1:54 PM, Tim Chase wrote: >> for windows this works: >> (can't cut and paste from a dos box!###%*&!!!) > > Depending on how it was spawned, you can either right-click in the window > and choose Mark/Paste (when marking, use to terminate the selection; > and selections are b

IIR filter conversion routines for Python?

2009-05-06 Thread wzab
Hi, I'm looking for procedures converting the IIR filters into cascade and/ or parallel forms. Something like dir2cas.m or dir2par.m known in the Matlab/Octave world. Unfortunately SciPy does not contain such functions. If they are not available, I would be grateful for any hints helping me to impl

hex(dummy)[2:] - issue...

2009-05-06 Thread Florian Wollenschein
Hi there, I need some advice :-) I'm using hex(dummy)[2:] to represent a color in hexadecimal format for the bgcolor in an html file. dummy is the color value in RGB of course... Now, if there's an R, G or B value of zero, this command only prints one single 0 instead of two. What's wrong wit

Re: Pyhton script to call another program

2009-05-06 Thread David
Il Wed, 06 May 2009 11:31:58 -0400, Ben Keshet ha scritto: > Hi, > > I am trying to write a simple python script to manipulate files and call > other programs. I have a program installed (rocs) which I run using > cygwin on my XP (but is not in python). Can I run the pyhton script and > then

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Tim Chase
for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and selections are blockwise rectangular rather than linewise or characterwise

Re: Pyhton script to call another program

2009-05-06 Thread norseman
and yes - contrary to manual, the program MUST be there TWICE (complete with any path needed). for windows this works: (can't cut and paste from a dos box!###%*&!!!) Python 2.5.1 ... on win32 >>> import os >>> result = os.spawnl( os.P_WAIT, "d:\\winmcad\\mca

Re: pyinstaller and logging

2009-05-06 Thread Mike
On 6 Mai, 18:14, Vinay Sajip wrote: > On May 6, 2:41 pm, Mike wrote: > > > > > Pyinstaller seems to have a problem withlogging... > > >  I installed pyinstaller 1.3 - using it together with Python 2.6. I > > used pyinstaller for a small project, the created .exe worked fine. > > After some additi

Re: Problem with case insensitive volumes

2009-05-06 Thread spillz
On May 5, 10:24 pm, "Gabriel Genellina" wrote: > I use this function on Windows to obtain the true case name of a file: very nice. I think the python bindings to the gnome GIO library *might* provide what I need on the linux side. -- http://mail.python.org/mailman/listinfo/python-list

Re: Separate Windows versions of Python

2009-05-06 Thread OldGrantonian
Many thanks for the very detailed answer :) I will go ahead right now and implement all your suggestions. On May 6, 4:35 pm, Scott David Daniels wrote: > OldGrantonian wrote: > > I use Windows Vista Home Premium. I have Python 2.6 currently > > installed. I'm not a techy. > > > I want to use

Re: thc v0.3 - txt to html converter - better code?

2009-05-06 Thread Florian Wollenschein
Richard Brodie wrote: "Stefan Behnel" wrote in message news:4a008996$0$31862$9b4e6...@newsspool3.arcor-online.net... language_map = {'English': 'EN', 'Deutsch': 'DE'} strict_or_transitional = {True: 'Transitional', False: 'Strict'} # this will raise a KeyError for unknown languages

Re: pyinstaller and logging

2009-05-06 Thread Vinay Sajip
On May 6, 2:41 pm, Mike wrote: > Pyinstaller seems to have a problem withlogging... > > I installed pyinstaller 1.3 - using it together with Python 2.6. I > used pyinstaller for a small project, the created .exe worked fine. > After some additional changes to my project I got strange run time > e

  1   2   >