[RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Benjamin Peterson
On behalf of the Python development team, I'm gleeful to announce the second alpha release of Python 2.7. Python 2.7 is scheduled to be the last major version in the 2.x series. It includes many features that were first released in Python 3.1. The faster io module, the new nested with statement

Append to an Excel file

2010-01-09 Thread pp
Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved previously. Thanks, PP -- http://mail.python.org/mailman/listinfo/python-list

Re: Append to an Excel file

2010-01-09 Thread Jason Scheirer
On Jan 9, 12:30 am, pp parul.pande...@gmail.com wrote: Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved previously. Thanks, PP http://pypi.python.org/pypi/xlwt -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarifications on compiling for Windows

2010-01-09 Thread Jason Scheirer
On Jan 7, 10:51 pm, Mensanator mensana...@aol.com wrote: On Jan 8, 12:19 am, peteshinners p...@shinners.org wrote: My presentation for Pycon is coming together, but I need to make sure my information about compiling Python and Python extensions for Windows is correct. I'm really only

Re: Append to an Excel file

2010-01-09 Thread pp
On Jan 9, 1:47 am, Jason Scheirer jason.schei...@gmail.com wrote: On Jan 9, 12:30 am, pp parul.pande...@gmail.com wrote: Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved previously. Thanks, PP

Link to module Stack

2010-01-09 Thread kzagradskiy
Link to module Stack: http://groups.google.com/group/comp.lang.python/browse_thread/thread/e6a0668bb2be9a8e/64cb44a120baeca2?lnk=gstq=stack+module#64cb44a120baeca2 Here's the stack module for py4th. nick ---cut here #!/usr/Util/bin/python # # @(#)stack.py 1.1 # #

Re: C Module's '1.#INF' changes to 'inf' at Python

2010-01-09 Thread Mark Dickinson
On Jan 8, 3:36 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-01-08 07:48 AM, CELEN Erman wrote: My problem is that I’ve noticed a strange behavior in Python while handling FPEs on Windows after switching compilers (msvc8 to msvc9) and I am trying to find out how Python handles INF

Re: Link to module Stack

2010-01-09 Thread Steven D'Aprano
On Sat, 09 Jan 2010 01:07:39 -0800, kzagradskiy wrote: class Stack: def __init__(self): self.__heap = [] A heap has a technical meaning in programming. To describe the internals of a stack as heap will be disconcerting and confusing to anyone who knows about stacks and heaps.

Re: lightweight encryption of text file

2010-01-09 Thread Anthra Norell
Daniel Fetchinson wrote: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text

Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread pp
Whenever i run the code below I get the following error: AttributeError: 'Book' object has no attribute 'on_demand' WARNING: Failure executing file: copy.py Why is it so?? from xlrd import open_workbook from xlwt import easyxf from xlutils.copy import copy rb =

Re: Clarifications on compiling for Windows

2010-01-09 Thread Martin v. Loewis
First of all, is the Windows FAQ fairly up to date? Fairly, yes. Should people be referring to section 6 if they are going to build an application with an embedded Python interpreter? I think that's very selective in its view of problems - why would I be using SWIG, for example? (yet there

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text file while not possessing

Re: table from csv file

2010-01-09 Thread Jon Clements
On Jan 8, 8:31 pm, J dreadpiratej...@gmail.com wrote: On Fri, Jan 8, 2010 at 13:55, Jon Clements jon...@googlemail.com wrote: On Jan 8, 5:59 pm, marlowe marlowequ...@hotmail.com wrote: I am trying to create a table in python from a csv file where I input which columns I would like to see,

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread Jon Clements
On Jan 9, 10:24 am, pp parul.pande...@gmail.com wrote: Whenever i run the code below I get the following error: AttributeError: 'Book' object has no attribute 'on_demand' WARNING: Failure executing file: copy.py Why is it so?? from xlrd import open_workbook from xlwt import easyxf from

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread pp
On Jan 9, 3:42 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:24 am, pp parul.pande...@gmail.com wrote: Whenever i run the code below I get the following error: AttributeError: 'Book' object has no attribute 'on_demand' WARNING: Failure executing file: copy.py Why is it

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
On 1/9/10, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text file while not

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread Jon Clements
On Jan 9, 10:44 am, pp parul.pande...@gmail.com wrote: On Jan 9, 3:42 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:24 am, pp parul.pande...@gmail.com wrote: Whenever i run the code below I get the following error: AttributeError: 'Book' object has no attribute

Re: Link to module Stack

2010-01-09 Thread Dave Angel
Steven D'Aprano wrote: On Sat, 09 Jan 2010 01:07:39 -0800, kzagradskiy wrote: class Stack: def __init__(self): self.__heap = [] A heap has a technical meaning in programming. To describe the internals of a stack as heap will be disconcerting and confusing to anyone who

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread pp
On Jan 9, 3:52 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:44 am, pp parul.pande...@gmail.com wrote: On Jan 9, 3:42 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:24 am, pp parul.pande...@gmail.com wrote: Whenever i run the code below I get the following

Re: lightweight encryption of text file

2010-01-09 Thread Dave Angel
Anthra Norell wrote: div class=moz-text-flowed style=font-family: -moz-fixedDaniel Fetchinson wrote: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that

How to get many places of pi from Machin's Equation?

2010-01-09 Thread Richard D. Moores
Machin's Equation is 4 arctan (1/5) - arctan(1/239) = pi/4 Using Python 3.1 and the math module: from math import atan, pi pi 3.141592653589793 (4*atan(.2) - atan(1/239))*4 3.1415926535897936 (4*atan(.2) - atan(1/239))*4 == pi False abs((4*atan(.2) - atan(1/239))*4) - pi

Re: Link to module Stack

2010-01-09 Thread Duncan Booth
Dave Angel da...@ieee.org wrote: or even better, without the extra local var: def pop (self): if len(self.__heap) == 0: raise InnerInterpreterError, stack underflow return self.__heap.pop(1) pop(1)? Anyway if would be simpler and almost certainly faster to

Re: Accessing python from a network share in windows 7

2010-01-09 Thread Anssi Saari
aj mailtome200420032...@gmail.com writes: I access python from a network share. This works fine on XP but on windows 7 it throws the following error: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: Standardized interpreter speed evaluation tool

2010-01-09 Thread Steve Holden
Chris Rebert wrote: On Fri, Jan 8, 2010 at 2:25 AM, alexru tara...@gmail.com wrote: Is there any standardized interpreter speed evaluation tool? Say I made few changes in interpreter code and want to know if those changes made python any better, which test should I use? Although apparently

Re: lightweight encryption of text file

2010-01-09 Thread Arnaud Delobelle
Daniel Fetchinson fetchin...@googlemail.com writes: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it

Re: Append to an Excel file

2010-01-09 Thread Steve Holden
pp wrote: On Jan 9, 1:47 am, Jason Scheirer jason.schei...@gmail.com wrote: On Jan 9, 12:30 am, pp parul.pande...@gmail.com wrote: Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved previously. Thanks, PP

Re: creating tar file and streaming it over HTTP?

2010-01-09 Thread pbienst
OK, thanks to the feedback from everyone I got the PUT from a client to the WSGI server working. I'm now trying to go the other way around: use a tar stream in one of the functions in the WSGI server in order to send files to the client. Problem is that the WSGI specs expects an iterator as

Something More Elegant

2010-01-09 Thread Victor Subervi
Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for itm in cursor]

