Elisa Media Center 0.5.22 Release

2008-12-16 Thread Olivier Tilloy
Dear Python users, The Elisa team is happy to announce the release of Elisa Media Center 0.5.22, code-named Where Is My Mind?. Elisa is a cross-platform and open-source Media Center written in Python. It uses GStreamer [1] for media playback and pigment [2] to create an appealing and intuitive

Sphinx 0.5.1 released

2008-12-16 Thread Georg Brandl
Hi all, I'm proud to announce the release of Sphinx 0.5.1, the first bugfix release in the 0.5 series. What is it? === Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of multiple reStructuredText

Hypy 0.8.1 (first public release!)

2008-12-16 Thread Cory Dodt
Hypy is a fulltext search interface for Python applications. Use it to index and search your documents from Python code. Hypy is based on the estraiernative bindings by Yusuke Yoshida. * Fast, scalable * Perfect recall ratio by N-gram method * High precision by hybrid mechanism of N-gram and

Numerical optimization framework OpenOpt 0.21

2008-12-16 Thread dmitrey
Hi all, OpenOpt 0.21, free Python-written optimization framework (license: BSD) with some own solvers and connections to tens of 3rd party ones, has been released. All details here: http://openopt.blogspot.com/2008/12/openopt-release-021.html Let us also invite you into new forum about

RE: tutorial on parser

2008-12-16 Thread Barak, Ron
Hi John, You may want to read http://nedbatchelder.com/text/python-parsers.html Bye, Ron. -Original Message- From: John Fabiani [mailto:jfabi...@yolo.com] Sent: Tuesday, December 16, 2008 08:47 To: python-list@python.org Subject: tutorial on parser Hi, I'm attempting to learn how to

Re: Python music sequencer timing problems

2008-12-16 Thread John O'Hagan
On Mon, 15 Dec 2008, John O'Hagan wrote: On Sun, 14 Dec 2008, Bad Mutha Hubbard wrote: John O'Hagan wrote: On Wed, 10 Dec 2008, badmuthahubbard wrote: [...] from time import time, sleep start = time() for event in music: duration=len(event) #Really, the length of the

Re: Memory leak when using a C++ module for Python

