Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
I'm trying to write a unicode raw string literal, and I seem to be running up against a conflict between the \u unicode character escape and the need to have a literal \u (i.e., backslash followed by a lowercase letter U) in the string. If I do ur\universe I get a

Re: Unicode raw string containing \u

2007-10-28 Thread Steven D'Aprano
On Sun, 28 Oct 2007 06:58:48 +, OKB (not okblacke) wrote: I'm trying to write a unicode raw string literal, and I seem to be running up against a conflict between the \u unicode character escape and the need to have a literal \u (i.e., backslash followed by a lowercase letter U) in

insert string problems..

2007-10-28 Thread Abandoned
Hi.. I want to insert some data to postgresql.. My insert code: yer=019 cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id)) I don't want to use % when the insert operation. in this code give me this error: psycopg2.ProgrammingError: syntax error at or near '019' LINE 1: SELECT link_id

Re: Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
Steven D'Aprano wrote: How can I specify a unicode raw string literal that contains a single backslash followed by the word universe? The usual way. word = u'\\universe' len(word) 9 word[0] u'\\' word[1] u'u' print word \universe word u'\\universe' That

Re: insert string problems..

2007-10-28 Thread Abandoned
Also.. a=123,245,1235,663 cursor.execute(SELECT id, name FROM data WHERE id in (%s), (a,)) In this query must be: SELECT id, name FROM data WHERE id in (123,245,1235,663) but it looks: SELECT id, name FROM data WHERE id in (123,245,1235,663) How can i delete ? --

Re: Going past the float size limits?

2007-10-28 Thread Hendrik van Rooyen
Steven D'Aprano steve.com.au wrote: Calculating numbers like 10**52 or its reciprocal is also a very good exercise in programming. Anyone can write a program to multiply two floating point numbers together and get a moderately accurate answer: product = X*Y # yawn But

Re: insert string problems..

2007-10-28 Thread Steven D'Aprano
On Sun, 28 Oct 2007 00:24:34 -0700, Abandoned wrote: Hi.. I want to insert some data to postgresql.. My insert code: yer=019 cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id)) I don't want to use % when the insert operation. in this code give me this error:

Re: Proposal: Decimal literals in Python.

2007-10-28 Thread Hendrik van Rooyen
Paul Hankin p...l.comwrote: Even clearer is not to allow octal literals :) Is there *any* use for them? I tend to agree with this point of view - but I fear it will set up a howl of protest amongst the Brits who cut their teeth on 24 bit ICT/ICL equipment... - Hendrik --

Re: insert string problems..

2007-10-28 Thread Abandoned
On Oct 28, 9:45 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 28 Oct 2007 00:24:34 -0700, Abandoned wrote: Hi.. I want to insert some data to postgresql.. My insert code: yer=019 cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id)) I don't want to use

Re: insert string problems..

2007-10-28 Thread Marc 'BlackJack' Rintsch
On Sun, 28 Oct 2007 00:24:34 -0700, Abandoned wrote: Hi.. I want to insert some data to postgresql.. My insert code: yer=019 cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id)) I don't want to use % when the insert operation. in this code give me this error:

Re: Unicode raw string containing \u

2007-10-28 Thread Martin v. Löwis
That doesn't answer my question, since I asked for a unicode RAW string literal. Is this not possible? (I was able to get what I want using ur\u005Cuniverse, although this is not totally ideal.) It's a design flaw in Unicode raw string literals that they still interpret \u escapes.

Need some help...

2007-10-28 Thread hyozan . ux3
I want to create a program that I type in a word. for example... chaos each letter equals a number A=1 B=20 and so on. So Chaos would be C=13 H=4 A=1 O=7 S=5 I want to then have those numbers 13+4+1+7+5 added together to be 30. How can I do that? Also, just curious, but, how could I

Re: elementtree w/utf8

2007-10-28 Thread Stefan Behnel
Tim Arnold wrote: On a related note, I have another question--where/how can I get the cElementTree.py module? Sorry for something so basic, but I tried installing cElementTree, but while I could compile with setup.py build, I didn't end up with a cElementTree.py file anywhere. That's

