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 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 wrote: > On Jan 8, 12:19 am, peteshinners 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 experienced with this

Re: Append to an Excel file

2010-01-09 Thread pp
On Jan 9, 1:47 am, Jason Scheirer wrote: > On Jan 9, 12:30 am, pp 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 Hi Jason and

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=gst&q=stack+module#64cb44a120baeca2 Here's the stack module for py4th. nick --- #!/usr/Util/bin/python # # @(#)stack.py 1.1 # # stack.py #

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 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 values to figure

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 hea

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 tex

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: Why is it so?? from xlrd import open_workbook from xlwt import easyxf from xlutils.copy import copy rb = open_workbook('source.xls',formatting_in

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 the

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 > fi

Re: table from csv file

2010-01-09 Thread Jon Clements
On Jan 8, 8:31 pm, J wrote: > On Fri, Jan 8, 2010 at 13:55, Jon Clements wrote: > > On Jan 8, 5:59 pm, marlowe wrote: > >> I am trying to create a table in python from a csv file where I input > >> which columns I would like to see, and the table only shows those > >> columns. I have attached an

Re: Porblem with xlutils/xlrd/xlwt

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

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread pp
On Jan 9, 3:42 am, Jon Clements wrote: > On Jan 9, 10:24 am, pp wrote: > > > > > Whenever i run the code below I get the following error: > > > AttributeError: 'Book' object has no attribute 'on_demand' > > WARNING: Failure executing file: > > > Why is it so?? > > > from xlrd import open_workboo

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
On 1/9/10, Steven D'Aprano 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 file in such a way that poss

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 wh

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread Jon Clements
On Jan 9, 10:44 am, pp wrote: > On Jan 9, 3:42 am, Jon Clements wrote: > > > > > On Jan 9, 10:24 am, pp wrote: > > > > Whenever i run the code below I get the following error: > > > > AttributeError: 'Book' object has no attribute 'on_demand' > > > WARNING: Failure executing file: > > > > Why i

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 w

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread pp
On Jan 9, 3:52 am, Jon Clements wrote: > On Jan 9, 10:44 am, pp wrote: > > > > > On Jan 9, 3:42 am, Jon Clements wrote: > > > > On Jan 9, 10:24 am, pp wrote: > > > > > Whenever i run the code below I get the following error: > > > > > AttributeError: 'Book' object has no attribute 'on_demand' >

Re: lightweight encryption of text file

2010-01-09 Thread Dave Angel
Anthra Norell wrote: 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 b

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 < .0

Re: Link to module Stack

2010-01-09 Thread Duncan Booth
Dave Angel 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 not bo

Re: Accessing python from a network share in windows 7

2010-01-09 Thread Anssi Saari
aj 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 information. im

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 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 undocumen

Re: lightweight encryption of text file

2010-01-09 Thread Arnaud Delobelle
Daniel Fetchinson 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 back into the original t

Re: Append to an Excel file

2010-01-09 Thread Steve Holden
pp wrote: > On Jan 9, 1:47 am, Jason Scheirer wrote: >> On Jan 9, 12:30 am, pp 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 > >

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 return

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] packa

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 wrote: > Hi; > The following code works fine. I would like you to suggest something more > simple and elegant: > >

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 it

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase wrote: > 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,

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 > wrote: > Victor Subervi wrote: > > Hi; > > I have this line of code: > > sql = 'select Name, Price from %sPackages where ID=%s;' % > (store, pid) >

Re: Another Screwy Problem

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 9:07 AM, J. Cliff Dyer 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 > > wrote: > > Victor Subervi wrote: > > > Hi; > > > I have this line of code: > > > sql = 'select

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" 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) - a

Re: Something More Elegant

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

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 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 can generate pi with

Re: Something More Elegant

2010-01-09 Thread Gabriel Genellina
En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi escribió: On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase wrote: It would also help if you didn't pass the categoryID as a string-formatted value, but as a proper parameter, something like sql = "... where c.categoryid=?" % (store, store) cu

Re: restructuredText editor ?

2010-01-09 Thread Peter
On 01/09/2010 03:32 AM, Florian Diesch wrote: Peter 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 ( useful for many

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 wrote: > En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > >> On Sat, Jan 9

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 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 > production. So good luck

Re: Porblem with xlutils/xlrd/xlwt

2010-01-09 Thread John Machin
On Jan 9, 9:56 pm, pp wrote: > On Jan 9, 3:52 am, Jon Clements wrote: > > > > > On Jan 9, 10:44 am, pp wrote: > > > > On Jan 9, 3:42 am, Jon Clements wrote: > > > > > On Jan 9, 10:24 am, pp wrote: > > > yeah all my versions are latest fromhttp://www.python-excel.org. > > > just checked!! How

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 10:14 AM, Iuri 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 -- http://mail.pyth

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" 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., based on argumen

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" 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 bounds,

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 a

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

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 wrote: > On Jan 9, 11:31 am, "Richard D. Moores" 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

Re: table from csv file

2010-01-09 Thread J
On Sat, Jan 9, 2010 at 05:26, Jon Clements 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 afterwards, so you h

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 th

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 t

[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 w

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 t

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 that

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 s

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 corr

Re: Easy Q

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron wrote: > 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

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 1:00 PM, Dennis Lee Bieber wrote: > On Sat, 9 Jan 2010 10:28:31 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > On Sat, Jan 9, 2010 at 10:14 AM, Iuri wrote: > > > > > And you should use cursor.fetchall() instead of cursor in list > > >

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 po

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 p

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

2010-01-09 Thread bartc
"Peter" 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 "scripting language", b

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) -- 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() whe

Re: Something More Elegant

2010-01-09 Thread Stephen Hansen
On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi wrote: > On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden 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 yo

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Daniel Fetchinson 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. Thanks. (Also than

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) interpret

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Daniel Fetchinson 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 fit in memory, which mi

Re: lightweight encryption of text file

2010-01-09 Thread Paul Rubin
Robert Kern 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 functions use print state

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 ter

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 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 2009 http://p

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")

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

2010-01-09 Thread Jan Kaliszewski
09-01-2010 o 22:34:28 Jack Diederich wrote: On Sat, Jan 9, 2010 at 2:53 PM, Jan Kaliszewski 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 fact :) Thank you! *j -- Jan Kalis

Re: Append to an Excel file

2010-01-09 Thread Niels L. Ellegaard
pp writes: > On Jan 9, 1:47 am, Jason Scheirer wrote: >> On Jan 9, 12:30 am, pp 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.or

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 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 importing scop

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 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- >unicode >mak

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. Except

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 wit

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 > 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=/

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 b

Re: Prepend to logging message

2010-01-09 Thread Ishwor Gurung
Joan, 2010/1/10 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': >

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 -- http://mail.pyt

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 Maybe

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