2008-12-16 Thread Gabriel Genellina
En Thu, 11 Dec 2008 15:35:58 -0200, Jaume Bonet jaume.bo...@gmail.com escribió: This is the function that is visible from python and the one that the python code calls: static PyObject * IMFind (PyObject *self, PyObject *args, PyObject *kwargs) { Your function does not call any Python

Re: weird dict problem, how can this even happen?

2008-12-16 Thread Joel Hedlund
Duncan Booth wrote: It could happen quite easily if the hash value of the object has changed since it was put in the dictionary. what does the definition of your core.gui.FragmentInfo object look like? Dunno if it'll help much, but: class FragmentInfo(object): def __init__(self,

Re: ethical questions about global variables

2008-12-16 Thread Bruno Desthuilliers
Giampaolo Rodola' a écrit : Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named use_gmt_times to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the ethical doubts I'm gonna write below. In

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Pete Forman
Steve Holden st...@holdenweb.com writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal usage relative to

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Gabriel Genellina
En Mon, 15 Dec 2008 14:29:31 -0200, cmdrrickhun...@yaho.com conrad.am...@gmail.com escribió: PS. In my opinion the solution would be to have the option of entering a whitespace insensitive mode which uses C style {} and ;. The token to enter it could be as complicated as you want (in fact,

Re: weird dict problem, how can this even happen?

2008-12-16 Thread Arnaud Delobelle
Joel Hedlund yoh...@ifm.liu.se writes: I'm having a very hard time explaining why this snippet *sometimes* raises KeyError: snippet: print type(self.pool) for frag in self.pool.keys(): if frag is fragment_info: print the fragment_info *is* in the pool, hash(frag),

Re: [Tutor] Having Issues with CMD and the 'python' command

2008-12-16 Thread W W
On Mon, Dec 15, 2008 at 9:56 AM, Benjamin Kaplan benjamin.kap...@case.eduwrote: It's not a question of sensibility. It's a question of purpose. The Zen is the philosophy of a language that tries to be easy to learn and easy to use. Python is used by programmers who want to experiment with it,

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Aaron Brady
On Dec 15, 11:04 am, Steve Holden st...@holdenweb.com wrote: Tim Chase wrote: Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium. Darn Americans and their alminim ;-)

Re: Need help improving number guessing game

2008-12-16 Thread Bruno Desthuilliers
feba a écrit : .strip() returns a copy of the string without leading and ending whitespaces (inlcuding newlines, tabs etc). Ahh. I had removed it because it didn't seem to do anything, but I've readded it. And I understand your dictionary stuff correctly now, I think, and I worked it in.

subprocess.Popen inheriting

2008-12-16 Thread Aaron Brady
Hi, I have a file handle I want to inherit in a child process. I am looking at '_make_inheritable' in 'Popen', but it needs an instance, and by the time I have one, the subprocess is already running. Can't I call 'Popen._make_inheritable( None, handle )'? The method does not use 'self'. --

Re: ethical questions about global variables

2008-12-16 Thread Gabriel Genellina
En Tue, 16 Dec 2008 00:45:05 -0200, Giampaolo Rodola' gne...@gmail.com escribió: Another doubt is the naming convention. PEP-8 states that global variables should use the lower_case_naming_convention but I've seen a lot of library module using the UPPER_CASE_NAMING_CONVENTION. What am I

Re: Interface Implementation

2008-12-16 Thread Gabriel Genellina
En Fri, 12 Dec 2008 19:48:09 -0200, Lie Ryan lie.1...@gmail.com escribió: but if you really want it, simple inheritance might be better anyway, though not really pythonic: class MyIfc(object): def myMeth1(self): return NotImplemented def myMeth2(self): return NotImplemented class

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Hendrik van Rooyen
Dennis Lee Bieber w@ix.netcom.com wrote: 8- stuff blaming Davy for aluminum -- Isn't Davy a Brit? No, he was a Brit. He's dead now. His safety lamp lives on. It's a good thing its got that heat-sink sieve- it's enabled countless miners to flee when they see its change of

Re: Generator slower than iterator?

2008-12-16 Thread MRAB
Federico Moreira wrote: Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in fileinput.input(sys.argv[1:]): ip = line.split()[0] if match_counter.has_key(ip):

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Lie Ryan
On Mon, 15 Dec 2008 08:29:31 -0800, cmdrrickhun...@yaho.com wrote: I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent);

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Grant Edwards
On 2008-12-16, Hendrik van Rooyen m...@microcorp.co.za wrote: Dennis Lee Bieber w@ix.netcom.com wrote: 8- stuff blaming Davy for aluminum -- Isn't Davy a Brit? No, he was a Brit. He's dead now. His safety lamp lives on. It's a good thing its got that heat-sink sieve-

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Eric Brunel
On Tue, 16 Dec 2008 10:00:32 +0100, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 15 Dec 2008 14:29:31 -0200, cmdrrickhun...@yaho.com conrad.am...@gmail.com escribió: PS. In my opinion the solution would be to have the option of entering a whitespace insensitive mode which uses

[cookielib] How to add cookies myself?

2008-12-16 Thread Gilles Ganault
Hello I'm using urllib and urlib to download data from a web server that requires cookies. The issue I'm having, is the server uses JavaScript in the response to insert new cookies and send them with the next query, so I need to manually add a couple of cookies in the CookieJar, but I don't know

Re: Generator slower than iterator?

2008-12-16 Thread Lie Ryan
On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote: Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in fileinput.input(sys.argv[1:]): ip = line.split()[0]

Re: Generator slower than iterator?

2008-12-16 Thread Lie Ryan
On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote: Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in fileinput.input(sys.argv[1:]): ip = line.split()[0]