How to compile a 32 bit version python on a 64 bit linux platform

2007-10-28 Thread alexdboy
Hi, I'm trying to build a 32 bit version Python from the source of Python 2.4.2 (later version is O.K. too) on a 64 bit platform SUSE Linux Entrprise Server 10(x86_64) - Kernel 2.6.16.21-0.8-smp(5). I followed the common routine 1)./configure --enable-shared --with-threads 2)make clean;

Re: simple question on dictionary usage

2007-10-28 Thread bearophileHUGS
Marc 'BlackJack' Rintsch``s.startswith('E')`` is a little safer than ``s[0] == 'E'`` as the former returns `False` if `s` is empty while the latter raises an `IndexError`. Thank you. In this problem if there is an empty key in the record dict then maybe it's better to raise an IndexError, because

Re: Need some help...

2007-10-28 Thread bearophileHUGS
I want to create a program that I type in a word. You can see that Python has a command to input strings from the command line. chaos each letter equals a number A=1 B=20 and so on. So Chaos would be C=13 H=4 A=1 O=7 S=5 I want to then have those numbers 13+4+1+7+5 added together

Re: Need some help...

2007-10-28 Thread martyw
[EMAIL PROTECTED] wrote: I want to create a program that I type in a word. You can see that Python has a command to input strings from the command line. chaos each letter equals a number A=1 B=20 and so on. So Chaos would be C=13 H=4 A=1 O=7 S=5 I want to then have those

Using matplotlib/wxpython on XP embedded

2007-10-28 Thread Jürgen Kareta
Hello List, my customer is looking for an application to show some simple 2d graphs based on messured data. I'm consider to use wxpython, matplotlib and py2exe to build and compile this application. Mayby I also like to use WxMPL and inosetup. The target platform is XP embedded. As I don't

Re: iterating over the other and finding the greatest

2007-10-28 Thread Tim Chase
have carry out a process ab then i should print the line and if bc then i should print the line and cd then i should print... like this i have to continue.say for eg: 43387 so the first row is omitted, 387 is greater then 98 so i can print the line second row... my code: fh =

Which index can i use ?

2007-10-28 Thread Abandoned
Hi.. I want to do index in postgresql python. My table: id(int) | id2(int) | w(int) | d(int) My query: select id, w where id=x and id2=y (sometimes and d=z) I have too many insert and select operation on this table. And which index type can i use ? Btree, Rtree, Gist or Hash ? Also I want to

Re: fclient project seeking co-coders

2007-10-28 Thread kirby urner
Another Urner, that's interesting. Not many of us. Kirby Urner Portland, Oregon USA On 10/28/07, Jürgen Urner [EMAIL PROTECTED] wrote: Hello all, I Just recently registered a project fclient to sourceforge.net [http://sourceforge.net/projects/fclient]. fclient is intended to become

Re: Which index can i use ?

2007-10-28 Thread Marc 'BlackJack' Rintsch
On Sun, 28 Oct 2007 06:00:19 -0700, Abandoned wrote: Hi.. I want to do index in postgresql python. My table: id(int) | id2(int) | w(int) | d(int) My query: select id, w where id=x and id2=y (sometimes and d=z) I have too many insert and select operation on this table. And which index

Re: Need some help...

2007-10-28 Thread Peter Decker
On 10/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I want to then have those numbers 13+4+1+7+5 added together to be 30. How can I do that? Also, just curious, but, how could I then have the 3 and 0 added together to be 3? Please help me out. Will you put our names on your homework

caluclating median distance

2007-10-28 Thread Beema shafreen
hi everybody, I have a file 1175123443A_16_P03652190 12771336387A_16_P41582022 1723178298A_16_P03652191 18801932270A_16_P41582024 1000120210001261539A_16_P41582025 1000180010001859

Return value from os.system() call

