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 w

Re: Tkinter, main loop question.

2006-11-22 Thread Hendrik van Rooyen
"Exod" <[EMAIL PROTECTED]> wrote: > 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? Its possible - use the call back

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

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 agai

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/ > http://blog.ianbic

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

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

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 Tkin

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 u

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 appropr

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 f

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 ac

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=en&q=pdf+to+html has a list of converters http://www.dexrow.com [EMAIL PROTECTED] wrote: > Tell u

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 M

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

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

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

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 replac

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

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 -- http://mail.python.org/mailman/

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.

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 usin

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

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 wr

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 pytho

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 "", line 1, in > t.insert(5) > File "/Users/stevenbauer/Desktop/AVL.py", line 68, in insert > stack.append(current) > NameError: global name 'stack' is not defined def __init__(s

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 scbauer
This is one of the errors that im getting Traceback (most recent call last): File "", line 1, in t.insert(5) File "/Users/stevenbauer/Desktop/AVL.py", line 68, in insert stack.append(current) NameError: global name 'stack' is not defined -- http://mail.python.org/mailman/listinfo/py

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

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 ti

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 includ

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

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 ta

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

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 quest

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: 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 s

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: 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 PR

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 inclu

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 hav

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

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 severa

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

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 > > > a.spam = 1 > > Traceback (most recent call last): > >

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 th

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

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 > a.spam = 1 > Traceback (most recent call last): > File "", line 1, in ? > Attribut

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?

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 >

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 Tim Chase
> 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: Protecting against SQL injection

2006-11-22 Thread Christoph Zwerschke
Tor Erik Soenvisen wrote: > How safe is the following code against SQL injection: > > # Get user privilege > digest = sha.new(pw).hexdigest() > # Protect against SQL injection by escaping quotes > uname = uname.replace("'", "''") > sql = 'SELECT privilege FR

Re: gopherlib deprecated in 2.5

2006-11-22 Thread Terry Reedy
"Szabolcs Nagy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've just seen that gopherlib is deprecated in python 2.5 > http://docs.python.org/lib/module-gopherlib.html > > we still use this protocol (though there are only few working gopher > servers are left on the net) > > My

Re: PyParsing and Headaches

2006-11-22 Thread Chris Lambacher
On Wed, Nov 22, 2006 at 11:17:52AM -0800, Bytter wrote: > 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] liter

Re: utf - string translation

2006-11-22 Thread John Machin
hg wrote: > Duncan Booth wrote: > > hg <[EMAIL PROTECTED]> wrote: > > > >>> or in other words, put this at the top of your file (where "utf-8" is > >>> whatever your editor/system is using): > >>> > >>># -*- coding: utf-8 -*- > >>> > >>> and use > >>> > >>>u'' > >>> > >>> for all non-ASCII

regex problem

2006-11-22 Thread km
Hi all, 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. why

Re: utf - string translation

2006-11-22 Thread hg
Fredrik Lundh wrote: > hg wrote: > >> How would you handle the string.maketrans then ? > > maketrans works on bytes, not characters. what makes you think that you > can use maketrans if you haven't gotten the slightest idea what's in the > string? > > if you want to get rid of accents in a Unic

Re: Programmatically replacing an API for another module

2006-11-22 Thread Tom Plunket
Chris Lambacher wrote: > > > I'm just a bit loathe to download and install more stuff when > > > something simpler appears to be near-at-hand. ...especially > > > considering the page describing this module doesn't offer any download > > > links! http://python-mock.sourceforge.net/ > > Oh yeah,

PyParsing and Headaches

