Professional Grant Proposal Writing Workshop (September 2007: Simon Fraser University)

2007-07-21 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at Simon Fraser University at Harbour Centre, September 12 - 14 , 2007. Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand mean

Re: dejagnu equivalent

2007-07-21 Thread Paddy
On Jul 18, 7:05 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > Does anyone know if a dejagnu equivalent exists for python? > [Dejagnu is in tcl] Maybe http://www.codesourcery.com/public/qmtest/whitepaper.pdf ? I have not used it though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting dict keys

2007-07-21 Thread montyphyton
On 21 srp, 02:31, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 20 Jul 2007 15:27:51 -0700, montyphyton wrote: > b = a.keys() > b.sort() > > [1, 2, 3] > > > Works fine, but I would really like it if I could somehow do it in one > > line. > > Why? Is the Enter key on your keyboard b

ANN: eric 4.0.1 release

2007-07-21 Thread Detlev Offenbach
Hi, I would like to announce the immediate availability of eric 4.0.1. This is a bug fix release. As usual it is available via http://www.die-offenbachs.de/eric/index.html Just follow the eric4 download link. What is eric eric is a Python IDE with all batteries included. For detail

Re: Permutations with generators

2007-07-21 Thread Bjoern Schliessmann
Pablo Torres wrote: > AttributeError: 'NoneType' object has no attribute 'insert' > > Could somebody please explain to me why my p variable has no type > at all? It does have a type, NoneType. As already explained, only None normally is of type NoneType. Regards, Björn -- BOFH excuse #281:

Re: Sorting dict keys

2007-07-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I'd like to do it in one line because what I am trying to do is, > after all, a single, simple enough action. No, it's two actions: 1. You extract a list of keys from the dict 2. you sort it > I find the suggested b = sorted(a.keys()) much more readable than > brea

h grup

2007-07-21 Thread kasim
Dear __, I recently joined AGLOCO because of a friend recommended it to me. I am now promoting it to you because I like the idea and I want you to share in what I think will be an exciting new Internet concept. AGLOCO's story is simple: Do you realize how valuable you are? Advertisers, se

Re: Spam filter?

2007-07-21 Thread Steve Holden
Danyelle Gragsone wrote: > So, > > Can mailing lists have its mail filtered? I get more spam via mailing > lists than I do in my own inbox. I am not just singling this mailing > list. I see it a lot now. > If you had searched the list you would have found that this topic has been discussed fr

Re: Pickled objects over the network

2007-07-21 Thread Steve Holden
Hendrik van Rooyen wrote: > "Steve Holden" <[EMAIL PROTECTED]> wrote: > >> Hmm, I suspect I detect the sounds of the square wheel being reinvented. > > Very helpful, thank you, Steve - Now how about pointing out in which > direction the round wheels are kept, and what their monikers are? > I thi

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-21 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >> The issue I have with correctness proofs (at least as they were >> presented in the 1980s - for all I know the claims may have become >> more realistic now) is that the proof of correctness can only relate >> to some highly-formal spec

Re: class C: vs class C(object):

2007-07-21 Thread Aahz
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Aahz a écrit : >> In article <[EMAIL PROTECTED]>, >> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >>> >>> To make a long story short: Python 2.2 introduced a new object model >>> which is more coherent and more pow

Re: Pythonic way for missing dict keys

2007-07-21 Thread Bruno Desthuilliers
Alex Popescu a écrit : > Hi all! > > I am pretty sure this has been asked a couple of times, but I don't seem > to find it on the archives (Google seems to have a couple of problems > lately). > > I am wondering what is the most pythonic way of dealing with missing > keys and default values. >

Re: Pythonic way for missing dict keys

2007-07-21 Thread Bruno Desthuilliers
Alex Popescu a écrit : > Jakub Stolarski <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>Version 1 and 2 do different thing than version 3. The latter doesn't >>add value to dict. >> >>As it was mentioned before, use: >>1 - if you expect that there's no key in dict >>2 - if you expe

Re: Weird errors when trying to access a dictionary key

2007-07-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have a data structure that looks like this: > (snip) > > I get the following error: (snip) > AttributeError: 'list' object has no attribute 'keys' Already answered. > Here is where it gets weird: > > type(song) (snip) > TypeError: 'str' object is not callable Y

Re: class C: vs class C(object):

2007-07-21 Thread Bruno Desthuilliers
George Sakkis a écrit : > On Jul 20, 5:40 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > >>Aahz a écrit : >> >> >>>In article <[EMAIL PROTECTED]>, >>>Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >>> To make a long story short: Python 2.2 introduced a new object model which is more

Re: Sorting dict keys