2007-10-28 Thread Calder Coalson
I was searching for ways to get the return value from os.system() calls, when I came across this from 6 years ago. I tried what was suggested in this thread, but output = os.popen(/tmp/other).read() returns sh: line 1: /tmp/other: Permission denied I'm relatively new to Python, hardly ever

Re: Return value from os.system() call

2007-10-28 Thread Wildemar Wildenburger
Calder Coalson wrote: I was searching for ways to get the return value from os.system() calls, when I came across this from 6 years ago. I tried what was suggested in this thread, but output = os.popen(/tmp/other).read() returns sh: line 1: /tmp/other: Permission denied I would assume

how to convert tuple to a list of single values ?

2007-10-28 Thread stef mientki
hello, The next piece of code bothers me: ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 ) dc.SetClippingRegion ( ptx, pty, rectWidth, rectHeight ) Because I want to write it in 1 line, and without the use of intermediate variables (for which I have to invent

Re: how to convert tuple to a list of single values ?

2007-10-28 Thread Duncan Booth
stef mientki [EMAIL PROTECTED] wrote: hello, The next piece of code bothers me: ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 ) dc.SetClippingRegion ( ptx, pty, rectWidth, rectHeight ) Because I want to write it in 1 line, and without the use of

Re: how to convert tuple to a list of single values ?

2007-10-28 Thread Matthieu Brucher
Use : something = self._point2ClientCoord (p1, p2 ) dc.SetClippingRegion (*something) Matthieu 2007/10/28, stef mientki [EMAIL PROTECTED]: hello, The next piece of code bothers me: ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 )

Re: os.walk and recursive deletion

2007-10-28 Thread Martin Marcher
27 Oct 2007 17:38:10 GMT, Marc 'BlackJack' Rintsch [EMAIL PROTECTED]: On Sat, 27 Oct 2007 18:07:44 +0200, Martin Marcher wrote: I'm playing around with os.walk and I made up del_tree(path) which I think is correct (in terms of the algorithm, but not as python wants it :)). It's not

Re: how to convert tuple to a list of single values ?

2007-10-28 Thread stef mientki
thanks Duncan, Matthieu and Ed (offlist), this is exactly what I was looking for. cheers, Stef Duncan Booth wrote: stef mientki [EMAIL PROTECTED] wrote: hello, The next piece of code bothers me: ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 )

Weird AttributeError With Imports

2007-10-28 Thread Juha S.
I'm getting a AttributeError: 'module' object has no attribute 'clock' when importing a module from within two packages related to the line: self.lastTime = time.clock() in the __init__() of the class Time in the target module. The module (mytime.py) sits in a package hierarchy such as the

Re: modifying __class__

2007-10-28 Thread Gabriel Genellina
En Fri, 26 Oct 2007 04:49:37 -0300, Evan Klitzke [EMAIL PROTECTED] escribi�: On 10/26/07, Piyush Jain [EMAIL PROTECTED] wrote: Hi, Itis possible to change the class of an object by assigning new value to __class__ Is it possible to call my module when it is done. For example, object =

Re: Weird AttributeError With Imports

2007-10-28 Thread Peter Otten
Juha S. wrote: I'm getting a AttributeError: 'module' object has no attribute 'clock' when importing a module from within two packages related to the line: self.lastTime = time.clock() in the __init__() of the class Time in the target module. You probably have a time module that you wrote

Pari Python