Re: Something More Elegant

2010-01-09 Thread Iuri
Your code select some ids from database and list distinct ids in packageIDs. You can use SELECT DISTINCT in your SQL statement. On Sat, Jan 9, 2010 at 11:23 AM, Victor Subervi victorsube...@gmail.comwrote: Hi; The following code works fine. I would like you to suggest something more simple

Re: Something More Elegant

2010-01-09 Thread Tim Chase
Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.comwrote: Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where

Re: Another Screwy Problem

2010-01-09 Thread J. Cliff Dyer
On Sat, 2010-01-09 at 07:59 -0500, Victor Subervi wrote: On Fri, Jan 8, 2010 at 4:44 PM, J. Clifford Dyer j...@sdf.lonestar.org wrote: Victor Subervi wrote: Hi; I have this line of code: sql = 'select Name, Price from %sPackages where ID=%s;' %

Re: Another Screwy Problem

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 9:07 AM, J. Cliff Dyer j...@sdf.lonestar.org wrote: On Sat, 2010-01-09 at 07:59 -0500, Victor Subervi wrote: On Fri, Jan 8, 2010 at 4:44 PM, J. Clifford Dyer j...@sdf.lonestar.org wrote: Victor Subervi wrote: Hi; I have this line of

Re: How to get many places of pi from Machin's Equation?