RE: String slices work only for first string character ?

2008-12-16 Thread Barak, Ron
Hi Mr. Cain, Mae culpa: obviously, I erroneously understood the number after the ':' as the string length. Thanks, Ron. -Original Message- From: D'Arcy J.M. Cain [mailto:da...@druid.net] Sent: Tuesday, December 16, 2008 15:45 To: Barak, Ron Cc: python-list@python.org Subject: Re: String

Re: Bidirectional Networking

2008-12-16 Thread Emanuele D'Arrigo
Thanks everybody and in particular Gabriel and Bryan for their contributions to this thread. Very much useful information. Manu -- http://mail.python.org/mailman/listinfo/python-list

help I'm getting delimited

2008-12-16 Thread aka
Hi, I'm going nuts over the csv.reader and UnicodeReader class. Somehow I can't get this method working which is supposed to read a csv file which name is inputted but here now hardcoded. What I need for now is that the string version of the list is put out for control. Later on I will only need

Re: Generator slower than iterator?

2008-12-16 Thread Gary Herron
Lie Ryan wrote: On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote: Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in fileinput.input(sys.argv[1:]): ip =

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 07:23, Michele Simionato michele.simion...@gmail.com wrote: On Dec 16, 3:45 am, Giampaolo Rodola' gne...@gmail.com wrote: Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named use_gmt_times to decide whether the server has to return times in

Re: Free place to host python files?

2008-12-16 Thread skip
feba I'm getting started in python, and it would be helpful to have a feba place to put up various code snippets I've made, so I don't have feba to send them individually to each person I want to show it to. feba I'd prefer to use something that would give me a directory for my

Re: help I'm getting delimited

2008-12-16 Thread Paul Watson
On Tue, 2008-12-16 at 08:26 -0800, aka wrote: Hi, I'm going nuts over the csv.reader and UnicodeReader class. Somehow I can't get this method working which is supposed to read a csv file which name is inputted but here now hardcoded. What I need for now is that the string version of the list

Re: Generator slower than iterator?

2008-12-16 Thread bearophileHUGS
MRAB: from collections import defaultdict match_counter = defaultdict(int) for line in fileinput.input(sys.argv[1:]): ip = line.split()[0] match_counter[ip] += 1 This can be a little faster still: match_counter = defaultdict(int) for line in fileinput.input(sys.argv[1:]): ip =

Re: Generator slower than iterator?

2008-12-16 Thread Federico Moreira
The defaultdict option looks faster than the standard dict (20 secs aprox). Now i have: # import fileinput import sys from collections import defaultdict match_counter = defaultdict(int) for line in fileinput.input(sys.argv[1:]): match_counter[line.split()[0]]

Re: Copying files in directory

2008-12-16 Thread ianaré
On Dec 15, 9:49 pm, pacsciad...@gmail.com wrote: I'm writing a project management system, and I need the ability to accept a directory name and move its contents to another directory. Can someone give me a code sample that will handle this? I can't find any copying functions in os or os.path.

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread J. Cliff Dyer
On Tue, 2008-12-16 at 12:27 +0200, Hendrik van Rooyen wrote: Dennis Lee Bieber w@ix.netcom.com wrote: 8- stuff blaming Davy for aluminum -- Isn't Davy a Brit? No, he was a Brit. He's dead now. His safety lamp lives on. It's a good thing its got that heat-sink sieve-

Re: zipfile.is_zipfile() and string buffers

2008-12-16 Thread Gabriel Genellina
En Tue, 16 Dec 2008 12:28:00 -0200, Brendan brendandetra...@yahoo.com escribió: I would like zipfile.is_zipfile(), to operate on a cStringIO.StringIO string buffer, but is seems only to accept file names as arguments. Should it not be able to handle string buffers too? A version of

Does Python3 offer a FrozenDict?

2008-12-16 Thread Johannes Bauer
Hello group, is there anything like a frozen dict in Python3, so I could do a foo = { FrozenDict({a : b}): 3 } or something like that? Regards, Johannes -- Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit, verlästerung von Gott, Bibel und mir und bewusster Blasphemie.

