Re: utf - string translation

2006-11-22 Thread Dan
Thank you for your answers. In fact, I'm getting start with Python. I was looking for transform a text through elementary cryptographic processes (Vigenère). The initial text is in a file, and my system is under UTF-8 by default (Ubuntu) -- http://mail.python.org/mailman/listinfo/python-list

Re: regex problem

2006-11-22 Thread km
HI Tim, oof! thats true! thanks a lot. Is there any tool to simplify building the regex ? regards, KM On 11/23/06, Tim Chase [EMAIL PROTECTED] wrote: line is am trying to match is 1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer membra29.90.00011 1 regex i have written is

Accessing feed history in an RSS Reader

2006-11-22 Thread Mark S.
Anyone know how to access feed history (items not contained in the current .xml file), so that an RSS Reader could display historical postings? Google Reader is able to do this. I'm interested in implementing kind of feature in Python. I've done quite a bit of searching to no avail. Any ideas?

X class missing in Python :-) - Re: What's going on here?

2006-11-22 Thread robert
Dale Strickland-Clark wrote: Python 2.4.2 (#1, Oct 13 2006, 17:11:24) [GCC 4.1.0 (SUSE Linux)] on linux2 Type help, copyright, credits or license for more information. a = object() a object object at 0xb7bbd438 a.spam = 1 Traceback (most recent call last): File stdin, line 1, in ?

Re: regex problem

2006-11-22 Thread bearophileHUGS
line is am trying to match is 1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer membra29.90.00011 1 regex i have written is re.compile (r'(\d+?)\|((P|O|Q)\w{5})\|\w{3,6}\_\w{3,5}\s+?.{25}\s{3}(\d+?\.\d)\s+?(\d\.\d+?)') I am trying to extract 0.0011 value from the above line.

Re: Is there a list comprehension for this?

2006-11-22 Thread John Machin
Steven D'Aprano wrote: On Wed, 22 Nov 2006 02:28:04 -0800, John Machin wrote: Steven D'Aprano wrote: On Tue, 21 Nov 2006 21:00:02 -0800, John Machin wrote: Steven D'Aprano wrote: [snip] def running_sum(dw): Return a list of the running sums of sequence dw rs

Re: X class missing in Python :-) - Re: What's going on here?

2006-11-22 Thread John Machin
robert wrote: Dale Strickland-Clark wrote: Python 2.4.2 (#1, Oct 13 2006, 17:11:24) [GCC 4.1.0 (SUSE Linux)] on linux2 Type help, copyright, credits or license for more information. a = object() a object object at 0xb7bbd438 a.spam = 1 Traceback (most recent call last): File

Re: PyParsing and Headaches

2006-11-22 Thread Paul McGuire
Bytter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'm trying to construct a parser, but I'm stuck with some basic stuff... For example, I want to match the following: letter = A...Z | a...z literal = letter+ include_bool := + | - term = [include_bool] literal So I

Re: utf - string translation

2006-11-22 Thread John Machin
Dan wrote: Thank you for your answers. In fact, I'm getting start with Python. That was a good decision. Welcome! I was looking for transform a text through elementary cryptographic processes (Vigenère). So why do you want to strip off accents? The history of communication has several

Re: PyParsing and Headaches

2006-11-22 Thread Hugo Ferreira
Chris, Thanks for your quick answer. That changes a lot of stuff, and now I'm able to do my parsing as I intended to. Paul, Thanks for your detailed explanation. One of the things I think is missing from the documentation (or that I couldn't find easy) is the kind of explanation you give about

Global object

2006-11-22 Thread Ghido
Hi all, i need to save in an object some variable for use in other parts of my software. it's possibile without create an istance of this class in every file? if yes how? thanks a lot Ghido -- http://mail.python.org/mailman/listinfo/python-list

Re: utf - string translation

2006-11-22 Thread David H Wild
In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: So why do you want to strip off accents? The history of communication has several examples of significant difference in meaning caused by minute differences in punctuation or accents including one of which you may have

Re: utf - string translation

2006-11-22 Thread John Machin
David H Wild wrote: In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: So why do you want to strip off accents? The history of communication has several examples of significant difference in meaning caused by minute differences in punctuation or accents including one of

Re: Quadratic Optimization Problem