2007-07-21 Thread zacherates
>From ESR's "Why python?" b = a.keys(); b.sort() Two statements, one line. Doesn't create an incidental copy the way sorted does but I'm not sure how much you like to jam on one line. Cheers, Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-21 Thread Alex Martelli
Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sat, 21 Jul 2007 09:22:32 +0530, Rustom Mody wrote > > Can someone who knows about python internals throw some light on why > > >>> x in dic > > is cheaper than > > >>> dic.has_key(x) > > > > ?? > > I won't claim to know Python internals, but compili

Re: Pythonic way for missing dict keys

2007-07-21 Thread Alex Popescu
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Alex Popescu a écrit : >> Jakub Stolarski <[EMAIL PROTECTED]> wrote in > > > [snip...] > > > d = dict() > answer = d.get('answer', 42) > answer in d > => False > Thanks. I think to make the 3rd approach completely eq

Re: code packaging

2007-07-21 Thread John J. Lee
Paul Rubin writes: [...] > I'm now wondering where this type of thing is best addressed in more > general terms. What I usually see happening, in projects I've worked > on and in others, is that developers get the code working on their own > computers, using source contr

Re: Pythonic way for missing dict keys

2007-07-21 Thread Duncan Booth
"Rustom Mody" <[EMAIL PROTECTED]> wrote: > Can someone who knows about python internals throw some light on why x in dic > is cheaper than dic.has_key(x) > > ?? > Some special methods are optimised by having a reserved slot in the data structure used to implement a class. The 'in' ope

RE: code packaging

2007-07-21 Thread Alex Popescu
"Ryan Ginstrom" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: >> On Behalf Of Paul Rubin >> I'm wondering how other projects go about this. > > I develop an automated build system from the very beginning. Running > the build script: > * Creates the API documentation (epydoc) > * Creates t

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
On Jul 13, 7:50 pm, Dan Stromberg - Datallegro <[EMAIL PROTECTED]> wrote: > You could start up a pty and do your own Pexpect-like thing, using > read/readline/write. > > However, this may not be portable to windows. Maybe if you get the python > that comes with cygwin, or build your own python und

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
send keys for the p.c. you can use a try: except: concept and on the > windows platform there is also a way to use autoit in python using > pywin. thanks for the uggestion about sendkeys. I might be able to build that into the wrapper. So you're sugesting: NIX = Pexpect WINDOZE = sendkeys Cor

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
Thanks for your response. It;s good to see you're promtoing Pexpect. I was actualy wokring on a project at work that could have used Pexpect to automate the creation of maps by tieing togethr a bunch of processes through SSH and Pexpect looked like the money shot. however it was enough of a battle

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
> You probably > mean:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > Why is that not sufficient? It will allow interaction with a called > subprocess, in a cross-platform manner, etc. > > - Josiah Sorry maybe 'not sufficient' was the wrong excuse. Maybe the right thing to

importing a module from a specific directory