2010-01-09 Thread John Machin
On Jan 9, 10:31 pm, Richard D. Moores rdmoo...@gmail.com wrote: Machin's Equation is 4 arctan (1/5) - arctan(1/239) = pi/4 Using Python 3.1 and the math module: from math import atan, pi pi 3.141592653589793 (4*atan(.2) - atan(1/239))*4 3.1415926535897936 (4*atan(.2) -

Re: Something More Elegant

2010-01-09 Thread Steve Holden
Victor Subervi wrote: On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.com mailto:python.l...@tim.thechases.com wrote: Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and

Re: How to get many places of pi from Machin's Equation?

2010-01-09 Thread Gabriel Genellina
En Sat, 09 Jan 2010 08:31:49 -0300, Richard D. Moores rdmoo...@gmail.com escribió: Is there a way in Python 3.1 to calculate pi to greater accuracy using Machin's Equation? Even to an arbitrary number of places? You may be interested in Demo/scripts/pi.py in the source distribution. It

Re: Something More Elegant

2010-01-09 Thread Gabriel Genellina
En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi victorsube...@gmail.com escribió: On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.comwrote: It would also help if you didn't pass the categoryID as a string-formatted value, but as a proper parameter, something like

Re: restructuredText editor ?

2010-01-09 Thread Peter
On 01/09/2010 03:32 AM, Florian Diesch wrote: Petervm...@mycircuit.org writes: What editor do people out there use to edit .rst files for sphinx-python documentation ? Emacs with ReST mode and YASnippet Florian Great, works very well and thanks for mentionning YASnippets

Re: Something More Elegant

2010-01-09 Thread Iuri
And you should use cursor.fetchall() instead of cursor in list comprehension: packageIDs = [itm[0] for itm in cursor.fetchall()] On Sat, Jan 9, 2010 at 1:01 PM, Gabriel Genellina gagsl-...@yahoo.com.arwrote: En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi victorsube...@gmail.com escribió:

Microsoft Office Word and Python (Win XP)

2010-01-09 Thread 3lvss0...@gmail.com
Hi. Im very new with python. I have got some answer on my issue to use interop or COM ''plugins'' to access MS Word through python but i don't even know what those two ''plugins'' are so I cannot use them. What I want to do is the following: I need the script that moves (only moves, not change or

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden st...@holdenweb.com wrote: But we are now in the realm of theory as far as you are concerned, since you have already stated several times that you aren't interested in correcting your design until after you have got the current mess into

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread John Machin
On Jan 9, 9:56 pm, pp parul.pande...@gmail.com wrote: On Jan 9, 3:52 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:44 am, pp parul.pande...@gmail.com wrote: On Jan 9, 3:42 am, Jon Clements jon...@googlemail.com wrote: On Jan 9, 10:24 am, pp parul.pande...@gmail.com

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 10:14 AM, Iuri iurisil...@gmail.com wrote: And you should use cursor.fetchall() instead of cursor in list comprehension: packageIDs = [itm[0] for itm in cursor.fetchall()] Now, someone else on this list told me the other. Can you explain the difference? TIA, beno --

Re: How to get many places of pi from Machin's Equation?