2006-11-22 Thread [EMAIL PROTECTED]
thanks, I was actually looking for a package only in python to do this which can solve it directly. Since my problem is a nonlinear convex optimization problem, there are a number of algorithms to get it solved. I will try using CVXOPT package. Beliavsky wrote: Stefan Behnel wrote: [EMAIL

Re: Global object

2006-11-22 Thread Steven Bethard
Ghido wrote: Hi all, i need to save in an object some variable for use in other parts of my software. it's possibile without create an istance of this class in every file? if yes how? Create a module, say, ``config``. Then to save your object, you use something like:: import config

Re: interleaving dictionary values

2006-11-22 Thread Tuomas
[EMAIL PROTECTED] wrote: Hello, I was trying to create a flattened list of dictionary values where each value is a list, and I was hoping to do this in some neat functionally style, in some brief, throwaway line so that it would assume the insignificance that it deserves in the grand scheme

Re: Accessing feed history in an RSS Reader

2006-11-22 Thread [EMAIL PROTECTED]
I'm pretty sure that GoogleReader keeps its own archive on their servers to provide historical feed items - so you'd have to implement your own archiving on your server to get the same functionality (unless GoogleReader publishes any API you could use for this purpose). In the general case, given

Re: KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Tolf
On Wed, 2006-11-22 at 19:45 +0100, Fredrik Lundh wrote: Fredrik Tolf wrote: So how does it work? Does my code get to return Py_FALSE, and the interpreter ignores it, seeing that an exception is set? Is a non-local exit performed right over my call stack (in which case my next question

Re: Trying to understand Python objects

2006-11-22 Thread Ben Finney
walterbyrd [EMAIL PROTECTED] writes: Is there some book, or other reference, that explains of this? I was thinking about Python for Dummies. The Think like a Computer Scientist book, and Dive into Python book don't seem to explain Python's object model clearly enough for me. The canonical

Python, WSGI, legacy web application

2006-11-22 Thread Ben Finney
Howdy all, I'm working on a web application that is starting to gain a lot of back-end code written in Python. However, all the current interface code is written in legacy PHP. I'd like to slowly introduce new features as Python WSGI programs. Is it possible to write a Python WSGI program that

Abelson and Python

2006-11-22 Thread bearophileHUGS
While studying the SICP video lectures I have to twist my mind some to completely understand the lessons. I implement the programs shown there in both Python and Scheme, and I find the Python implementations simpler to write (but it's not a fair comparison because I know very little Scheme still).

Re: utf - string translation

2006-11-22 Thread Klaas
David H Wild wrote: In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: So why do you want to strip off accents? The history of communication has several examples of significant difference in meaning caused by minute differences in punctuation or accents including one of

Re: AVL Balancing

2006-11-22 Thread scbauer
John Machin wrote: [EMAIL PROTECTED] wrote: Im working on an AVL tree Is this homework? Yes, this is homework. that consists of balancing the tree everytime you add an object. That's a peculiar kind of AVL tree. Normally it is *not* necessary to balance the tree every time a node is

Re: Abelson and Python

2006-11-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: While studying the SICP video lectures I have to twist my mind some to completely understand the lessons. I implement the programs shown there in both Python and Scheme, and I find the Python implementations simpler to write (but it's not a fair comparison because I

Re: AVL Balancing

2006-11-22 Thread scbauer
This is one of the errors that im getting Traceback (most recent call last): File pyshell#49, line 1, in module t.insert(5) File /Users/stevenbauer/Desktop/AVL.py, line 68, in insert stack.append(current) NameError: global name 'stack' is not defined --

Re: Abelson and Python

2006-11-22 Thread bearophileHUGS
[EMAIL PROTECTED]: No surprise to anyone who's ever tried to use MIT Scheme. Be careful, such assertions are often flamebait. I am using DrPython (I think they were using it at MIT too lately), and it is very very good IDE, it produces executables on the fly, it has a visual debugger with some

Re: AVL Balancing

2006-11-22 Thread bearophileHUGS
scbauer wrote: This is one of the errors that im getting Traceback (most recent call last): File pyshell#49, line 1, in module t.insert(5) File /Users/stevenbauer/Desktop/AVL.py, line 68, in insert stack.append(current) NameError: global name 'stack' is not defined def

windows background process

2006-11-22 Thread Podi
Hi, I am using Python 2.4.4 on Windows XP SP2. I am trying to start a process (infinite loop application) in the background and I've tried several options and none of them seem to work. Any help would be much appreciated. Thanks, P 1. # This works on PythonWin interactive window, but the

Re: Python, WSGI, legacy web application

2006-11-22 Thread Graham Dumpleton
Ben Finney wrote: Howdy all, I'm working on a web application that is starting to gain a lot of back-end code written in Python. However, all the current interface code is written in legacy PHP. I'd like to slowly introduce new features as Python WSGI programs. Is it possible to write a

Re: AVL Balancing

2006-11-22 Thread John Machin
scbauer wrote: John Machin wrote: [EMAIL PROTECTED] wrote: Im working on an AVL tree Is this homework? Yes, this is homework. It was a rhetorical question :-) that consists of balancing the tree everytime you add an object. That's a peculiar kind of AVL tree. Normally it

Re: Abelson and Python

2006-11-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED]: No surprise to anyone who's ever tried to use MIT Scheme. Be careful, such assertions are often flamebait. Well, yeah, it's a warning to everyone to not bother with the MIT implementation of Scheme which is completely worthless. I am using

Re: Abelson and Python

2006-11-22 Thread bearophileHUGS
[EMAIL PROTECTED]: Haven't heard of that one, although I've got DrScheme. Right, sorry, I meant that one :-) I find that hierarchy extremely annoying. I don't see the need for it. I never use OOP in Python yet there's no need for me to have a stripped down version, I just don't use it. But

Re: windows background process

2006-11-22 Thread Podi
Some update... I just found out that the following seems to work, import subprocess subprocess.Popen(' myargs', executable='mycmd.exe') However, it does not work with my path\\mycmd.exe subprocess.Popen(' myargs', executable='my path\\mycmd.exe') # error --

Re: The Python Papers Edition One

2006-11-22 Thread [EMAIL PROTECTED]
Tell us about it again when it is available as html. We will be glad to read it. I am sorry but I almost never find a pdf worth the bother of clicking on it. Sorry -- http://mail.python.org/mailman/listinfo/python-list

changing list items

2006-11-22 Thread eight02645999
hi say i have a list alist = ['a','b','c','e','d','f'] I wanted to change the elements , say alist[2:4] . If i do alist[2:4] = t , it gives ['a', 'b', 't', 'd', 'f'] which is not what i want. I wanted alist = ['a','b','t','t','d','f'] My list may have more elements, and i may need to replace

Re: Abelson and Python

2006-11-22 Thread markscottwright
[EMAIL PROTECTED] wrote: While studying the SICP video lectures I have to twist my mind some to completely understand the lessons. I implement the programs shown there in both Python and Scheme, and I find the Python implementations simpler to write (but it's not a fair comparison because I

Re: Abelson and Python

2006-11-22 Thread bearophileHUGS
markscottwright: I love Python as much as the next guy, but I just don't see how SICP can be done in Python. The contents of the course are probably different, they work on robotics... Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: changing list items

2006-11-22 Thread bearophileHUGS
A possibile first solution: alist = ['a','b','c','e','d','f'] inf, sup = 2, 4 alist[inf:sup] = [t] * (sup - inf) alist ['a', 'b', 't', 't', 'd', 'f'] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Tkinter, main loop question.

2006-11-22 Thread Exod
Don't know if its possible in this light-weight GUI toolset, but can i somehow hook up into the mainloop in it, for example if i were to create an internet application, i would need to keep recieving data from within it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, WSGI, legacy web application

2006-11-22 Thread ToddG
Ben Finney wrote: Is it possible to write a Python WSGI program that talks to a PHP program as its back end? Where can I find out how to do this, preferably with examples? Perhaps: http://pythonpaste.org/wphp/ http://blog.ianbicking.org/2006-wphp.html --

Re: The Python Papers Edition One

2006-11-22 Thread [EMAIL PROTECTED]
The adobe people have online conversion http://www.adobe.com/products/acrobat/access_onlinetools.html google seems to convert them when they end up in the engines http://www.google.com/search?hl=enq=pdf+to+html has a list of converters http://www.dexrow.com [EMAIL PROTECTED] wrote: Tell us

Weekly Python Patch/Bug Summary

2006-11-22 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 406 open (-10) / 3479 closed (+16) / 3885 total ( +6) Bugs: 931 open ( +1) / 6349 closed (+16) / 7280 total (+17) RFE : 245 open ( +1) / 244 closed ( +0) / 489 total ( +1) New / Reopened Patches __ Logging

Re: file backup in windows

2006-11-22 Thread k.i.n.g.
Hi, The following code has worked for me, I will continue from here to make this further userfriendly. More I would like to know how can i distribute my python code as self installer package. In the process of learning programming I would like take OutlookBackup.py as my first project and learn

combining the path and fileinput modules

2006-11-22 Thread wo_shi_big_stomach
Newbie to python writing a script to recurse a directory tree and delete the first line of a file if it contains a given string. I get the same error on a Mac running OS X 10.4.8 and FreeBSD 6.1. Here's the script: # start of program # p.pl - fix broken SMTP headers in email files # # recurses

Re: The Python Papers Edition One

2006-11-22 Thread Paul Rubin
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Some of you may have noticed the launch of the Python Journal a while back. Due to artistic differences, the journal has now been re-launched as The Python Papers. It is available under a Creative Commons License, something we felt was appropriate

Re: The Python Papers Edition One

2006-11-22 Thread Stephen Hansen
3.) Can I have an HTML version? A) No, we like it pretty. The interesting thing is, there's nothing in your layout or format that you can't do with some nice standards-compliant HTML and CSS. It could look identical as HTML-- and be significantly more reachable by people, easier for them to