2007-10-28 Thread Anton Mellit
Hi, I am working on a Pari-Python module (see about GP/PARI at http://pari.math.u-bordeaux.fr/). Similar project was started by Stefane Fermigier 12 years ago (you can find a post about it on this newsgroup). You can see some screenshots on my blog (http://

Re: Weird AttributeError With Imports

2007-10-28 Thread Juha S.
Peter Otten wrote: Juha S. wrote: I'm getting a AttributeError: 'module' object has no attribute 'clock' when importing a module from within two packages related to the line: self.lastTime = time.clock() in the __init__() of the class Time in the target module. You probably

Getting callfunc from ast code.

2007-10-28 Thread Glich
Hi, how can I extend the code shown below so that I can identify any CallFunc in func.code and identify the value of node in CallFunc? Thanks. This is my code so far: Given a python file, this program prints out each function's name in that file, the line number and the ast code of that

Re: while within while

2007-10-28 Thread Tony
Shawn Minisall wrote: Snip also, surely it should be paper covers rock? Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: fclient project seeking co-coders

2007-10-28 Thread David Boddie
On Sun Oct 28 11:49:17 CET 2007, Jürgen Urner wrote: I Just recently registered a project fclient to sourceforge.net [http://sourceforge.net/projects/fclient]. fclient is intended to become desktop client for the freenet [freenetproject.org] network written in python and Qt4. It sounds like

Re: simple question on dictionary usage

2007-10-28 Thread Martin v. Löwis
egt = {} for key in record: if key.startswith('E'): egt[key] = record[key] I actually had come up with something like this, but thought it wasn't quite as pythonish as it should be. It is certainly much more readable to a neophyte to python. My recommendation: forget about the

Capturing output with input

2007-10-28 Thread gopala
Hi, I am pretty new to python but i do have experience with c++. As a part of learning exercise i wrote a python script to insert beautifying comments(with name, problem...) to our lab program source files (c language). The script is working for most of the cases. The problem is i also need to

Re: Is the subprocess module thread-safe?

2007-10-28 Thread Martin v. Löwis
Can the subprocess module be used to launch subprocesses from threads? The answer to this question (can) is a clear yes. Notice that this question is different from the question in the subject. Or does the subprocess module affect the entire process context, like fork? On POSIX systems,

Re: Getting callfunc from ast code.

2007-10-28 Thread Paul Boddie
On 28 Okt, 19:09, Glich [EMAIL PROTECTED] wrote: Hi, how can I extend the code shown below so that I can identify any CallFunc in func.code and identify the value of node in CallFunc? Thanks. This is my code so far: I tend to use isinstance to work out what kind of AST node I'm looking at,

Re: Pari Python

2007-10-28 Thread [EMAIL PROTECTED]
On Oct 28, 12:45 pm, Anton Mellit [EMAIL PROTECTED] wrote: Hi, I am working on a Pari-Python module (see about GP/PARI athttp://pari.math.u-bordeaux.fr/). Similar project was started by Stefane Fermigier 12 years ago (you can find a post about it on this newsgroup). You can see some

Re: Going past the float size limits?

2007-10-28 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: You can't just say: product = map(operator.mul, [A*T*C*G]*20) and expect to get anywhere. from math import log A,T,C,G = (0.35, 0.30, 0.25, 0.10) c,m = divmod(20*log(A*T*C*G,10), 1) print %.3fe%d%(m, int(c)) --

Re: Going past the float size limits?

2007-10-28 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: c,m = divmod(20*log(A*T*C*G,10), 1) print %.3fe%d%(m, int(c)) Barf. Left as exercise: fix the error. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pari Python

2007-10-28 Thread Robert Kern
Anton Mellit wrote: Hi, I am working on a Pari-Python module (see about GP/PARI at http://pari.math.u-bordeaux.fr/). Similar project was started by Stefane Fermigier 12 years ago (you can find a post about it on this newsgroup). You can see some screenshots on my blog (http://

Readline on OS X for trunk build

2007-10-28 Thread James Thiele
Just got the trunk out of svn to build 2.6 alpha on OS X 10.4(Tiger). No readline. I can't remember what I did to get it when I built 2.5 but it works there. Google searches are bringing up what to do for the Python 2.3 that comes with OS X 10.4. Could someone point me in the right direction?

Re: finding out the call (and not only the caller)

2007-10-28 Thread Carl Friedrich Bolz
Hi Neal, [EMAIL PROTECTED] wrote: The code doesn't handle all the cases (e.g., nested functions), but gives you an idea of what can be done and where to look for the info (ie, in the stack frame and how to parse the byte codes to some extent). For nested functions, look in co_consts.

Problem--IOError: [Errno 13] Permission denied

2007-10-28 Thread patrick . waldo
Hi all, After sludging my way through many obstacles with this interesting puzzle of a text parsing program, I found myself with one final error: Traceback (most recent call last): File C:\Python24\Lib\site-packages\pythonwin\pywin\framework \scriptutils.py, line 310, in RunScript exec

Going past the float size limits?

2007-10-28 Thread Fredrik Johansson
jimmy.musselwhite at gmail.com wrote: Hello all It would be great if I could make a number that can go beyond current size limitations. Is there any sort of external library that can have infinitely huge numbers? Way way way way beyond say 5x10^350 or whatever it is? I'm hitting that inf

Re: Questions for the Python Devs Out There

2007-10-28 Thread Terry Reedy
Ann Thompson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | If you know of places that I might be able to post queries for python | developers, I'm certainly open to suggestions. Many people involved with Python and gaming subscribe to the pygame mailing list, also accessible as

Re: Pari Python

2007-10-28 Thread Anton Mellit
Does your version use the GMP library (optional in PARI). Does it support Windows? I couldn't tell if the PARI Windows distribution has GMP, but I suspect not since GMP doesn't support Windows. No, I didn't try to use gmp. But this may be not a bad idea. I am trying to compile gmp right now.

coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread Ben Finney
Howdy all, Ned Batchelder has been maintaining the nice simple tool 'coverage.py' URL:http://nedbatchelder.com/code/modules/coverage.html for measuring unit test coverage. On the same site, Ned includes documentation URL:http://nedbatchelder.com/code/modules/rees-coverage.html by the previous

Re: Pari Python

2007-10-28 Thread Anton Mellit
Have you looked at SAGE at all? They already have wrappers for Pari. Well :) I expected that question. I tried. But the distribution for windows is so big :( (2GB) and I could not build it on cygwin, where it is also pretty big. And I so much like pari - it is so light and simple and still can

Re: Proposal: Decimal literals in Python.

2007-10-28 Thread Tim Roberts
MRAB [EMAIL PROTECTED] wrote: On Oct 27, 12:12 am, Ben Finney [EMAIL PROTECTED] wrote: Matimus [EMAIL PROTECTED] writes: The trailing L [for 'long' literals] is going away in Python 3.0. Yes. On the other hand, we are gaining '0b' for binary literals, to go along with '0o' for octal

Re: Proposal: Decimal literals in Python.

2007-10-28 Thread Tim Roberts
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Paul Hankin p...l.comwrote: Even clearer is not to allow octal literals :) Is there *any* use for them? I tend to agree with this point of view - but I fear it will set up a howl of protest amongst the Brits who cut their teeth on 24 bit ICT/ICL

Re: Pari Python

2007-10-28 Thread Michael L Torrie
Anton Mellit wrote: And I think (correct me if I am wrong) that the ^ operator (xor) is used very very infrequently. And it is not difficult to replace all ^ with say ^^. The division is probably used more often, but python has this trend anyway - to replace division with 'true' division, so

Re: Pari Python

2007-10-28 Thread Robert Kern
Anton Mellit wrote: Have you looked at SAGE at all? They already have wrappers for Pari. Well :) I expected that question. I tried. But the distribution for windows is so big :( (2GB) and I could not build it on cygwin, where it is also pretty big. And I so much like pari - it is so light

Re: Getting callfunc from ast code.

2007-10-28 Thread Glich
Your help is very useful. I would not be able to progress without you! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread John Roth
On Oct 28, 4:56 pm, Ben Finney [EMAIL PROTECTED] wrote: Howdy all, Ned Batchelder has been maintaining the nice simple tool 'coverage.py' URL:http://nedbatchelder.com/code/modules/coverage.html for measuring unit test coverage. On the same site, Ned includes documentation

Re: while within while

2007-10-28 Thread Shawn Minisall
Thanks a lot for your suggestions. Unfortunately, a lot of the issues brought up were simply the way I was taught by my professor and the way she wants things done,having to use a numbered menu as opposed to entering r, p or s, being taught just to use one main function for the entire

Re: Pari Python

2007-10-28 Thread J. Cliff Dyer
Anton Mellit wrote: And I think (correct me if I am wrong) that the ^ operator (xor) is used very very infrequently. And it is not difficult to replace all ^ with say ^^. Oh God! *Please* don't start that conversation again. We had a thread about bitwise operators a few weeks back. Half the

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread Ben Finney
John Roth [EMAIL PROTECTED] writes: On Oct 28, 4:56 pm, Ben Finney [EMAIL PROTECTED] wrote: What approach could we take to improve 'coverage.py' such that it *can* instrument and report on all branches within the written code module, including those hidden inside multi-part statements?

PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Howdy all, PEP 299 URL:http://www.python.org/dev/peps/pep-0299 details an enhancement for entry points to Python programs: a module attribute (named '__main__') that will be automatically called if the module is run as a program. The PEP has status Rejected, citing backward-compatibility issues,

Re: simple question on dictionary usage

2007-10-28 Thread George Sakkis
On Oct 27, 8:58 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 27 Oct 2007 05:23:30 -0700, bearophileHUGS wrote: My take too :-) dict(item for item in record.iteritems() if item[0][0] == 'E') ``s.startswith('E')`` is a little safer than ``s[0] == 'E'`` as the former returns

7000+ beautiful Russian girls waiting for men

2007-10-28 Thread my glass
7000+ beautiful Russian girls waiting for men http://groups.google.com/group/all-good-things/web/beautiful-girls-and-ladies -- http://mail.python.org/mailman/listinfo/python-list

New

2007-10-28 Thread jkbiwott2002
Hi! Am new to Python and am looking for a sample project that demonstrates how to connect to MySQL, save data in MySQL database using a form on a web page. Regards, Joseph -- http://mail.python.org/mailman/listinfo/python-list

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread Kay Schluehr
On Oct 28, 11:56 pm, Ben Finney [EMAIL PROTECTED] wrote: Howdy all, Ned Batchelder has been maintaining the nice simple tool 'coverage.py' URL:http://nedbatchelder.com/code/modules/coverage.html for measuring unit test coverage. On the same site, Ned includes documentation

ANNOUNCE: wxPython 2.8.6.1

2007-10-28 Thread Robin Dunn
Announcing -- The 2.8.6.1 release of wxPython is now available for download at http://wxpython.org/download.php. This release has a number of important bug fixes and is a general improvement of the 2.8.6.0 release. Source code is available, as well as binaries for Python 2.3, 2.4 and

clear shell screen

2007-10-28 Thread Shawn Minisall
Does anyone know how to clear the shell screen completely ? I tried import os and then os.system(clear) was said to have worked in Windows XP, but it's just bringing up another window, then it turns black and then it closes in within about a second moving the prompt at the os.system(clear)

Re: Anagrams

2007-10-28 Thread Gabriel Genellina
En Thu, 25 Oct 2007 00:40:12 -0300, sandipm [EMAIL PROTECTED] escribi�: thanks..I am using python 2.4.4. so i couldnt find all either as inbuilt module or by doing from itertools import *, all is not available. I think I need to move to 2.5 then It's easy to write in pure Python:

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread Ben Finney
Kay Schluehr [EMAIL PROTECTED] writes: I used to write once a coverage tool ( maybe I can factor this out of my tool suite some time ) That'd be wonderful. I'd like to see comparisons between different test-coverage tools, just as we have the different but comparable 'pyflakes' and 'pylint'

Re: PEP 299 and unit testing

2007-10-28 Thread Steven Bethard
Ben Finney wrote: What it doesn't allow is for the testing of the 'if __name__ == __main__:' clause itself. No matter how simple we make that, it's still functional code that can contain errors, be they obvious or subtle; yet it's code that *can't* be touched by the unit test (by design, it

Re: caluclating median distance

2007-10-28 Thread Gabriel Genellina
En Sun, 28 Oct 2007 11:13:39 -0300, Beema shafreen [EMAIL PROTECTED] escribi�: 1175123443A_16_P03652190 12771336387A_16_P41582022 1723178298A_16_P03652191 how to calculate the median spacing of an data in the file basically

Re: Capturing output with input

2007-10-28 Thread Gabriel Genellina
En Sun, 28 Oct 2007 15:39:07 -0300, gopala [EMAIL PROTECTED] escribi�: My initial attempts of using spawn.. , exec.. pipe.. failed since they can't capture the std input and std output continuously. The lab1.exe will be something like Enter 2 nos 2 3 The sum is 5 Now i should be able

Re: Easiest way to get exit code from os.popen()?

2007-10-28 Thread Gabriel Genellina
En Wed, 24 Oct 2007 16:07:44 -0300, mrstephengross [EMAIL PROTECTED] escribi�: Hi folks. I'm using os.popen() to run a command; according to the documentation, the filehandle.close() oepration is suppsoed to return the exit code. However, when I execute something like exit 5, close()

Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Steven Bethard [EMAIL PROTECTED] writes: Ben Finney wrote: What it doesn't allow is for the testing of the 'if __name__ == __main__:' clause itself. No matter how simple we make that, it's still functional code that can contain errors, be they obvious or subtle; yet it's code that

iPod Library

2007-10-28 Thread D
Is there a Python library available that will allow you to read/write from the database of an iPod 3G and 5G? Basically, I'm sick of iTunes and would much rather write a simple program myself. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 299 and unit testing

2007-10-28 Thread Steven Bethard
Ben Finney wrote: Steven Bethard [EMAIL PROTECTED] writes: Ben Finney wrote: What it doesn't allow is for the testing of the 'if __name__ == __main__:' clause itself. No matter how simple we make that, it's still functional code that can contain errors, be they obvious or subtle; yet it's

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-28 Thread Kay Schluehr
On Oct 29, 4:15 am, Ben Finney [EMAIL PROTECTED] wrote: Kay Schluehr [EMAIL PROTECTED] writes: I used to write once a coverage tool ( maybe I can factor this out of my tool suite some time ) That'd be wonderful. I'd like to see comparisons between different test-coverage tools, just as we

Any library parsing wikipedia API

2007-10-28 Thread est
I got some text via wikipedia API http://en.wikipedia.org/w/api.php?action=queryprop=revisionstitles=Chengdurvprop=contentredirectsformat=xmlcallback=wikiCallback but it's not HTML formated. So how can I parse these texts to standard HTML? Are there any library in python could do this? --

Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Steven Bethard [EMAIL PROTECTED] writes: Ben Finney wrote: Thanks! I was unaware of that module. It does seem to nicely address the issue I discussed. You might try the runpy module as-is with Python 2.4. I don't know if it works, but it's pure Python so it's worth a try. Drat. It uses

Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Ben Finney [EMAIL PROTECTED] writes: Steven Bethard [EMAIL PROTECTED] writes: Ben Finney wrote: What it doesn't allow is for the testing of the 'if __name__ == __main__:' clause itself. No matter how simple we make that, it's still functional code that can contain errors, be they

[OT] Re: Proposal: Decimal literals in Python.

2007-10-28 Thread Gabriel Genellina
En Fri, 26 Oct 2007 23:28:31 -0300, Carl Banks [EMAIL PROTECTED] escribi�: FYI: The $ sign is used to denote currency in many countries; as a rule of thumb countties that call their currency dollars or pesos use the $. So Mexico, Canada, Australia, much of Latin America, much of the

IEC - cannot find button

2007-10-28 Thread daniel_nolan
I'm brand new to Python--and programming in general. I'm trying to use IEC to control Internet Explorer. I've navigated to a page, and now I'm trying to click a button. The button appears to be called 'PDF Preview' but I honestly do not know whether that's the name or the caption. Here is my code:

Solaris 10 + Sun Studio 12 Pyrhon 2.4.4 64-bit build problem

2007-10-28 Thread plumb and tree
I've been trying for days to build 64 bit python with Solaris 10 + Sun Studio 12. Can anyone helpl please. This is how I tried to do build: # ./configure --prefix=/opt/python2.4 --without-gcc --enable-shared checking MACHDEP... sunos5 checking EXTRAPLATDIR... checking for --without-gcc... yes

Help with pyparsing and dealing with null values

2007-10-28 Thread avidfan
Help with pyparsing and dealing with null values I am trying to parse a log file (web.out) similar to this: --- MBeanName: mtg-model:Name=mtg-model_managed2,Type=Server AcceptBacklog: 50 AdministrationPort: 0

Kudzu Version of SonomaSunshine

2007-10-28 Thread SamFeltus
Funkiest SonomaSunshine page ever... A slim, trim 30ish MB page, leaves time for fetching a beer or some coffee. Takes about 10 minutes to watch. Yet another example of using Django to generate frilly, colorful Flash pages instead of more of that hypertext stuff... :)

Re: Weird AttributeError With Imports

2007-10-28 Thread Gabriel Genellina
En Sun, 28 Oct 2007 14:50:24 -0300, Juha S. [EMAIL PROTECTED] escribi�: Peter Otten wrote: You probably have a time module that you wrote yourself and which is now hiding the one in python's standard library. Was your mytime.py formerly named time.py, and if so, did you remove the

Re: clear shell screen

2007-10-28 Thread Gabriel Genellina
En Mon, 29 Oct 2007 00:08:14 -0300, Shawn Minisall [EMAIL PROTECTED] escribi�: Does anyone know how to clear the shell screen completely ? I tried import os and then os.system(clear) was said to have worked in Windows XP, but it's just bringing up another window, then it turns black and

Function to resize global numpy array interactively in ipython

2007-10-28 Thread David Sanders
Hi, I have a script with function definitions which I load into ipython for interactive use. These functions modify a global numpy array, whose size I need to be able to change interactively. I thus have a script which looks like this: from numpy import * def do_resize(N): global a

[issue1345] Fix for test_netrc on Windows

2007-10-28 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1345 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1347] BaseHTTPServer writing strings to bytes interface

2007-10-28 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1347 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2007-10-28 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1350 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1348] httplib closes socket, then tries to read from it