Re: ethical questions about global variables

2008-12-16 Thread ianaré
For anything more complicated than a simple script, I find it easier to use some sort of config object. This could be a simple dictionnary type class, where the values can be set/retrieved by the other classes directly, or a more elaborate class including functions to set/ retrieve the variables.

String slices work only for first string character ?

2008-12-16 Thread Barak, Ron
Hi, Can any one explain why the following string slice works only for the first character, but not for any other ? $ cat /tmp/tmp.py #!/usr/bin/env python data = 'F0023209006-0101' print data print |+data[0:1]+| print |+data[1:1]+| print |+data[2:1]+| $ python `cygpath -w /tmp/tmp.py`

Re: Python plugin for Netbeans

2008-12-16 Thread ianaré
On Dec 15, 3:23 pm, a a...@a.aa wrote: Netbeans added a python plugin to its plugin repository. Do you tried it? What do you think about this plugin? If you like netbeans already it's great to finally have python officially supported. I find netbeans to be easier to use than eclipse. --

Re: weird dict problem, how can this even happen?

2008-12-16 Thread Duncan Booth
Joel Hedlund joel.hedl...@gmail.com wrote: I should probably do this with lists instead because I can't really think of a way of salvaging this. Am i right? I think you probably are correct. The only thing I can think that might help is if you can catch all the situations where changes to

Re: String slices work only for first string character ?

2008-12-16 Thread Tim Chase
Can any one explain why the following string slice works only for the first character, but not for any other ? $ cat /tmp/tmp.py #!/usr/bin/env python data = 'F0023209006-0101' print data print |+data[0:1]+| print |+data[1:1]+| print |+data[2:1]+| $ python `cygpath -w /tmp/tmp.py`

Re: tricky nested list unpacking problem

2008-12-16 Thread Steve Holden
Chris Rebert wrote: On Mon, Dec 15, 2008 at 11:06 AM, Reckoner recko...@gmail.com wrote: Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that these can be

Re: weird dict problem, how can this even happen?

2008-12-16 Thread Joel Hedlund
Duncan Booth wrote: I think you probably are correct. The only thing I can think that might help is if you can catch all the situations where changes to the dependent values might change the hash and wrap them up: before changing the hash pop the item out of the dict, then reinsert it after

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Hendrik van Rooyen
Aaron Brady castiro...@gmail.com wrote: There's an 'I' in Python. No! It's supposed to be : There's a T in python. an is only used when the next word starts with a vowel, as in: It's been an hour now... All this is because English speakers are genetically incapable of moving their

Re: Does Python3 offer a FrozenDict?

2008-12-16 Thread bearophileHUGS
Johannes Bauer: is there anything like a frozen dict in Python3, so I could do a foo = { FrozenDict({a : b}): 3 } You can adapt this code to Python3 (and post a new recipe? It may be positive to create a new section of the Cookbook for Py3 only): http://code.activestate.com/recipes/414283/

Re: Need help improving number guessing game

2008-12-16 Thread feba
The good news is that Python functions are objects too, so you can pass them as params to another function. duh, duh, duh, duh, duh! I knew I was missing something there. Thanks. if not mini = x = maxi: also thanks for this, I forgot about that. But I have it as if not minr guess maxr:

Re: tricky nested list unpacking problem

2008-12-16 Thread Arnaud Delobelle
bearophileh...@lycos.com writes: I was waiting to answer because so far I have found a bad-looking solution only. Seeing there's only your solution, I show mine too. It seems similar to your one. I think that the solution below is a bit clearer, although I think it is more resource intensive

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Ken Seehart
cmdrrickhun...@yaho.com wrote: I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent); xmlWriter.BeginElement(child);

Re: Deepcopying slice objects