2010-01-09 Thread Mark Dickinson
On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote: Is there a way in Python 3.1 to calculate pi to greater accuracy using Machin's Equation? Even to an arbitrary number of places? There's no arbitrary-precision version of atan included with Python. You could write your own (e.g.,

Re: Scripting (was Re: Python books, literature etc)

2010-01-09 Thread McColgst
Just to kind of get back on topic: Before buying a book or making a terribly large investment, OP should consider the fact that Python 3 is out and gaining some popularity. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get many places of pi from Machin's Equation?

2010-01-09 Thread Mark Dickinson
On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote: Machin's Equation is 4 arctan (1/5) - arctan(1/239) = pi/4 [...] Is there a way in Python 3.1 to calculate pi to greater accuracy using Machin's Equation? Even to an arbitrary number of places? Here's some crude code (no error

Easy Q

2010-01-09 Thread Victor Subervi
Hi; I have a string.join statement on a variable that comes from a cgi.FieldStorage().getlist. The variable may be a list or a single value. I need to treat it differently depending on which it is. How can I distinguish it? len(var) will obviously give me the length of the string if it's a string

Re: Link to module Stack

2010-01-09 Thread Steven D'Aprano
On Sat, 09 Jan 2010 05:56:36 -0500, Dave Angel wrote: InnerInterpreterError is the most inappropriate exception name I've ever seen. It has nothing to do with the interpreter, it's a stack error. It has everything to do with the (Forth) interpreter. Exceptions can readily be named

Re: How to get many places of pi from Machin's Equation?

2010-01-09 Thread Richard D. Moores
On Sat, Jan 9, 2010 at 07:57, Mark Dickinson dicki...@gmail.com wrote: On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote: Machin's Equation is 4 arctan (1/5) - arctan(1/239) = pi/4 [...] Is there a way in Python 3.1 to calculate pi to greater accuracy using Machin's Equation?

Re: table from csv file

2010-01-09 Thread J
On Sat, Jan 9, 2010 at 05:26, Jon Clements jon...@googlemail.com wrote: reader = open('C:/test.txt','rb') data = csv.DictReader(reader,restval='000',restkey='Misc') [snip] DictReader works, but what use to bug me was the fact you couldn't then output the cols in the 'correct' order

Re: Easy Q

2010-01-09 Thread MRAB
Victor Subervi wrote: Hi; I have a string.join statement on a variable that comes from a cgi.FieldStorage().getlist. The variable may be a list or a single value. I need to treat it differently depending on which it is. How can I distinguish it? len(var) will obviously give me the length of

Re: Easy Q

2010-01-09 Thread Gary Herron
Victor Subervi wrote: Hi; I have a string.join statement on a variable that comes from a cgi.FieldStorage().getlist. The variable may be a list or a single value. I need to treat it differently depending on which it is. How can I distinguish it? len(var) will obviously give me the length of

[RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Benjamin Peterson
On behalf of the Python development team, I'm gleeful to announce the second alpha release of Python 2.7. Python 2.7 is scheduled to be the last major version in the 2.x series. It includes many features that were first released in Python 3.1. The faster io module, the new nested with statement

Direct use of bytearray buffers with ctypes ?

2010-01-09 Thread Pakal
Hello I'm having big trouble wrapping the win32 ReadFile() function with ctypes. I wanted to allow the user to give a bytearray to this function, so that the writable buffer of this bytearray is directly used to receive the data from the file ; thus, no temporary copy in a separate ctype buffer

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread Marco Nawijn
On Jan 9, 4:12 pm, 3lvss0...@gmail.com 3lvss0...@gmail.com wrote: Hi. Im very new with python. I have got some answer on my issue to use interop or COM ''plugins'' to access MS Word through python but i don't even know what those two ''plugins'' are so I cannot use them. What I want to do is

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread Terry Reedy
On 1/9/2010 10:12 AM, 3lvss0...@gmail.com wrote: I need the script that moves (only moves, not change or delete!) entire (100% of the text) text from one .doc file to another. If you want to copy files without modification, use the OS copy command. You can use the subprocess module to do

Re: Easy Q

2010-01-09 Thread Dave Angel
Victor Subervi wrote: Hi; I have a string.join statement on a variable that comes from a cgi.FieldStorage().getlist. The variable may be a list or a single value. I need to treat it differently depending on which it is. How can I distinguish it? len(var) will obviously give me the length of the

interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-09 Thread Dave WB3DWE
On Jan 6 I inquired how to fix the 3.1.1 interactive terminal in Ubuntu Linux. Left arrow yields ^[[D , etc. casevh helped by suggesting libreadline5-dev be installed. Did so with Synaptic Package Manager. The behavior of the Python 3.3.1 terminal is unchanged but the 2.6.2 terminal is

Re: Easy Q

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron gher...@islandtraining.comwrote: Victor Subervi wrote: Hi; I have a string.join statement on a variable that comes from a cgi.FieldStorage().getlist. The variable may be a list or a single value. I need to treat it differently depending on which

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 1:00 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: On Sat, 9 Jan 2010 10:28:31 -0500, Victor Subervi victorsube...@gmail.com declaimed the following in gmane.comp.python.general: On Sat, Jan 9, 2010 at 10:14 AM, Iuri iurisil...@gmail.com wrote: And you should

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text file while not possessing

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread 3lvss0...@gmail.com
Marco Nawijn: I have had installed pywin32 already. The three lines that you mentoined don't do this, also what did you mean with doc = app.Documents.Open(c:\\example.doc). Which document should I open with this line? It shouldn't be opened anything. I was asking about the script as automated

Re: Scripting (was Re: Python books, literature etc)

2010-01-09 Thread bartc
Peter vm...@mycircuit.org wrote in message news:mailman.661.1262978839.28905.python-l...@python.org... Sounds good. Regarding the book's title: is it just me, or are Python programmers in general put off when people call it scripting? I won't attempt a strict definition of the term

Re: [Python-Dev] [RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Jan Kaliszewski
Hello, I have a question: are class decorator planned to be backported from 3.x? All the best, *j -- Jan Kaliszewski (zuo) z...@chopin.edu.pl -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL show() not working for 2nd pic

2010-01-09 Thread Cousin Stanley
I am using PIL for image processing in ubuntu 9.04. When i give two im.show() commands for two different images, the second image is not displayed (eye of gnome is the display program). It says no such file or directory. Any ideas? Suresh I also had problems with show() when

Re: Something More Elegant

2010-01-09 Thread Stephen Hansen
On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi victorsube...@gmail.comwrote: On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden st...@holdenweb.com wrote: But we are now in the realm of theory as far as you are concerned, since you have already stated several times that you aren't interested in

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Daniel Fetchinson fetchin...@googlemail.com writes: http://www.nightsong.com/phr/crypto/p3.py Thanks a lot, currently I'm having trouble using this code on python 2.6 but probably some small tweaking will fix it. Yikes, this is the first I've heard of such a problem. I will look into it.

Re: Link to module Stack

2010-01-09 Thread Steve Holden
Steven D'Aprano wrote: On Sat, 09 Jan 2010 05:56:36 -0500, Dave Angel wrote: InnerInterpreterError is the most inappropriate exception name I've ever seen. It has nothing to do with the interpreter, it's a stack error. It has everything to do with the (Forth) interpreter. Exceptions can

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Daniel Fetchinson fetchin...@googlemail.com writes: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. For encrypting strings, use this module: http://nightsong.com/phr/crypto/p3.py Obviously this is limited to strings that

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Robert Kern robert.k...@gmail.com writes: Are you on a 64-bit platform? Unfortunately, array's integer typecodes are platform-specific, but p3.py requires a 32-bit integer ... Oh yes, thanks, I never did get around to dealing with 64 bit platforms. I also notice that some of the unit test

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-09 Thread casevh
On Jan 9, 10:06 am, Dave WB3DWE wrote: On Jan 6 I inquired how to fix the 3.1.1 interactive terminal in Ubuntu Linux.   Left arrow yields ^[[D , etc. casevh helped by suggesting libreadline5-dev be installed. Did so with Synaptic Package Manager. The behavior of the Python 3.3.1 terminal is

Re: [Python-Dev] [RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Jack Diederich
On Sat, Jan 9, 2010 at 2:53 PM, Jan Kaliszewski z...@chopin.edu.pl wrote: Hello, I have a question: are class decorator planned to be backported from 3.x? Eh? Class decorators have been in the 2.x series since 2.6. If you want to know more about class decorators check out this talk from PyCon

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread Marco Nawijn
On Jan 9, 8:18 pm, 3lvss0...@gmail.com 3lvss0...@gmail.com wrote: Marco Nawijn: I have had installed pywin32 already. The three lines that you mentoined don't do this I checked at my own computer and it works fine. also what did you mean with doc = app.Documents.Open(c:\\example.doc). Which

Re: [Python-Dev] [RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Jan Kaliszewski
09-01-2010 o 22:34:28 Jack Diederich jackd...@gmail.com wrote: On Sat, Jan 9, 2010 at 2:53 PM, Jan Kaliszewski z...@chopin.edu.pl I have a question: are class decorator planned to be backported from 3.x? Eh? Class decorators have been in the 2.x series since 2.6. Oops, I overlooked the

Re: Append to an Excel file

2010-01-09 Thread Niels L. Ellegaard
pp parul.pande...@gmail.com writes: On Jan 9, 1:47 am, Jason Scheirer jason.schei...@gmail.com wrote: On Jan 9, 12:30 am, pp parul.pande...@gmail.com wrote: Hi All, How do I add a line to an existing file. This should append to the existing data in the excel file, which was saved

Re: Python-list Digest, Vol 76, Issue 97

2010-01-09 Thread Mitchell L Model
On Jan 8, 2010, at 7:35:39 PM EST, Terry Reedy tjre...@udel.edu wrote: On 1/8/2010 12:02 PM, Mitchell L Model wrote: On further reflection, I will add that what appears to be happening is that during import both the global and local dictionaries are set to a copy of the globals() from the

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-09 Thread pdlemper
On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh cas...@gmail.com wrote: Did you recompile Python 3.1.1 after installing libreadline5-dev? (From the Python 3.1.1 directory. Your options to configure may vary.) make distclean ./configure --prefix=/usr/local --with-computed-gotos --with-wide-

Re: Link to module Stack

2010-01-09 Thread Dave Angel
Steven D'Aprano wrote: On Sat, 09 Jan 2010 05:56:36 -0500, Dave Angel wrote: InnerInterpreterError is the most inappropriate exception name I've ever seen. It has nothing to do with the interpreter, it's a stack error. It has everything to do with the (Forth) interpreter.

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread 3lvss0...@gmail.com
Marco did you also make the HD files to it worked for you? Because I cannot even imagine how only three lines would do everything - find correct folder (path) of the files, find maximum number, move the entire text,... In this 3 lines is not stated that we are talking about the files that start

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-09 Thread casevh
On Jan 9, 3:10 pm, pdlem...@earthlink.net wrote: On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh cas...@gmail.com wrote: Did you recompile Python 3.1.1 after installing libreadline5-dev? (From the Python 3.1.1 directory. Your options to configure may vary.) make distclean ./configure

Prepend to logging message

2010-01-09 Thread Joan Miller
How to prepend anything to a logging message? Is possible to do it from the dictionary object (ExtraLog) or is there is that override process() [1]? -- class ExtraLog(object): def __getitem__(self, name): if name == 'foo': result = 'testing' return

Re: Microsoft Office Word and Python (Win XP)

2010-01-09 Thread David Monaghan
On Sat, 9 Jan 2010 11:18:12 -0800 (PST), 3lvss0...@gmail.com 3lvss0...@gmail.com wrote: Dennis Lee Bieber: Im not familiar with python, also Im not programmer. What you want to do isn't complicated, but it isn't simple either, unless you're familiar with VBA/VBS. I approach these problems by

Re: Prepend to logging message

2010-01-09 Thread Ishwor Gurung
Joan, 2010/1/10 Joan Miller pelok...@gmail.com: How to prepend anything to a logging message? Is possible to do it from the dictionary object (ExtraLog) or is there is that override process() [1]? -- class ExtraLog(object):    def __getitem__(self, name):        if name

Re: PIL how to display multiple images side by side

2010-01-09 Thread Lie Ryan
On 1/9/2010 8:43 AM, suresh.amritapuri wrote: Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh Tkinter has PhotoImage widget and PIL has support for this widget: http://www.pythonware.com/library/pil/handbook/imagetk.htm --

Re: PIL how to display multiple images side by side

2010-01-09 Thread Alf P. Steinbach
* Lie Ryan: On 1/9/2010 8:43 AM, suresh.amritapuri wrote: Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh Tkinter has PhotoImage widget and PIL has support for this widget: http://www.pythonware.com/library/pil/handbook/imagetk.htm

Re: subprocess.Popen does not close pipe in an error case

2010-01-09 Thread Nobody
On Wed, 06 Jan 2010 11:39:37 -0800, Steven K. Wong wrote: Suppose now all the prog1.poll() calls/loop are replaced by a single prog1.wait(). Without the explicit prog1.stdout.close(), prog1.wait() will not return, so the calling process still hangs. Because calling prog1.wait() means that the

[issue7647] Add statvfs flags to the posix module

2010-01-09 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: IMO these symbols should go to the stat module, not the posix module. However, that module is Python, so the values would need to be hardcoded. Do you know whether they are constant on all relevant systems? -- assignee: - loewis

[issue7422] Document inspect.get(full)argspec limitation to Python function

2010-01-09 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Thanks, added Python in r77382, r77383. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7422 ___

[issue7441] Py3.1: Fatal Python Error: Py_Initialize...unknown encoding: chcp 65001.

2010-01-09 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7441 ___ ___ Python-bugs-list

[issue7498] test_multiprocessing test_rapid_restart fails if port 9999 already in use

2010-01-09 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Can this be closed? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7498 ___

[issue7647] Add statvfs flags to the posix module

2010-01-09 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think having a stat module is a mistake in the first place. It's primary purpose (giving symbolic names to fields in a stat result) is out-of-date, now that we have named tuples. It's secondary purpose (collecting symbolic constants and

[issue7647] Add statvfs flags to the posix module

2010-01-09 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Okay. Would it then make sense to migrate those constants in the stat module to posix, and deprecate the former? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7647

[issue7507] pipes.quote does not correctly escape !

2010-01-09 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I'm attaching a patch that changes quote() logic. It also fixes #7476, the empty argument case. Strings with unsafe characters are now always quoted with single quotes. Single quotes themselves are replaced by a single quote in double quotes,

[issue7651] Python3: guess text file charset using the BOM

2010-01-09 Thread Walter Dörwald
Walter Dörwald wal...@livinglogic.de added the comment: IMHO this is the wrong approach. As Martin v. Löwis suggested here http://mail.python.org/pipermail/python-dev/2010-January/094841.html the best solution would be a new codec (which he named sniff), that autodetects the encoding on

[issue7498] test_multiprocessing test_rapid_restart fails if port 9999 already in use

2010-01-09 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7498 ___ ___

[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-09 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: This can wait. -- priority: release blocker - deferred blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___

[issue7559] TestLoader.loadTestsFromName swallows import errors

2010-01-09 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Wouldn't this be a backwards incompatible change of tested behaviour though? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7559

[issue7632] dtoa.c: oversize b in quorem

2010-01-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Second patch, adding a fix for the rounding bug to the first patch. -- Added file: http://bugs.python.org/file15796/issue7632_v2.patch ___ Python tracker rep...@bugs.python.org

[issue7632] dtoa.c: oversize b in quorem

2010-01-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's the (rather crude) testing program that turned up these errors. -- Added file: http://bugs.python.org/file15797/test_dtoa.py ___ Python tracker rep...@bugs.python.org

  1   2   >