2007-10-28 Thread Bill Janssen
Bill Janssen added the comment: I still think the semantics are wrong here, but someone needs to close this connection at some point, and right now the reference-counting semantics of socket.close() are the only thing preventing a leak. So I think my patch should not be applied. Instead, a

[issue1352] Preliminary stderr patch

2007-10-28 Thread Christian Heimes
New submission from Christian Heimes: Here is another patch related to stdio from me. It creates and sets up a very dumb and easy stderr writer until the new io infrastructure is initialized. It makes debugging problems in the init phase much easier. -- components: Interpreter Core

[issue1340] correction for test_tempfile in py3k on Windows

2007-10-28 Thread Guido van Rossum
Guido van Rossum added the comment: Committed revision 58699. (My own interpretation of the patch, with comment :-) I expect this will fix a bunch Windows failures; I've seen complaints inmplicating doubled newlines in a few places, and this mught just be the cause. Thanks! --

[issue1329] Different 3.0a1 exit behavior

2007-10-28 Thread Jean Brouwers
Jean Brouwers added the comment: One more argument. Without a fix, 3.0 would not even print a C debug message from a destructor function nor from any function installed with atexit or Py_AtExit. The dlibtest shows that for 2 of these 3. __ Tracker [EMAIL

[issue1340] correction for test_tempfile in py3k on Windows

2007-10-28 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: Guido van Rossum added the comment: D'oh, I submitted to the wrong branch. The py3k branch will have to wait until after my son's birthday party. ;-) Have a nice party! How old is he? IIRC he was about 4 on the pictures you

  1   2   >