Porting Tkinter application to JYthon

2006-11-22 Thread sandip desale
Dear All, We have a Tcl/Tk application written using Python 2.2. Using this application we want to call some customizable Java APIs. I tried porting Tcl/Tk application to Jython but not able to do the same as TKinter library is not available with JYthon. Can you please help me in porting

Re: Abelson and Python

2006-11-22 Thread Paddy
[EMAIL PROTECTED] wrote: While studying the SICP video lectures I have to twist my mind some to completely understand the lessons. I implement the programs shown there in both Python and Scheme, and I find the Python implementations simpler to write (but it's not a fair comparison because I

Re: The Python Papers Edition One

2006-11-22 Thread Tennessee Leeuwenburg
On 11/23/06, Stephen Hansen [EMAIL PROTECTED] wrote: 3.) Can I have an HTML version? A) No, we like it pretty. The interesting thing is, there's nothing in your layout or format that you can't do with some nice standards-compliant HTML and CSS. It could look identical as HTML-- and

Re: Python, WSGI, legacy web application

2006-11-22 Thread Ben Finney
ToddG [EMAIL PROTECTED] writes: Ben Finney wrote: Is it possible to write a Python WSGI program that talks to a PHP program as its back end? Where can I find out how to do this, preferably with examples? Perhaps: http://pythonpaste.org/wphp/

WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-22 Thread Ben Finney
Graham Dumpleton [EMAIL PROTECTED] writes: Look at mod_python for Apache. If you use it correctly you can on a page by page basis as need be, replace the existing PHP pages with equivalents written using Python. You could do this by programming right at the level of mod_python, or again, if

Re: Abelson and Python

2006-11-22 Thread [EMAIL PROTECTED]
Paddy wrote: [EMAIL PROTECTED] wrote: While studying the SICP video lectures I have to twist my mind some to completely understand the lessons. I implement the programs shown there in both Python and Scheme, and I find the Python implementations simpler to write (but it's not a fair

Re: Abelson and Python

2006-11-22 Thread bearophileHUGS
Paddy: Is the MIT course syndicated to Universities around America or something? (Is your name pronounced Beer-owe-file, or Bear-oh-fi-lee, I don't know. I too have heard about the MIT course changing to Python elsewhere and wanted to know why it was talked about so much? I don't know why

[ python-Bugs-1579029 ] --disable-sunaudiodev --disable-tk does not work

2006-11-22 Thread SourceForge.net
Bugs item #1579029, was opened at 2006-10-17 17:03 Message generated for change (Comment added) made by thurnerrupert You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1579029group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Feature Requests-1185383 ] Make bisect.* functions accept an optional compare function

2006-11-22 Thread SourceForge.net
Feature Requests item #1185383, was opened at 2005-04-18 19:26 Message generated for change (Comment added) made by minmax You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=355470aid=1185383group_id=5470 Please note that this message will contain a full copy of the

[ python-Bugs-1571754 ] Building using Sleepycat db 4.5.20 is broken

2006-11-22 Thread SourceForge.net
Bugs item #1571754, was opened at 2006-10-05 21:31 Message generated for change (Comment added) made by juedau You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1571754group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1601399 ] urllib2 does not close sockets properly

2006-11-22 Thread SourceForge.net
Bugs item #1601399, was opened at 2006-11-23 08:04 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1601399group_id=5470 Please note that this message will contain a full copy of

[ python-Bugs-1579029 ] --disable-sunaudiodev --disable-tk does not work

2006-11-22 Thread SourceForge.net
Bugs item #1579029, was opened at 2006-10-17 17:03 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1579029group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

2006-11-22 Thread SourceForge.net
Bugs item #1601501, was opened at 2006-11-23 02:38 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1601501group_id=5470 Please note that this message will contain a full copy of

[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

2006-11-22 Thread SourceForge.net
Bugs item #1601501, was opened at 2006-11-23 03:38 Message generated for change (Comment added) made by doerwalter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1601501group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

2006-11-22 Thread SourceForge.net
Bugs item #1601501, was opened at 2006-11-23 03:38 Message generated for change (Comment added) made by doerwalter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1601501group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1601501 ] utf_8_sig decode fails with buffer input

2006-11-22 Thread SourceForge.net
Bugs item #1601501, was opened at 2006-11-23 03:38 Message generated for change (Comment added) made by doerwalter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1601501group_id=5470 Please note that this message will contain a full copy of the comment

<    1   2