2006-11-22 Thread Bytter
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 defined this as: literal = Word(alphas) include_bool = Optional(

Re: utf - string translation

2006-11-22 Thread Fredrik Lundh
hg wrote: > How would you handle the string.maketrans then ? maketrans works on bytes, not characters. what makes you think that you can use maketrans if you haven't gotten the slightest idea what's in the string? if you want to get rid of accents in a Unicode string, you can do the approach

Re: utf - string translation

2006-11-22 Thread hg
Duncan Booth wrote: > hg <[EMAIL PROTECTED]> wrote: > >>> or in other words, put this at the top of your file (where "utf-8" is >>> whatever your editor/system is using): >>> >>># -*- coding: utf-8 -*- >>> >>> and use >>> >>>u'' >>> >>> for all non-ASCII literals. >>> >>> >>> >> Hi, >> >>

Re: utf - string translation

2006-11-22 Thread Duncan Booth
hg <[EMAIL PROTECTED]> wrote: >> or in other words, put this at the top of your file (where "utf-8" is >> whatever your editor/system is using): >> >># -*- coding: utf-8 -*- >> >> and use >> >>u'' >> >> for all non-ASCII literals. >> >> >> > > Hi, > > The problem is that: > > # -

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-22 Thread od
tool69 wrote: > Sorry, but did someone knows if Pida works under Windows ? > Thanks. No, it doesn't really. You can start it up with a bit of hacking, and I have seen screenshots around, but only with the scintilla-based editor. We are waiting for SVG support in GTK on windows. Writing a vim-win

Re: utf - string translation

2006-11-22 Thread hg
hg wrote: > Fredrik Lundh wrote: >> hg wrote: >> >>> We noticed that len('à') != len('a') >> sounds odd. >> > len('à') == len('a') >> True >> >> are you perhaps using an UTF-8 editor? >> >> to keep your sanity, no matter what editor you're using, I recommend >> adding a coding directive to the

Re: utf - string translation

2006-11-22 Thread hg
Fredrik Lundh wrote: > hg wrote: > >> We noticed that len('à') != len('a') > > sounds odd. > len('à') == len('a') > True > > are you perhaps using an UTF-8 editor? > > to keep your sanity, no matter what editor you're using, I recommend > adding a coding directive to the source file, and

Re: utf - string translation

2006-11-22 Thread Fredrik Lundh
hg wrote: > We noticed that len('à') != len('a') sounds odd. >>> len('à') == len('a') True are you perhaps using an UTF-8 editor? to keep your sanity, no matter what editor you're using, I recommend adding a coding directive to the source file, and using *only* Unicode string literals for n

Re: KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Lundh
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 > would be how to clean up resources being used from my C code

How to pass a boolean to a stored proc using Cx_Oracle?

2006-11-22 Thread JG
Hi, I am using Python 2.4 and cx_Oracle. I have a stored proc that takes two arguments. First is an NUMBER, second is a BOOLEAN. How do you call that stored procedure? After properly extablishing a connection, I have something like this: cursor = con.cursor() cursor.callproc("testproc",[123,Tr

utf - string translation

2006-11-22 Thread hg
Hi, I'm bringing over a thread that's going on on f.c.l.python. The point was to get rid of french accents from words. We noticed that len('à') != len('a') and I found the hack below to fix the "problem" ... yet I do not understand - especially since 'à' is included in the extended ASCII table,

KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Tolf
Dear List, I was writing a Python extension module, including a sleeping call to poll(2), and noticed, to my great surprise (and joy), that even when blocking there, KeyboardInterrupt still worked properly when sending SIGINTs to the interpreter. It really got me wondering how it works, though. I

Re: Programmatically replacing an API for another module

2006-11-22 Thread Chris Lambacher
> > I'm just a bit loathe to download and install more stuff when > > something simpler appears to be near-at-hand. ...especially > > considering the page describing this module doesn't offer any download > > links! http://python-mock.sourceforge.net/ > How about mini-mock: > http://blog.ianbicki

Re: Programmatically replacing an API for another module

2006-11-22 Thread Chris Lambacher
On Tue, Nov 21, 2006 at 05:00:32PM -0800, Tom Plunket wrote: > Bruno Desthuilliers wrote: > > > > I've got a bunch of code that runs under a bunch of unit tests. It'd > > > be really handy if when testing I could supply replacement > > > functionality to verify that the right things get called wi

PyParsing and Headaches

2006-11-22 Thread Hugo Ferreira
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 defined this as: literal = Word(alphas) include_bool = Optional

Re: text file parsing (awk -> python)

2006-11-22 Thread bearophileHUGS
Peter Otten, your solution is very nice, it uses groupby splitting on empty lines, so it doesn't need to read the whole files into memory. But Daniel Nogradi says: > But the names of the fields (node, x, y) keeps changing from file to > file, even their number is not fixed, sometimes it is (node,

Re: Note about getattr and '.'

2006-11-22 Thread Carl Banks
Steven D'Aprano wrote: > On Tue, 21 Nov 2006 22:39:09 +0100, Mathias Panzenboeck wrote: > > Yes, this is known. I think IronPython uses a specialized dictionary for > > members, which prohibits > > malformed names. I don't know if there will be such a dictionary in any > > future CPython version

Re: PyQt app in seperate thread

2006-11-22 Thread Diez B. Roggisch
anders wrote: > > Diez B. Roggisch wrote: >> > OK I see that now. Thanks for pointing that out. So basically, I can't >> > do what I want at all. That's a bit of a pain. Is there no way of >> > tricking Qt into thinking I'm running it in the main thread? >> >> Maybe you can either invert the thre

Re: PyQt app in seperate thread

2006-11-22 Thread anders
Diez B. Roggisch wrote: > > OK I see that now. Thanks for pointing that out. So basically, I can't > > do what I want at all. That's a bit of a pain. Is there no way of > > tricking Qt into thinking I'm running it in the main thread? > > Maybe you can either invert the thread-roles - that is, run

Re: PyQt app in seperate thread

2006-11-22 Thread Diez B. Roggisch
> OK I see that now. Thanks for pointing that out. So basically, I can't > do what I want at all. That's a bit of a pain. Is there no way of > tricking Qt into thinking I'm running it in the main thread? Maybe you can either invert the thread-roles - that is, run your "main" application in a threa

Re: Caution newbie question: python window to stay open ?

2006-11-22 Thread jim-on-linux
Michael, put this at the top of your code. After the window closes read the testLog.out file. It may give you a clue as to what is happening. sys.stdout = open('testLog.out', 'w') jim-on-linux http://www.inqvista.com On Tuesday 21 November 2006 22:20, mkengel wrote: > Caution: newbie q

Re: Python visual IDE

2006-11-22 Thread hg
Yes, Actually when you create the project from wxDesigner, the "main" will also be generated for you ... then you include the correct files in eclipse (note that one file never needs to be edited ... like glade). I went for wxDesigner years ago when wxglade was fairly unstable ... have not tested

Re: Data not flushed at the moment

2006-11-22 Thread MindClass
Here it's very well explained: http://groups.google.com/group/django-developers/browse_thread/thread/7bcb01ec38e7e6cd syncdb() method: http://code.djangoproject.com/browser/django/trunk/django/core/management.py#L435 But I'm not sure if is a django problem or from python. MindClass ha escrito:

Re: Python visual IDE

2006-11-22 Thread johnf
king kikapu wrote: > > Hi to all, > > i am not sure if this question really belongs here but anyway, here it > goes: I have seen a lot of IDEs for Python, a lot of good stuff but > actually none of them has what, for example, Visual Studio has: a > Visual Editor (with the ability to place contr

Re: Python visual IDE

2006-11-22 Thread king kikapu
I didn't know about this product you mention (wxDesigner). I download the trial and it seems pretty good, reminds me the wxGlade. So you make the GUI in this, generate Python code and import the module on your main project and reference it respectively ?? On Nov 22, 4:58 pm, hg <[EMAIL PROTECTE

Re: file backup in windows

2006-11-22 Thread Fredrik Lundh
"MC" wrote: > " are your friend. to be precise, list2cmdline is your friend. see discussion and examples here: http://effbot.org/pyfaq/why-can-t-raw-strings-r-strings-end-with-a-backslash.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyparsing Question.

2006-11-22 Thread Paul McGuire
"Ant" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a home-grown Wiki that I created as an excercise, with it's own > wiki markup (actually just a clone of the Trac wiki markup). The wiki > text parser I wrote works nicely, but makes heavy use of regexes, tags > and stacks to

Re: XML Validation in Python using XSV

2006-11-22 Thread bmichel
This works for me. You were very helpful, thank you! Michel Stefan Behnel wrote: > [EMAIL PROTECTED] wrote: > > Stefan Behnel wrote: > >>> [EMAIL PROTECTED] wrote: > >>> Stefan Behnel wrote: > BTW: any reason you need to use XSV? There are some other libraries out > there > that c

Re: file backup in windows

2006-11-22 Thread MC
Hi! " are your friend. See, also: filepath = '"%HOMEPATH%\\LocalSettings\\Application Data\\Microsoft\\Outlook\\*"' and %USERPROFILE% %APPDATA% etc. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: What's going on here?

2006-11-22 Thread Gerald Klix
Perhaps this piece of code might explain the behaviour: >>> class C( object ): ... __slots__ = () ... >>> o = C() >>> o.a = 1 Traceback (most recent call last): File "", line 1, in ? AttributeError: 'C' object has no attribute 'a' object behaves like having an implict __slots__ attrib

Re: XML Validation in Python using XSV

2006-11-22 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > Stefan Behnel wrote: >>> [EMAIL PROTECTED] wrote: >>> Stefan Behnel wrote: BTW: any reason you need to use XSV? There are some other libraries out there that can validate XML based on XML Schema and RelaxNG, e.g. lxml. They are much more powerful than

Re: XML Validation in Python using XSV

2006-11-22 Thread bmichel
I've read a bit about lxml, didn't found anything related to validating XML schema... Maybe you can give more details on how to install lxml and use it in Python to validate XML files against an XML Schema I'm going to ask the server administrator to install lxml, so I can't play around a lot with

Re: Python visual IDE

2006-11-22 Thread hg
king kikapu wrote: > I have already downloaded and seen the trial of Komodo Professional. > Indeed it has a simple Gui Builder but one can only use TKinter on it. > No wxWidgets support and far from truly RAD, but it is the only > "integrated" > GUI builder in these IDEs... > > > On Nov 22, 4:31

Re: What's going on here?

2006-11-22 Thread Fredrik Lundh
Dale Strickland-Clark wrote: > Why can't I assign to attributes of an instance of object? it doesn't have any attribute storage. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's going on here?

2006-11-22 Thread Richie Hindle
> What is subclassing adding to the class here? A __dict__: >>> o = object() >>> dir(o) ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> class C(object): pass ... >>> c = C() >>

Re: What's going on here?

2006-11-22 Thread Scott David Daniels
Dale Strickland-Clark wrote: > Python 2.4.2 (#1, Oct 13 2006, 17:11:24) a = object() a.spam = 1 > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'object' object has no attribute 'spam' class B(object): pass a = B() a.spam = 1 > > What i

ANN: PyVISA 1.1 -- GPIB, USB, RS232 instrument control

2006-11-22 Thread Torsten Bronger
Hallöchen! At http://pyvisa.sourceforge.net you can find information about the PyVISA package. It realises Python bindings for the VISA library functions, which enables you to control GPIB, USB, and RS232-serial measurement devices via Python. Yesterday I released version 1.1, which works much b

Re: PyQt app in seperate thread

2006-11-22 Thread Chris Mellon
On 22 Nov 2006 06:43:55 -0800, anders <[EMAIL PROTECTED]> wrote: > > Phil Thompson wrote: > > On Wednesday 22 November 2006 2:06 pm, anders wrote: > > > Phil Thompson wrote: > > > > On Wednesday 22 November 2006 12:37 pm, anders wrote: > > > > > I am writing a plugin for a piece of software in pyth

  1   2   >