2007-07-21 Thread Yoav Goldberg
I'm using python for research related programming, and so I write many experimental small pieces of code. I would like to organize them into directory structure in which there is a 'main' directory, and under it directories for specific sub-tasks, or sub-experiments, I'm running (let's call them

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-21 Thread Kay Schluehr
On Jul 20, 6:28 pm, Paul Rubin wrote: > As the Intel FDIV bug > incident reminds us, even billions of test inputs are not enough to > show that the routine does the right thing for EVERY input. When I remember correctly the FDIV bug was due to a wrongly filled lookup ta

Re: converting 64-bit fixed-point to float

2007-07-21 Thread [EMAIL PROTECTED]
On Jul 20, 5:59 pm, [EMAIL PROTECTED] (John Fisher) wrote: > Hi Group, > > troubles with converting signed 32.32, little-endian, 2's complement > back to floating point. I have been trying to brew it myself. I am > running Python 2.5 on a Mac. Here is the C-code I have been trying to > leverage: >

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-21 Thread Paul Rubin
Kay Schluehr <[EMAIL PROTECTED]> writes: > When I remember correctly the FDIV bug was due to a wrongly filled > lookup table and occurred only for certain bitpattern in the divisor. > I'm not sure how a formal proof on the structure of the algorithm > could help here? Intel repaired the table i.e.

►►YOUR VALUABLE OPINION COULD EARN YOU $3000 ◄◄

2007-07-21 Thread Ana Clark
Do You Know Your VALUABLE OPINION Can Earn You Upto $3000 Per Month >> Get Paid to Try New Products, Drive Car, Travel etc... Know more about these Opportunities, Just follow the link: http://shortlinks.co.uk/35x -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-21 Thread Zentrader
On Jul 21, 7:48 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Rustom Mody" <[EMAIL PROTECTED]> wrote: > > Can someone who knows about python internals throw some light on why > x in dic > > is cheaper than > dic.has_key(x) > > > ?? > >From the 2.6 PEP #361 (looks like dict.has_key is de

Re: Interpreting os.lstat()

2007-07-21 Thread Sion Arrowsmith
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >> But it obviously does a lot of other stuff, including formatting >> the results of the system call for display. >It most decisively does *not* format the results of the system call >"for display". "It" here refers to the p

Re: Interpreting os.lstat()

2007-07-21 Thread Martin v. Löwis
> Absolutely, which is why I consider it foolish for the OP to be > trying to deduce the meaning of os.stat by looking at the output > of the stat program, rather than studying the man page for the > stat system call. Ah, ok. I missed that the OP had brought stat(1) into the discussion. Now it's a

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-21 Thread John Nagle
Paul Rubin wrote: > Kay Schluehr <[EMAIL PROTECTED]> writes: > >>When I remember correctly the FDIV bug was due to a wrongly filled >>lookup table and occurred only for certain bitpattern in the divisor. >>I'm not sure how a formal proof on the structure of the algorithm >>could help here? Intel r

problem with exec

2007-07-21 Thread ...:::JA:::...
Hello, After my program read and translate this code: koristi os,sys; ispisi 'bok kaj ima'; into the: import os,sys; print 'bok kaj ima'; and when it run this code with "exec", I always get error like this, but I still dont't know what is a problem: Traceback (most recent call last): File "

Re: problem with exec

2007-07-21 Thread Steve Holden
...:::JA:::... wrote: > Hello, > > After my program read and translate this code: > > koristi os,sys; > ispisi 'bok kaj ima'; > > into the: > > import os,sys; > print 'bok kaj ima'; > > and when it run this code with "exec", I always get error like this, but I > still dont't know what is a pro

UnicodeDecodeError

2007-07-21 Thread Ken Seehart
I get this whenever I encounter a non-ascii character in a non-unicode string: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 23: ordinal not in range(128) The string in question is "... ESPA\xd1OL ..." I completely understand why I get the error, and my solution will be

pyodbc on linux

2007-07-21 Thread Sean Davis
I have read a couple of blogs suggesting that pyodbc is buildable under linux. I am running suse 10.2 on a 64-bit intel machine with unixODBC installed. Upon building, I get a slew of pretty horrid looking errors that make me wonder if this is supposed to work. Can anyone at least confirm that t

Re: UnicodeDecodeError

2007-07-21 Thread Ken Seehart
Um, never mind. The recent unicode conversation gave me my answer :-) unicode(s, 'Windows-1252') Ken Seehart wrote: > I get this whenever I encounter a non-ascii character in a non-unicode > string: > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 23: > ordinal not in r

Re: Python in Nashville

2007-07-21 Thread Erik Jones
Me! Did you just move here? On Jul 20, 2007, at 10:22 PM, Patrick Altman wrote: > Anyone on this group writing Python code in Nashville, TN? > > -- > http://mail.python.org/mailman/listinfo/python-list Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.29

The Convenience of Online Learning. The Benefits of a Respected Degree.Try Ellis College for Free.

2007-07-21 Thread KU
A fully accredited extension of The New York Institute of Technology (NYIT), Ellis College gives you the prestige of earning your Bachelor's Degree from a respected university with the convenience of learning online on your own schedule. Whether you're looking to begin a new career or advance an ex

The Convenience of Online Learning. The Benefits of a Respected Degree.Try Ellis College for Free.

2007-07-21 Thread KU
A fully accredited extension of The New York Institute of Technology (NYIT), Ellis College gives you the prestige of earning your Bachelor's Degree from a respected university with the convenience of learning online on your own schedule. Whether you're looking to begin a new career or advance an ex

Re: UTF-8 Support of Curses in Python 2.5

2007-07-21 Thread Andrey
Yes, it does solve the problem. Compile python with ncursesw library. Btw Ubuntu 7 has it "out of the box". > Hi All, > > Recently I ran into a problem with UTF-8 surrport when using curses > library in python 2.5 in Fedora 7. I found out that the program using > curses cannot print out unicode

Re: Pythonic way for missing dict keys

2007-07-21 Thread genro
On Jul 19, 6:29 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > Myobject will be instanciated each time, yes. > > > and so if the initialization is expensive you > > will probably see surprises. > > No "surprise" here, but it can indeed be suboptimal if instanciating > myobject is costly.

Re: problem with exec

2007-07-21 Thread Steven D'Aprano
On Sat, 21 Jul 2007 16:31:38 -0400, Steve Holden wrote: > I'm afraid I don't understand this question. If you are talking about > the indentation of the code, if you don't want indentation you will have > to use braces - { and } - to indicate the nesting structure of your program. Oh my, teasin

Re: converting 64-bit fixed-point to float

2007-07-21 Thread John Fisher
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Jul 20, 5:59 pm, [EMAIL PROTECTED] (John Fisher) wrote: > > Hi Group, > > > > troubles with converting signed 32.32, little-endian, 2's complement > > back to floating point. I have been trying to brew it myself. I am > > running Python 2.5 on a Ma

[2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Gilles Ganault
Hello I'm trying to extract information from a web page using the Re module, but it doesn't seem to support MULTILINE: = import re #NO CRLF : works response = "Blablabla" #CRLF : doesn't work response = "Blablabla\r\n" pattern = "Bla.+?" p = re.compile(pattern,re.IGNORECASE|re.MULT

Re: pyodbc on linux

2007-07-21 Thread ajaksu
On Jul 21, 5:54 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > I have read a couple of blogs suggesting that pyodbc is buildable > under linux. It is, following these wise words: "Aargghh! I see that possibly there was a typo in cursor.cpp at line 1385: Py_UNICODE* pNull = (Py_UNICODE*)wmemchr(pT, 0

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Carsten Haese
On Sun, 2007-07-22 at 04:09 +0200, Gilles Ganault wrote: > Hello > > I'm trying to extract information from a web page using the Re module, That's your problem right there. RE is not the right tool for that job. Use an actual HTML parser such as BeautifulSoup (http://www.crummy.com/software/Beaut

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > Use an actual HTML parser such as BeautifulSoup > (http://www.crummy.com/software/BeautifulSoup/) and your life will be > much easier. BeautifulSoup is a lot simpler to use than RE's but a heck of a lot slower. I ended up having to use RE's last time I

simpleJSON pack binary data

2007-07-21 Thread Andrey
Hi I donno if this is the right place to ask for this question, anyway Is it possible to pack binary data into simplejson? d={} d['date'] = xx d['name'] = xx d['size'] = x d['imageBinaryDataJpeg'] = jpegBinaryDataFromcStringIOStringIO simplejson.dumps(d) when i do this, it rai

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Carsten Haese
On Sat, 2007-07-21 at 19:22 -0700, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > Use an actual HTML parser such as BeautifulSoup > > (http://www.crummy.com/software/BeautifulSoup/) and your life will be > > much easier. > > BeautifulSoup is a lot simpler to use than RE's but a

Re: [ANN] Python documentation team looking for members!

2007-07-21 Thread george williams
Take me off mailing list thank you george - Original Message - From: "Georg Brandl" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python.announce To: <[EMAIL PROTECTED]> Sent: Saturday, July 21, 2007 4:10 AM Subject: [ANN] Python documentation team looking for members! > Dear fellow Pythonis

Re: Regex doesn't support MULTILINE?

2007-07-21 Thread Tony Meyer
> I'm trying to extract information from a web page using the Re module, > but it doesn't seem to support MULTILINE: [...] > Do I need to add something else to have Re work as intended? I believe you are looking for DOTALL, not MULTILINE. From the documentation: """ M MULTILINE When specified, t

Sort lines in a text file

2007-07-21 Thread leegold
say I have a text file: zz3 uaa4a ss 7 uu zz 3 66 ppazz9 a0zz0 I want to sort the text file. I want the key to be the number after the two "zz". Or I guess a string of two zz then a numberSo that's 3, 9, 0 I'm trying to say that I want to sort lines in a file based on a re

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Gilles Ganault
On Sat, 21 Jul 2007 22:18:56 -0400, Carsten Haese <[EMAIL PROTECTED]> wrote: >That's your problem right there. RE is not the right tool for that job. >Use an actual HTML parser such as BeautifulSoup Thanks a lot for the tip. I tried it, and it does look interesting, although I've been unsuccessful

Re: [2.5] Regex doesn't support MULTILINE?

2007-07-21 Thread Jay Loden
Gilles Ganault wrote: > Problem is, when I add re.DOTLINE, the search takes less than a second > for a 500KB file... and about 1mn30 for a file that's 1MB, with both > files holding similar contents. > > Why such a huge difference in performance? > > = Using Re = > import re >

Re: Sort lines in a text file

2007-07-21 Thread John Machin
On Jul 22, 1:03 pm, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberSo > that's 3, 9,

Re: converting 64-bit fixed-point to float

2007-07-21 Thread John Machin
On Jul 22, 10:34 am, [EMAIL PROTECTED] (John Fisher) wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Jul 20, 5:59 pm, [EMAIL PROTECTED] (John Fisher) wrote: > > > Hi Group, > > > > troubles with converting signed 32.32, little-endian, 2's complement > > > back to floating point. I have