2008-12-16 Thread Gabriel Genellina
En Sun, 14 Dec 2008 15:43:01 -0200, Max Argus argus@googlemail.com escribió: I stumbled across a thread about that suggests fixing deepcopy to let it copy slice objects. ( http://mail.python.org/pipermail/python-list/2006-August/398206.html). I expected this to work and don't see any reason

Re: Generator slower than iterator?

2008-12-16 Thread rdmurray
Quoth Lie Ryan lie.1...@gmail.com: On Tue, 16 Dec 2008 12:07:14 -0300, Federico Moreira wrote: Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in

Re: subprocess.Popen inheriting

2008-12-16 Thread Gabriel Genellina
En Tue, 16 Dec 2008 07:29:19 -0200, Aaron Brady castiro...@gmail.com escribió: I have a file handle I want to inherit in a child process. I am looking at '_make_inheritable' in 'Popen', but it needs an instance, and by the time I have one, the subprocess is already running. Can't I call

Re: Free place to host python files?

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 15:56, feba feb...@gmail.com wrote: On Dec 16, 8:29 am, s...@pobox.com wrote:     feba I'm getting started in python, and it would be helpful to have a     feba place to put up various code snippets I've made, so I don't have     feba to send them individually to each person I

Re: Free place to host python files?

2008-12-16 Thread mudzot
well, ignoring the fact that pastebin doesn't work for me for some reason, I'm talking about hosting it as a .py downloadable, not a hunk of text. maybe one option is registering in some free project hosting service like code.google.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Free place to host python files?

2008-12-16 Thread feba
Stuff like code.google, sf.net, are more oriented towards serious development, not just holding random apps, aren't they? Anyway, I found MediaFire, which looks like it will suffice for now. -- http://mail.python.org/mailman/listinfo/python-list

Re: help I'm getting delimited

2008-12-16 Thread MRAB
Paul Watson wrote: On Tue, 2008-12-16 at 08:26 -0800, aka wrote: Hi, I'm going nuts over the csv.reader and UnicodeReader class. Somehow I can't get this method working which is supposed to read a csv file which name is inputted but here now hardcoded. What I need for now is that the string

Python Dictionary Algorithm Question

2008-12-16 Thread Brigette Hodson
Hello! I am in a beginning algorithms class this semester and I am working on a presentation. I want to discuss in some detail the algorithm python uses to determine the hash function for python dictionaries. Does anyone know what this algorithm is? Or where I can go to find information on it?

Re: Generator slower than iterator?

2008-12-16 Thread Federico Moreira
2008/12/16 rdmur...@bitdance.com Python 3.0 does not support has_key, it's time to get used to not using it :) Good to know line.split(None, 1)[0] really speeds up the proccess Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Generator slower than iterator?

2008-12-16 Thread Federico Moreira
Hi all, Im parsing a 4.1GB apache log to have stats about how many times an ip request something from the server. The first design of the algorithm was for line in fileinput.input(sys.argv[1:]): ip = line.split()[0] if match_counter.has_key(ip): match_counter[ip] += 1 else:

AIM client code for Python?

2008-12-16 Thread Joe Strout
I'd like to write an AIM bot in Python. I found and tried http://www.jamwt.com/Py-TOC/, but it doesn't work for me: Connecting... Traceback (most recent call last): File aimbot-1.py, line 17, in module bot.go() File /Users/jstrout/Documents/Python-Dev/AIMbot/toc.py, line 62, in go

Re: Does Python3 offer a FrozenDict?

2008-12-16 Thread Paul Moore
On 16 Dec, 17:28, bearophileh...@lycos.com wrote: Johannes Bauer: is there anything like a frozen dict in Python3, so I could do a foo = { FrozenDict({a : b}): 3 } You can adapt this code to Python3 (and post a new recipe? It may be positive to create a new section of the Cookbook for Py3

Re: Free place to host python files?

2008-12-16 Thread feba
On Dec 16, 8:29 am, s...@pobox.com wrote:     feba I'm getting started in python, and it would be helpful to have a     feba place to put up various code snippets I've made, so I don't have     feba to send them individually to each person I want to show it to.     feba I'd prefer to use

Re: String slices work only for first string character ?

2008-12-16 Thread D'Arcy J.M. Cain
On Tue, 16 Dec 2008 13:35:27 + Barak, Ron ron.ba...@lsi.com wrote: Can any one explain why the following string slice works only for the first character, but not for any other ? I think that you need to reread the docs on slices. print |+data[0:1]+| print |+data[1:1]+| If you want the

Re: Python Dictionary Algorithm Question

2008-12-16 Thread Christian Heimes
Brigette Hodson schrieb: Hello! I am in a beginning algorithms class this semester and I am working on a presentation. I want to discuss in some detail the algorithm python uses to determine the hash function for python dictionaries. Does anyone know what this algorithm is? Or where I can go

Re: alt.possessive.its.has.no.apostrophe

2008-12-16 Thread Pete Forman
Aaron Brady castiro...@gmail.com writes: On Dec 15, 11:04 am, Steve Holden st...@holdenweb.com wrote: Tim Chase wrote: Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium.

Re: ethical questions about global variables

2008-12-16 Thread Yinon Ehrlich
On Dec 16, 4:45 am, Giampaolo Rodola' gne...@gmail.com wrote: Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named use_gmt_times to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the

mysql hash generator in python

2008-12-16 Thread Matías Hernández
(sorry for my english, but i'm speak spanish) Hi list.. this is my first post... and obviously if for help.. I try to implement the password function of mysql in a python script. I read that the password function of mysql was implemented with a double sha1() I python i try this: example1: if

Free place to host python files?

2008-12-16 Thread feba
I'm getting started in python, and it would be helpful to have a place to put up various code snippets I've made, so I don't have to send them individually to each person I want to show it to. I'd prefer to use something that would give me a directory for my use only, instead of something where

Re: AIM client code for Python?

2008-12-16 Thread Jean-Paul Calderone
On Tue, 16 Dec 2008 10:54:38 -0700, Joe Strout j...@strout.net wrote: I'd like to write an AIM bot in Python. I found and tried http://www.jamwt.com/Py-TOC/, but it doesn't work for me: Connecting... Traceback (most recent call last): File aimbot-1.py, line 17, in module bot.go() File

Re: cx_Oracle issues

2008-12-16 Thread huw_at1
On Dec 15, 12:59 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 15, 2:44 am, huw_at1 huwdjo...@gmail.com wrote: On Dec 11, 5:34 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 10, 9:48 am, huw_at1 huwdjo...@gmail.com wrote: Hey all. When usingcx_Oracleto run a

Re: Generator slower than iterator?

2008-12-16 Thread Arnaud Delobelle
bearophileh...@lycos.com writes: This can be a little faster still: match_counter = defaultdict(int) for line in fileinput.input(sys.argv[1:]): ip = line.split(None, 1)[0] match_counter[ip] += 1 Bye, bearophile Or maybe (untested): match_counter = defaultdict(int) for line in

Re: Python Dictionary Algorithm Question

2008-12-16 Thread Scott MacDonald
You might be interested in the Beautiful Code book: http://oreilly.com/catalog/9780596510046/ It has a chapter on Python's dict implementation that is pretty good. On Tue, Dec 16, 2008 at 10:51 AM, Brigette Hodson brigettehod...@gmail.comwrote: Hello! I am in a beginning algorithms class this

sorting for recursive folder rename

2008-12-16 Thread ianaré
Hello all, I trying to recursively rename folders and files, and am looking for some ideas on the best way of doing this. The problem is that the given list of items can be in order, and one to all items may be renamed. Here is some preliminary code I have, but which does not work very well.

Re: os.environ.get('SSH_ORIGINAL_COMMAND') returns None

2008-12-16 Thread Yinon Ehrlich
On Dec 15, 8:51 pm, Tzury Bar Yochay afro.syst...@gmail.com wrote: Trying to follow a technique found at bzr I did the following added to ~/.ssh/authorized_keys the command=my_parder parameter which point to a python script file named 'my_parser' and located in / usr/local/bin  (file was

Re: cx_Oracle issues

2008-12-16 Thread huw_at1
On Dec 15, 12:59 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 15, 2:44 am, huw_at1 huwdjo...@gmail.com wrote: On Dec 11, 5:34 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 10, 9:48 am, huw_at1 huwdjo...@gmail.com wrote: Hey all. When usingcx_Oracleto run a

subprocess returncode windows

2008-12-16 Thread Andrew
Hello, I'm running into a strange situation with getting incorrect returncodes / exit status from python subprocess.call. I'm using a python script (runtime 2.6.1 on windows) to automate the deploy of java applications to glassfish application server. Below is an example of using a subprocess

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 18:01, ianaré ian...@gmail.com wrote: For anything more complicated than a simple script, I find it easier to use some sort of config object. This could be a simple dictionnary type class, where the values can be set/retrieved by the other classes directly, or a more elaborate class

sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Lin
Hi, I installed the amd64 version of Python 2.6.1 on my Windows XP x64 system. I was expecting sys.maxint to be 9223372036854775807 (or 2 ^63 -1), but instead I got 2147483647 (i.e., 2^31-1) just like what I got from a 32-bit version of Python. Is this by design or does it indicate a bug or an

Re: Python Dictionary Algorithm Question

2008-12-16 Thread Steve Holden
Brigette Hodson wrote: Hello! I am in a beginning algorithms class this semester and I am working on a presentation. I want to discuss in some detail the algorithm python uses to determine the hash function for python dictionaries. Does anyone know what this algorithm is? Or where I can go to

Re: Does Python3 offer a FrozenDict?

2008-12-16 Thread bearophileHUGS
Paul Moore: Moral - don't assume that all code needs to be rewritten for Python 3.0 :-) In practice this time your moral is of little use: having a place that allows you to choose Py3 OR Py2 code is much better and tidier, helps you save time, helps you avoid wasting some time, etc. Bye,

zipfile.is_zipfile() and string buffers

2008-12-16 Thread Brendan
I would like zipfile.is_zipfile(), to operate on a cStringIO.StringIO string buffer, but is seems only to accept file names as arguments. Should it not be able to handle string buffers too? -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Christian Heimes
Lin schrieb: Hi, I installed the amd64 version of Python 2.6.1 on my Windows XP x64 system. I was expecting sys.maxint to be 9223372036854775807 (or 2 ^63 -1), but instead I got 2147483647 (i.e., 2^31-1) just like what I got from a 32-bit version of Python. Is this by design or does it

Re: subprocess returncode windows

2008-12-16 Thread Christian Heimes
Andrew schrieb: Hello, I'm running into a strange situation with getting incorrect returncodes / exit status from python subprocess.call. I'm using a python script (runtime 2.6.1 on windows) to automate the deploy of java applications to glassfish application server. Below is an example of

Re: sorting for recursive folder rename

2008-12-16 Thread MRAB
ianaré wrote: Hello all, I trying to recursively rename folders and files, and am looking for some ideas on the best way of doing this. The problem is that the given list of items can be in order, and one to all items may be renamed. Here is some preliminary code I have, but which does not work

Re: Memory leak when using a C++ module for Python

2008-12-16 Thread Jaume Bonet
When I tried the C++ function with a C++ main() (skipping the Python part) it didn't show any memory problem, but I'll re-check it anyway, thanks... On Dec 16, 9:16 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 11 Dec 2008 15:35:58 -0200, Jaume Bonet jaume.bo...@gmail.com  

Where is a good open source python project to be used as example?

2008-12-16 Thread Andrea Francia
I'm looking for a python project to use as example to learning python. The project should have these features: 1. is almost fully unit tested 2. use consistently the code convention recommended by PEP 8 3. it's elements are almost fully documented Extra point features are: 4.

executables no longer executing on PC's without Python installed

2008-12-16 Thread jefm
Hi, I recently figured out a problem that came up with the latest versions of Python and cx_Freeze. I thought I post it here so that it might be usefull to someone. The problem was that, when I switched to Python 2.6.x and cx_Freeze-4.0.1.win32-py2.6.msi, the executables that were produced ran

Re: subprocess returncode windows

2008-12-16 Thread Andrew
On Dec 16, 12:50 pm, Christian Heimes li...@cheimes.de wrote: Andrew schrieb: Hello, I'm running into a strange situation with getting incorrect returncodes / exit status from python subprocess.call. I'm using a python script (runtime 2.6.1 on windows) to automate the deploy of java

Re: sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Lin
I installed the amd64 version of Python 2.6.1 on my Windows XP x64 system. I was expecting sys.maxint to be 9223372036854775807 (or 2 ^63 -1), but instead I got 2147483647 (i.e., 2^31-1) just like what I got from a 32-bit version of Python. Is this by design or does it indicate a bug or

Re: Where is a good open source python project to be used as example?

2008-12-16 Thread D'Arcy J.M. Cain
On Tue, 16 Dec 2008 19:13:00 GMT Andrea Francia andrea.fran...@remove-from-here.ohoihihoihoih.to-here.gmx.it wrote: I'm looking for a python project to use as example to learning python. The project should have these features: 1. is almost fully unit tested 2. use consistently the

Re: Generator slower than iterator?

2008-12-16 Thread Arnaud Delobelle
Arnaud Delobelle arno...@googlemail.com writes: match_total = dict((key, val()) for key, val in match_counter.iteritems()) Sorry I meant match_total = dict((key, val.next()) for key, val in match_counter.iteritems()) -- Arnaud --

Re: Free place to host python files?

2008-12-16 Thread Mr . SpOOn
2008/12/16 feba feb...@gmail.com: Stuff like code.google, sf.net, are more oriented towards serious development, not just holding random apps, aren't they? Anyway, I found MediaFire, which looks like it will suffice for now. Take a look to Dropbox (http://www.getdropbox.com/). You can use it

Re: Where is a good open source python project to be used as example?

2008-12-16 Thread Andrea Francia
D'Arcy J.M. Cain wrote: On Tue, 16 Dec 2008 19:13:00 GMT Andrea Francia wrote: I'm looking for a python project to use as example to learning python. The project should have these features: 1. is almost fully unit tested 2. use consistently the code convention recommended by PEP 8

Re: Where is a good open source python project to be used as example?

2008-12-16 Thread D'Arcy J.M. Cain
On Tue, 16 Dec 2008 20:03:21 GMT Andrea Francia andrea.fran...@remove-from-here.ohoihihoihoih.to-here.gmx.it wrote: Did you know where are such projects? http://www.PyGreSQL.org/. Thanks! But I can't find any unit test in the code. Look again. They are in the files named

Re: subprocess.Popen inheriting

2008-12-16 Thread Aaron Brady
On Dec 16, 4:15 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 16 Dec 2008 07:29:19 -0200, Aaron Brady castiro...@gmail.com   escribió: I have a file handle I want to inherit in a child process.  I am looking at '_make_inheritable' in 'Popen', but it needs an instance, and by

Can anyone suggest a good HTTP/1.1 web client?

2008-12-16 Thread Kottiyath
Hi all, I have to connect to a secure website every second to get the data and then post to it. I have been investigating on many web clients in python, but nothing fits the bill properly. The ones I tried implementing are: 1. httplib based - I created myself. (I cannot use urllib2

Re: sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Christian Heimes
Lin schrieb: Ah, this makes sense. Thanks.. The main reason I'm trying 64-bit Python is that I want to write files bigger than 4GB. This should work on Windows x64, right? (i.e., are the pointers bona fide 64 bit?) You can create files with more than 4GB on a 32bit OS, too. It depends on

mod_python resources

2008-12-16 Thread tmallen
I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >