Re: spammers on pypi

2009-06-05 Thread Lawrence D'Oliveiro
In message , joep wrote: > Is there a way to ban spammers from pypi? Yes, but it doesn't work. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3.1 - io.BufferedReader.peek() incomplete or change of behaviour.

2009-06-05 Thread Gabriel Genellina
En Fri, 05 Jun 2009 17:04:45 -0300, Frederick Reeve escribió: I have sent this message to the authors as well as to this list. If this is the wrong list please let me know where I should be sending it... dev perhaps? I think the best place is the bug tracker: http://bugs.python.org/ -- Gabr

Re: Scope objects

2009-06-05 Thread s0suk3
On Jun 5, 8:56 pm, Robert Dailey wrote: > Is it possible to create an object in Python that will clean itself up > at function exit? I realize destruction of objects may not occur > immediately and can be garbage collected, but this functionality would > still be great to have. Consider the follow

Error in linalg.inv ??

2009-06-05 Thread Ajith Kumar
Hello, I ran the following code (Using Debian 5.0) from numpy import * a = arange(1.,10.) b = reshape(a, [3,3]) c = linalg.inv(b) print b print c print dot(b,c) print dot(c,b) And the result is [[ 1. 2. 3.] [ 4. 5. 6.] [ 7. 8. 9.]] [[ 3.15221191e+15 -6.30442381e+15 3.15221191e+15] [

Re: Winter Madness - Passing Python objects as Strings

2009-06-05 Thread Gabriel Genellina
En Fri, 05 Jun 2009 12:33:04 -0300, Hendrik van Rooyen escribió: "Gabriel Genellina" wrote: But if you already have a queue, you may put other objects there (instead of "canning" them). Testing the object type with isinstance(msg, str) is pretty fast, and if you bind locally those names I

Re: MD6 in Python

2009-06-05 Thread mikle3
On Jun 6, 5:16 am, Steven D'Aprano wrote: > On Sat, 06 Jun 2009 01:47:21 +0200, Christian Heimes wrote: > > Terry Reedy wrote: > >> A wrapper could go on PyPI now so it can be tested in use *before* > >> going in the stdlib.  No commit or pre-review needed either. > > > Here you gohttp://pypi.pyth

Re: Scope objects

2009-06-05 Thread Robert Dailey
On Jun 5, 9:07 pm, Chris Rebert wrote: > On Fri, Jun 5, 2009 at 6:56 PM, Robert Dailey wrote: > > Is it possible to create an object in Python that will clean itself up > > at function exit? I realize destruction of objects may not occur > > immediately and can be garbage collected, but this funct

Re: Making the case for repeat

2009-06-05 Thread Carl Banks
On Jun 4, 6:44 pm, "Gabriel Genellina" wrote: > En Thu, 04 Jun 2009 10:37:45 -0300, pataphor escribió: > > > So here is my proposed suggestion for a once and for all reconciliation > > of various functions in itertools that can not stand on their own and > > keep a straight face. Because of backw

Re: python way to automate IE8's File Download dialog

2009-06-05 Thread Gabriel Genellina
En Fri, 05 Jun 2009 09:46:25 -0300, <""Michel Claveau - MVP"> escribió: Suppose that the (web) site give the file only after several seconds, and after the user click a confirm (example: RapidFile). Suppose that the (web) site give the file only after the user input a code, controled by a

Re: Making the case for repeat

2009-06-05 Thread Steven D'Aprano
On Fri, 05 Jun 2009 23:21:40 -0300, Gabriel Genellina wrote: > En Fri, 05 Jun 2009 08:04:37 -0300, pataphor > escribió: > >> But what is simple? I am currently working on a universal feature >> creeper that could replace itertools.cycle, itertools.repeat, >> itertools.chain and reverse and also

Re: Making the case for repeat

2009-06-05 Thread Gabriel Genellina
En Fri, 05 Jun 2009 08:04:37 -0300, pataphor escribió: But what is simple? I am currently working on a universal feature creeper that could replace itertools.cycle, itertools.repeat, itertools.chain and reverse and also helps to severely cut down on itertools.islice usage. All within virtually

Re: fastest way to test file for string?

2009-06-05 Thread Steven D'Aprano
On Fri, 05 Jun 2009 17:37:25 +0200, Hendrik van Rooyen wrote: > "kj" wrote: >> >> Hi. I need to implement, within a Python script, the same >> functionality as that of Unix's >> >>grep -rl some_string some_directory >> >> I.e. find all the files under some_directory that contain the strin

Re: how to iterate over several lists?

2009-06-05 Thread Steven D'Aprano
On Fri, 05 Jun 2009 11:37:49 -0700, Minesh Patel wrote: >> def chain(*args): >>  return (item for seq in args for item in seq) >> >> for x in chain(list_a, list_b): >>    foo(x) >> -- >> http://mail.python.org/mailman/listinfo/python-list >> >> > If they are the same length, you can try the zip bu

Re: how to create a big list of list

2009-06-05 Thread greg
command@alexbbs.twbbs.org wrote: i have try [ [] for x in xrange(2**25) ] Are you really going to be adding data to all of those sublists? If you're only using them sparsely, it may be better to use a dictionary in place of the top level list, and only add sublists as and when necessary.

Re: Programming language comparison examples?

2009-06-05 Thread John Machin
On Jun 6, 5:45 am, Chris Rebert wrote: > PLEAC (Programming Language Examples Alike Cookbook) is one > option:http://pleac.sourceforge.net/ """The latest version of Python is 2.4""" Appears to be a translation of parts of the Perl Cookbook: """Examples which translate the original Perl closely

Re: MD6 in Python

2009-06-05 Thread Steven D'Aprano
On Sat, 06 Jun 2009 01:47:21 +0200, Christian Heimes wrote: > Terry Reedy wrote: >> A wrapper could go on PyPI now so it can be tested in use *before* >> going in the stdlib. No commit or pre-review needed either. > > Here you go http://pypi.python.org/pypi/md6 > > It's still a bit rough, total

Re: urlretrieve() failing on me

2009-06-05 Thread greg
Robert Dailey wrote: This URL isn't even valid, can't believe I didn't get an exception! My guess is that if you look at the data it downloaded, you'll find it's a 404 response page or something similar. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope objects

2009-06-05 Thread Chris Rebert
On Fri, Jun 5, 2009 at 6:56 PM, Robert Dailey wrote: > Is it possible to create an object in Python that will clean itself up > at function exit? I realize destruction of objects may not occur > immediately and can be garbage collected, but this functionality would > still be great to have. Conside

Re: Scope objects

2009-06-05 Thread Stephen Hansen
On Fri, Jun 5, 2009 at 6:56 PM, Robert Dailey wrote: > Is it possible to create an object in Python that will clean itself up > at function exit? I realize destruction of objects may not occur > immediately and can be garbage collected, but this functionality would > still be great to have. Consi

Scope objects

2009-06-05 Thread Robert Dailey
Is it possible to create an object in Python that will clean itself up at function exit? I realize destruction of objects may not occur immediately and can be garbage collected, but this functionality would still be great to have. Consider the following function: def do_stuff(): foo = scope_ob

Re: Create multiple variables (with a loop?)

2009-06-05 Thread Chris Rebert
On Fri, Jun 5, 2009 at 6:44 PM, Gökhan SEVER wrote: > You could use locals() for dynamic variable names creation. Not really. Quoting http://docs.python.org/library/functions.html#locals (emphasis mine): locals() Update and return a dictionary representing the current local symbol table.

Re: Create multiple variables (with a loop?)

2009-06-05 Thread Gökhan SEVER
You could use locals() for dynamic variable names creation. Additionally, you can give to Mayavi a try for visualization of your data: http://code.enthought.com/projects/mayavi/ Gökhan On Fri, Jun 5, 2009 at 2:35 PM, Philip Gröger wrote: > Hi, > I need to create multiple variables (lets say

Re: urlretrieve() failing on me

2009-06-05 Thread Robert Dailey
On Jun 5, 7:53 pm, Robert Dailey wrote: > On Jun 5, 10:31 am, Peter Otten <__pete...@web.de> wrote: > > > > > > > Robert Dailey wrote: > > > On Jun 5, 3:47 am, "Gabriel Genellina" wrote: > > >> En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey > > >> escribió: > > > >> > Hey guys, try using urlr

Re: Programming language comparison examples?

2009-06-05 Thread skip
>> http://www.rosettacode.org/wiki/Main_Page >> http://en.literateprograms.org/LiteratePrograms:Welcome >> http://www.codecodex.com/wiki/index.php?title=Main_Page >> http://merd.sourceforge.net/pixel/language-study/scripting-language/ >> http://pleac.sourceforge.net/ >> htt

Re: Odd closure issue for generators

2009-06-05 Thread Michele Simionato
On Jun 6, 12:06 am, Terry Reedy wrote: > Brian Quinlan wrote: > > > Sorry, I wasn't as precise as I should have been. > > > If you consider this example: > > ( for x in y) > > > I thought that every time that was evaluated, it would be done in > > a new closure with x bound to the value of x at t

Re: urlretrieve() failing on me

2009-06-05 Thread Robert Dailey
On Jun 5, 10:31 am, Peter Otten <__pete...@web.de> wrote: > Robert Dailey wrote: > > On Jun 5, 3:47 am, "Gabriel Genellina" wrote: > >> En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey > >> escribió: > > >> > Hey guys, try using urlretrieve() in Python 3.0.1 on the following > >> > URL: > > >> >

Re: multi-core software

2009-06-05 Thread Vend
On Jun 6, 1:26 am, Roedy Green wrote: > On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku > wrote, quoted or indirectly quoted someone who > said : > > >Even for problems where it appears trivial, there can be hidden > >issues, like false cache coherency communication where no actual > >sharin

Re: MD6 in Python

2009-06-05 Thread Terry Reedy
Aahz wrote: Um, what? You mean 3.1rc1, right? Nevertheless, my understanding is that 2.7 is mostly restricted to code landed in 3.1, so your second statement is roughly correct. My understanding is that 2.7 will come out about the same time as 3.2 and will contain 3.2 backports also. New f

Re: MD6 in Python

2009-06-05 Thread Christian Heimes
Aahz wrote: > Um, what? You mean 3.1rc1, right? Nevertheless, my understanding is > that 2.7 is mostly restricted to code landed in 3.1, so your second > statement is roughly correct. Oh, d...! Of course you are right, Aahz. As far as I can remember 2.7 will only contain backports of 3.1 feature

Re: MD6 in Python

2009-06-05 Thread Scott David Daniels
Christian Heimes wrote: ... 2.7rc1 is already out. There is no way a new piece of code will land in the 2.7 release. Christian 3.1rc1 is out, but 2.7 is not even in alpha. See pep 373 for the 2.7 schedule; 3.1's schedule is on pep 375. --Scott David Daniels scott.dani...@acm.org -- http://ma

Re: MD6 in Python

2009-06-05 Thread Aahz
In article , Christian Heimes wrote: >Terry Reedy schrieb: >> Christian Heimes wrote: >>> >>> Somebody has to write and add a md6 wrapper to the standard library. >>> It's going to take some time, at least 18 months until Python 2.8 and >> >> 2.7 is next > >2.7rc1 is already out. There is no wa

Re: MD6 in Python

2009-06-05 Thread Christian Heimes
Terry Reedy wrote: > A wrapper could go on PyPI now so it can be tested in use *before* going > in the stdlib. No commit or pre-review needed either. Here you go http://pypi.python.org/pypi/md6 It's still a bit rough, totally untested but it should work. Christian -- http://mail.python.org/ma

Re: MD6 in Python

2009-06-05 Thread Christian Heimes
Terry Reedy schrieb: > Christian Heimes wrote: >> mik...@gmail.com schrieb: >>> As every one related to security probably knows, Rivest (and his >>> friends) have a new hashing algorithm which is supposed to have none >>> of the weaknesses of MD5 (and as a side benefit - not too many rainbow >>> ta

Re: Feedparser Problem

2009-06-05 Thread Jonathan Nelson
Thanks for the responses. I've tried the same script on a Server 2003 install, and Python 2.5 and it ran without a hitch. So, it's either a problem with Python 2.6 or with Windows 7. Thanks for all the responses. You've been great. Best, Jonathan On Jun 5, 7:39 am, Jonathan Nelson wrote: > I

Re: MD6 in Python

2009-06-05 Thread Terry Reedy
Robert Kern wrote: On 2009-06-05 16:09, mik...@gmail.com wrote: It's not that I need it, I can sure use it. I can also write a wrapper myself. My secret agenda is too see if other people want it and write it as an addition to the standard lib, thus wetting my feet in Python Core Development wi

Re: MD6 in Python

2009-06-05 Thread Terry Reedy
Christian Heimes wrote: mik...@gmail.com schrieb: As every one related to security probably knows, Rivest (and his friends) have a new hashing algorithm which is supposed to have none of the weaknesses of MD5 (and as a side benefit - not too many rainbow tables yet). His code if publicly availab

Re: fastest way to test file for string?

2009-06-05 Thread Aaron Brady
On Jun 5, 5:50 am, kj wrote: > Hi.  I need to implement, within a Python script, the same > functionality as that of Unix's > >    grep -rl some_string some_directory > > I.e. find all the files under some_directory that contain the string > "some_string". snip The 'mmap.mmap' class has a 'find'

Re: import sqlite3

2009-06-05 Thread willgun
Gabriel Genellina 写道: En Thu, 04 Jun 2009 03:14:18 -0300, willgun escribió: I'm a student from China.It's painful for us to read python documentation entirely due to poor english.So I often make these mistakes. Try "chinese python group" at Google - I see some promising results at least...

Re: import sqlite3

2009-06-05 Thread willgun
Mark Tolonen 写道: "willgun" wrote in message news:h08c5e$au...@news.cn99.com... By the way ,what does 'best regards' means at the end of a mail? I think 恭祝 may be a good translation. -Mark O(∩_∩)O谢谢 Glad to meet a foreigner know Chinese, :-) . But in my opinion,恭祝 means congratulation,wh

Re: DUDA !!!!!!!!!!

2009-06-05 Thread pruebauno
On Jun 4, 2:51 pm, "Ariel Vazquez Riveron" wrote: > Hola: >   Hoy en día me encuentro iniciandome dentro del python, en estos   > momentos quiero saber de que forma puedo eliminar un archivo de un   > compactado, ya sea zip, rar o cualquier otro. Estudie las librerías   > zipfile pero no tiene nin

Re: Odd closure issue for generators

2009-06-05 Thread Terry Reedy
Brian Quinlan wrote: Sorry, I wasn't as precise as I should have been. If you consider this example: ( for x in y) I thought that every time that was evaluated, it would be done in a new closure with x bound to the value of x at the time that the closure was created. Instead, a new closur

Re: numpy 00 character bug?

2009-06-05 Thread Carl Banks
On Jun 5, 9:14 am, Nathaniel Rook wrote: > Hello, all! > > I've recently encountered a bug in NumPy's string arrays, where the 00 > ASCII character ('\x00') is not stored properly when put at the end of a > string. > > For example: > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3

Re: MD6 in Python

2009-06-05 Thread Robert Kern
On 2009-06-05 16:09, mik...@gmail.com wrote: On Jun 5, 11:46 pm, Christian Heimes wrote: mik...@gmail.com schrieb: As every one related to security probably knows, Rivest (and his friends) have a new hashing algorithm which is supposed to have none of the weaknesses of MD5 (and as a side bene

Re: Adding a Par construct to Python?

2009-06-05 Thread Terry Reedy
Lawrence D'Oliveiro wrote: In message <77as23f1fhj3...@mid.uni-berlin.de>, Diez B. Roggisch wrote: But reduce()? I can't see how you can parallelize reduce(). By its nature, it has to run sequentially: it can't operate on the nth item until it is operated on the (n-1)th item. That depends on t

Re: multi-core software

2009-06-05 Thread Scott Burson
On Jun 4, 9:46 am, Xah Lee wrote: > Of interest: > > • Why Must Software Be Rewritten For Multi-Core Processors? >  http://xahlee.org/UnixResource_dir/writ/multi-core_software.html > > plain text version follows. > > -- > Why Must Software Be Rewritt

Re: MD6 in Python

2009-06-05 Thread mikle3
On Jun 5, 11:46 pm, Christian Heimes wrote: > mik...@gmail.com schrieb: > > > As every one related to security probably knows, Rivest (and his > > friends) have a new hashing algorithm which is supposed to have none > > of the weaknesses of MD5 (and as a side benefit - not too many rainbow > > tab

Re: Messing up with classes and their namespace

2009-06-05 Thread Terry Reedy
Jean-Michel Pichavant wrote: Thanks for the explanation. I'll have to give it a second thought, I'm still missing something but I'll figure it out. Perhaps it is this: 1. When you run foo.py as a script, the interpreter creates module '__main__' by executing the code in foo.py. 2. When that c

Re: PyQt4 + WebKit

2009-06-05 Thread David Boddie
On Friday 05 June 2009 21:33, dudekks...@gmail.com wrote: > On 1 Cze, 22:05, David Boddie wrote: >> I experimented a little and added an example to the PyQt Wiki: >> >> http://www.diotavelli.net/PyQtWiki/Usinga Custom Protocol with QtWebKit >> >> I hope it helps to get you started with your own

Re: MD6 in Python

2009-06-05 Thread Christian Heimes
mik...@gmail.com schrieb: > As every one related to security probably knows, Rivest (and his > friends) have a new hashing algorithm which is supposed to have none > of the weaknesses of MD5 (and as a side benefit - not too many rainbow > tables yet). His code if publicly available under the MIT li

python 3.1 - io.BufferedReader.peek() incomplete or change of behaviour.

2009-06-05 Thread Frederick Reeve
Hello, I have sent this message to the authors as well as to this list. If this is the wrong list please let me know where I should be sending it... dev perhaps? First the simple questions: The versions of io.BufferedReader.peek() have different behavior which one is going to stay long term? I

A simpler logging configuration file format?

2009-06-05 Thread geoff . bache
Hi all, I wonder if there are others out there who like me have tried to use the logging module's configuration file and found it bloated and over- complex for simple usage (i.e. a collection of loggers writing to files) At the moment, if I want to add a new logger "foo" writing to its own file "

Re: The Complexity And Tedium of Software Engineering

2009-06-05 Thread Kenneth Tilton
Xah Lee wrote: On Jun 3, 11:50 pm, Xah Lee wrote: Of interest: • The Complexity And Tedium of Software Engineering http://xahlee.org/UnixResource_dir/writ/programer_frustration.html Addendum: The point in these short examples is not about software bugs or problems. It illustrates, how seemi

Re: Programming language comparison examples?

2009-06-05 Thread bearophileHUGS
someone: > I thought there was a website which demonstrated how to program a bunch of > small problems in a number of different languages. http://www.rosettacode.org/wiki/Main_Page http://en.literateprograms.org/LiteratePrograms:Welcome http://www.codecodex.com/wiki/index.php?title=Main_Page http:

Re: Programming language comparison examples?

2009-06-05 Thread Chris Rebert
On Fri, Jun 5, 2009 at 12:20 PM, wrote: > I thought there was a website which demonstrated how to program a bunch of > small problems in a number of different languages.  I know about the > Programming Language Shootout: > >    http://shootout.alioth.debian.org/ > > but that's not what I was think

Re: how to iterate over several lists?

2009-06-05 Thread Chris Rebert
On Fri, Jun 5, 2009 at 11:37 AM, Minesh Patel wrote: > On Fri, Jun 5, 2009 at 10:20 AM, Tom wrote: >> On Fri, 5 Jun 2009 04:07:19 + (UTC), kj >> wrote: >> >>> >>> >>>Suppose I have two lists, list_a and list_b, and I want to iterate >>>over both as if they were a single list.  E.g. I could wri

MD6 in Python

2009-06-05 Thread mikle3
As every one related to security probably knows, Rivest (and his friends) have a new hashing algorithm which is supposed to have none of the weaknesses of MD5 (and as a side benefit - not too many rainbow tables yet). His code if publicly available under the MIT license. Is there a reason not to a

Re: Create multiple variables (with a loop?)

2009-06-05 Thread Chris Rebert
On Fri, Jun 5, 2009 at 12:35 PM, Philip Gröger wrote: > Hi, > I need to create multiple variables (lets say 10x10x10 positions of atoms). > Is it possible to create them through a loop with some kind of indexing like > atom000, atom001, etc? > Or is this a very bad idea? Yes, very bad idea. Use a

Create multiple variables (with a loop?)

2009-06-05 Thread Philip Gröger
Hi, I need to create multiple variables (lets say 10x10x10 positions of atoms). Is it possible to create them through a loop with some kind of indexing like atom000, atom001, etc? Or is this a very bad idea? Thing is ... i want to create a grid of atoms in vpython and then calculate the forces for

Re: PyQt4 + WebKit

2009-06-05 Thread dudekksoft
On 1 Cze, 22:05, David Boddie wrote: > On Monday 01 June 2009 16:16, dudekks...@gmail.com wrote: > > > On 31 Maj, 02:32, David Boddie wrote: > >> So, you only want to handle certain links, and pass on to WebKit those > >> which you can't handle? Is that correct? > > > Yes, I want to handle extern

Programming language comparison examples?

2009-06-05 Thread skip
I thought there was a website which demonstrated how to program a bunch of small problems in a number of different languages. I know about the Programming Language Shootout: http://shootout.alioth.debian.org/ but that's not what I was thinking of. I thought there was a site with a bunch of

Re: fastest way to test file for string?

2009-06-05 Thread Scott David Daniels
Tim Chase wrote: Hi. I need to implement, within a Python script, [functionality like]: grep -rl some_string some_directory I'd do something like this untested function: def find_files_containing(base_dir, string_to_find): for path, files, dirs in os.walk(base_dir): Note order wrong

Re: distutils extension configuration problem

2009-06-05 Thread Art
On May 26, 11:10 pm, Ron Garret wrote: > I'm trying to build PyObjC on an Intel Mac running OS X 10.5.7.  The > build is breaking because distutils seems to want to build extension > modules as universal binaries, but some of the libraries it depends on > are built for intel-only, i.e.: > > [...@m

Re: how to iterate over several lists?

2009-06-05 Thread Minesh Patel
On Fri, Jun 5, 2009 at 10:20 AM, Tom wrote: > On Fri, 5 Jun 2009 04:07:19 + (UTC), kj > wrote: > >> >> >>Suppose I have two lists, list_a and list_b, and I want to iterate >>over both as if they were a single list.  E.g. I could write: >> >>for x in list_a: >>    foo(x) >>for x in list_b: >>  

Re: multi-core software

2009-06-05 Thread Kaz Kylheku
On 2009-06-05, Vend wrote: > On Jun 4, 8:35 pm, Roedy Green > wrote: >> On Thu, 4 Jun 2009 09:46:44 -0700 (PDT), Xah Lee >> wrote, quoted or indirectly quoted someone who said : >> >> >• Why Must Software Be Rewritten For Multi-Core Processors? >> >> Threads have been part of Java since Day 1.  

Re: Messing up with classes and their namespace

2009-06-05 Thread Jean-Michel Pichavant
Scott David Daniels wrote: Jean-Michel Pichavant wrote: Hello world, I had recently a very nasty bug in my python application. The context is quite complex, but in the end the problem can be resume as follow: 2 files in the same directory : lib.py: >import foo >foo.Foo.BOOM='lib' foo.py:

[wxpython] change the language of a menubar

2009-06-05 Thread Jan-Heiner Dreschhoff
Hi Guys, i am new to wxpython an i have trouble with the menubar. i tried to write a dynamic menubar that can read the itemnames from an sqlite3 database, so i can change the language very easy. like this. def MakeMenuBar(self): self.dbCursor.execute("SELECT " + self.lang[self.langSelect] +"

Re: multi-core software

2009-06-05 Thread Vend
On Jun 4, 8:35 pm, Roedy Green wrote: > On Thu, 4 Jun 2009 09:46:44 -0700 (PDT), Xah Lee > wrote, quoted or indirectly quoted someone who said : > > >• Why Must Software Be Rewritten For Multi-Core Processors? > > Threads have been part of Java since Day 1.  Using threads complicates > your code,

Re: how to iterate over several lists?

2009-06-05 Thread Tom
On Fri, 5 Jun 2009 04:07:19 + (UTC), kj wrote: > > >Suppose I have two lists, list_a and list_b, and I want to iterate >over both as if they were a single list. E.g. I could write: > >for x in list_a: >foo(x) >for x in list_b: >foo(x) > >But is there a less cumbersome way to achieve

Re: Yet another unicode WTF

2009-06-05 Thread Ned Deily
In article , Ned Deily wrote: > In python 3.x, of course, the encoding happens automatically but you > still have to tell python, via the "encoding" argument to open, what the > encoding of the file's content is (or accept python's default which may > not be very useful): > > >>> open('foo1',

Re: Winter Madness - Passing Python objects as Strings

2009-06-05 Thread Scott David Daniels
Hendrik van Rooyen wrote: "Gabriel Genellina" wrote: Ah... I had the same impression as Mr. Reedy, that you were directly reading from a socket and processing right there, so you *had* to use strings for everything. not "had to" - "chose to" - to keep the most used path as short as I cou

Re: Way to use proxies & login to site?

2009-06-05 Thread inVINCable
On May 5, 12:51 pm, Kushal Kumaran wrote: > On Wed, Apr 29, 2009 at 8:21 AM, inVINCable wrote: > > On Apr 27, 7:40 pm, inVINCable wrote: > >> Hello, > > >> I have been using ClientForm to log in to sites & ClientCookie so I > >> can automatically log into my site to do some penetration testing,

Re: fastest way to test file for string?

2009-06-05 Thread Tim Chase
Hi. I need to implement, within a Python script, the same functionality as that of Unix's grep -rl some_string some_directory I.e. find all the files under some_directory that contain the string "some_string". I'd do something like this untested function: def find_files_containing(base_

Re: Messing up with classes and their namespace

2009-06-05 Thread Scott David Daniels
Jean-Michel Pichavant wrote: Hello world, I had recently a very nasty bug in my python application. The context is quite complex, but in the end the problem can be resume as follow: 2 files in the same directory : lib.py: >import foo >foo.Foo.BOOM='lib' foo.py: >class Foo: >BOOM = '

Re: numpy 00 character bug?

2009-06-05 Thread Aahz
In article , Nathaniel Rook wrote: > >I've recently encountered a bug in NumPy's string arrays, where the 00 >ASCII character ('\x00') is not stored properly when put at the end of a >string. You should ask about this on the NumPy mailing lists and/or report it on the NumPy tracker: http://sc

Re: Winter Madness - Passing Python objects as Strings

2009-06-05 Thread Hendrik van Rooyen
"Nigel Rantor" wrote: > Well, why not have a look at Gabriel's response. I have, and have responded at some length, further explaining what I am doing, and why. > That seems like a much more portable way of doing it if nothing else. There is nothing portable in what I am doing - it is aimed a

numpy 00 character bug?

2009-06-05 Thread Nathaniel Rook
Hello, all! I've recently encountered a bug in NumPy's string arrays, where the 00 ASCII character ('\x00') is not stored properly when put at the end of a string. For example: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyri

Re: Uppercase/Lowercase on unicode

2009-06-05 Thread Дамјан Георгиевски
> I just to check it in the python shell and it's correct. > Then the problem is by iPython that I was testing it from there. yes, iPython has a bug like that https://bugs.launchpad.net/ipython/+bug/339642 -- дамјан ( http://softver.org.mk/damjan/ ) A: Because it reverses the logical flow of

Re: fastest way to test file for string?

2009-06-05 Thread Hendrik van Rooyen
"kj" wrote: > > Hi. I need to implement, within a Python script, the same > functionality as that of Unix's > >grep -rl some_string some_directory > > I.e. find all the files under some_directory that contain the string > "some_string". > > I imagine that I can always resort to the shell

Re: Winter Madness - Passing Python objects as Strings

2009-06-05 Thread Hendrik van Rooyen
"Gabriel Genellina" wrote: >Ah... I had the same impression as Mr. Reedy, that you were directly >reading from a socket and processing right there, so you *had* to use >strings for everything. not "had to" - "chose to" - to keep the most used path as short as I could. > >But if you already

Re: Winter Madness - Passing Python objects as Strings

2009-06-05 Thread Nigel Rantor
Hendrik van Rooyen wrote: > "Nigel Rantor" wrote: > >> It just smells to me that you've created this elaborate and brittle hack >> to work around the fact that you couldn't think of any other way of >> getting the thread to change it's behaviour whilst waiting on input. > > I am beginning to

Re: urlretrieve() failing on me

2009-06-05 Thread Peter Otten
Robert Dailey wrote: > On Jun 5, 3:47 am, "Gabriel Genellina" wrote: >> En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey >> escribió: >> >> > Hey guys, try using urlretrieve() in Python 3.0.1 on the following >> > URL: >> >> >http://softlayer.dl.sourceforge.net/sourceforge/wxwindows/wxMSW-2.8.1

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Thomas Heller
Philip Semanchuk schrieb: > On Jun 5, 2009, at 10:13 AM, Thomas Heller wrote: > >> s...@pobox.com schrieb: > If there is no C++ compiler available then the proposed layout > sniffing just >>> wouldn't be done and either a configure error would be emitted or a >>> run-time >>> exception

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Philip Semanchuk
On Jun 5, 2009, at 10:13 AM, Thomas Heller wrote: s...@pobox.com schrieb: If there is no C++ compiler available then the proposed layout sniffing just wouldn't be done and either a configure error would be emitted or a run-time exception raised if a program attempted to use that feature.

Feedparser Problem

2009-06-05 Thread Jonathan Nelson
I'm working with Feedparser on months old install of Windows 7, and now programs that ran before are broken, and I'm getting wierd messages that are rather opaque to me. Google, Bing, News groups have all left me empty handed. I was wondering if I could humbly impose upon the wizards of comp.lan

Re: Odd closure issue for generators

2009-06-05 Thread Brian Quinlan
Ned Deily wrote: In article <4a28903b.4020...@sweetapp.com>, Brian Quinlan wrote: Scott David Daniels wrote: [snipped] When you evaluate a lambda expression, the default args are evaluated, but the expression inside the lambda body is not. When you apply that evaluated lambda expression, the

Re: urlretrieve() failing on me

2009-06-05 Thread Robert Dailey
On Jun 5, 3:47 am, "Gabriel Genellina" wrote: > En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey   > escribió: > > > Hey guys, try using urlretrieve() in Python 3.0.1 on the following > > URL: > > >http://softlayer.dl.sourceforge.net/sourceforge/wxwindows/wxMSW-2.8.1... > > > Have it save the ZI

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Thomas Heller
s...@pobox.com schrieb: > >> Requiring that the C++ compiler used to make the dll's/so's to be the > >> same one Python is compiled with wouldn't be too burdensome would it? > > Scott> And what gave you then impression that Python is compiled with a > Scott> C++ compiler? > > I do

Re: a problem with concurrency

2009-06-05 Thread Tim Chase
When a user posts a requests he changes the underlying database table. The issue is that if more users are editing the same set of rows the last user will override the editing of the first one. Since this is an in-house application with very few users, we did not worry to solve this issue, which h

Re: fastest way to test file for string?

2009-06-05 Thread pruebauno
On Jun 5, 7:50 am, kj wrote: > Hi.  I need to implement, within a Python script, the same > functionality as that of Unix's > >    grep -rl some_string some_directory > > I.e. find all the files under some_directory that contain the string > "some_string". > > I imagine that I can always resort to

Re: The Complexity And Tedium of Software Engineering

2009-06-05 Thread MRAB
John Thingstad wrote: På Fri, 05 Jun 2009 08:07:39 +0200, skrev Xah Lee : On Jun 3, 11:50 pm, Xah Lee wrote: The point in these short examples is not about software bugs or problems. It illustrates, how seemingly trivial problems, such as networking, transferring files, running a app on Mac

Re: Odd closure issue for generators

2009-06-05 Thread Aahz
In article , Lawrence D'Oliveiro wrote: >In message ><78180b4c-68b2-4a0c-8594-50fb1ea2f...@c19g2000yqc.googlegroups.com>, Michele >Simionato wrote: >> >> The crux is in the behavior of the for loop: in Python there is a >> single scope and the loop variable is *mutated* at each iteration, >> wh

Re: pylint naming conventions?

2009-06-05 Thread Ben Finney
Esmail writes: > I am confused by pylint's naming conventions, I don't think the are in > tune with Python's style recommendations (PEP 8?) > > Anyone else think this? It's hard to know, without examples. Can you give some output of pylint that you think doesn't agree with PEP 8? -- \

Re: a problem with concurrency

2009-06-05 Thread Michele Simionato
On Fri, Jun 5, 2009 at 2:59 PM, Tim Chase wrote: > The common way to do this is to not bother with the "somebody else is > editing this record" because it's nearly impossible with the stateless web > to determine when somebody has stopped browsing a web page.  Instead, each > record simply has a "

Re: What text editor is everyone using for Python

2009-06-05 Thread Xah Lee
On May 25, 10:35 am, LittleGrasshopper wrote: > With so many choices, I was wondering what editor is the one you > prefer when coding Python, and why. I normally use vi, and just got > into Python, so I am looking for suitable syntax files for it, and > extra utilities. I dabbled with emacs at som

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread skip
>> Requiring that the C++ compiler used to make the dll's/so's to be the >> same one Python is compiled with wouldn't be too burdensome would it? Scott> And what gave you then impression that Python is compiled with a Scott> C++ compiler? I don't think it's too much to expect tha

pylint naming conventions?

2009-06-05 Thread Esmail
Hi, as someone who is still learning a lot about Python I am making use of all the tools that can help me, such as pyflakes, pychecker and pylint. I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else think this? Is

fastest way to test file for string?

2009-06-05 Thread kj
Hi. I need to implement, within a Python script, the same functionality as that of Unix's grep -rl some_string some_directory I.e. find all the files under some_directory that contain the string "some_string". I imagine that I can always resort to the shell for this, but is there an effici

Re: python way to automate IE8's File Download dialog

2009-06-05 Thread Michel Claveau - MVP
Hi! Suppose that the (web) site give the file only after several seconds, and after the user click a confirm (example: RapidFile). Suppose that the (web) site give the file only after the user input a code, controled by a javascript script. @-salutations -- Michel Claveau -- http://mail.py

Re: Adding a Par construct to Python?

2009-06-05 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > threads = [PMapThread(datapool) for i in xrange(numthreads)] Shouldn’t that “PMapThread” be “thread”? -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-06-05 Thread Lawrence D'Oliveiro
In message <77as23f1fhj3...@mid.uni-berlin.de>, Diez B. Roggisch wrote: >> But reduce()? I can't see how you can parallelize reduce(). By its >> nature, it has to run sequentially: it can't operate on the nth item >> until it is operated on the (n-1)th item. > > That depends on the operation in q

  1   2   >