Cannot install python under Win32

2008-06-09 Thread Payala
Hello, I have tried to install python 2.5.1 and 2.5.2 with the same error. The installer starts fine, but when it gets to the part that says "Status: Copying new files" it terminates with an error code of 2356. Does anyone have a clue to what to do? Thanks in advance for your help -- http://mail.

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Diez B. Roggisch
Kris Kowal schrieb: I had a thought that might be pepworthy. Might we be able to break outer loops using an iter-instance specific StopIteration type? This is the desired, if not desirable, syntax:: import string letters = iter(string.lowercase) for letter in letters: for n

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Maric Michaud
Le Monday 09 June 2008 19:03:18 [EMAIL PROTECTED], vous avez écrit : > Thanks Maric! That's very close to what I want, although using dir() > can be misleading because if you invoke it on class B you get all of > class A's methods as well. I took your idea and wrote it up like > this: > > def fin

Re: How to find the first space?

2008-06-09 Thread Chris
On Jun 9, 5:02 pm, Johny <[EMAIL PROTECTED]> wrote: > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' > > The last space I can remove by > Text=re.sub(r"\s(?!\w)",'',Text) > > but I do not know how to remove the first space. > Can anyone help? > >

Re: Q re documentation Python style

2008-06-09 Thread Ethan Furman
kj wrote: I'm a Perlhead trying to learn the Way of Python. I like Python overall, but every once in a while I find myself trying to figure out why Python does some things the way it does. At the moment I'm scratching my head over Python's docstrings. As far as I understand this is the standa

Re: Write to file and see content on screen

2008-06-09 Thread Timothy Grant
On Mon, Jun 9, 2008 at 6:01 PM, <[EMAIL PROTECTED]> wrote: > Hello all, > > New user to python. I can write to a file, however, I would like to > do both...whatever I do on the screen, I'd like to write it to a file. > > any pointers on where I can find this info. > > thanks, > This code has on

Re: 65K length limitation in MySQLdb?

2008-06-09 Thread Jarkko Torppa
On 2008-06-10, TT <[EMAIL PROTECTED]> wrote: > I'm trying to using the following code insert a long string into a > MySQL table, the data type is of that column is TEXT. When the length > of the content is longer than 65K, it get truncated in the database. > Any idea about this? Thanks It's limit

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Dan Bishop
On Jun 9, 8:07 pm, "Kris Kowal" <[EMAIL PROTECTED]> wrote: > I had a thought that might be pepworthy.  Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > >     import string >     letters = iter(string.lo

Re: deleting objects by finding all references and deleting?

2008-06-09 Thread Terry Reedy
"Jacob Davis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I read in some earlier messages that an object in Python is only | removed or freed from memory when all references to that object have | been deleted. Is this so? A Python interpreter *may* delete an object when, but o

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Luis Zarrabeitia
Quoting Kris Kowal <[EMAIL PROTECTED]>: > I had a thought that might be pepworthy. Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > > import string > letters = iter(string.lowercase) >

Re: Python, subprocess, dump, gzip and Cron

2008-06-09 Thread Aidan
TT wrote: On Jun 10, 2:37 pm, Aidan <[EMAIL PROTECTED]> wrote: Hi, I'm having a bit of trouble with a python script I wrote, though I'm not sure if it's related directly to python, or one of the other software packages... The situation is that I'm trying to create a system backup script that c

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Kris Kowal
On Mon, Jun 9, 2008 at 7:39 PM, Paul Hankin <[EMAIL PROTECTED]> wrote: > Have you checked out http://www.python.org/dev/peps/pep-3136/ > > It contains exactly this idea, but using 'break letters' rather than > 'raise letters.StopIteration()'. I think I like the PEP's syntax > better than yours, bu

Re: Python, subprocess, dump, gzip and Cron

2008-06-09 Thread TT
On Jun 10, 2:37 pm, Aidan <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having a bit of trouble with a python script I wrote, though I'm not > sure if it's related directly to python, or one of the other software > packages... > > The situation is that I'm trying to create a system backup script that >

Python, subprocess, dump, gzip and Cron

2008-06-09 Thread Aidan
Hi, I'm having a bit of trouble with a python script I wrote, though I'm not sure if it's related directly to python, or one of the other software packages... The situation is that I'm trying to create a system backup script that creates an image of the system, filters the output though gzip

Re: Separators inside a var name

2008-06-09 Thread Kam-Hung Soh
Rainy wrote: I have a stylistic question. In most languages words in var. name are separated by underscores or cap letters, resulting in var names like var_name, VarName and varName. I don't like that very much because all 3 ways of naming look bad and/or hard to type. From what I understand, sch

Re: Do this as a list comprehension?

2008-06-09 Thread Jason Scheirer
On Jun 9, 7:06 am, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Jun 6, 1:40 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > >> On Thu, 05 Jun 2008 23:42:07 -0400, John Salerno wrote: > >>> Is it possible to write a list comprehension for this so as to produce a > >>> list of

Re: Odd behavior of python module listing

2008-06-09 Thread Benjamin Kaplan
On Mon, Jun 9, 2008 at 4:58 PM, Lie <[EMAIL PROTECTED]> wrote: > Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to > the python interpreter, I happen to do this: > > ### START OF PYTHON SESSION ### > Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubu

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Paul Hankin
On Jun 10, 10:07 am, "Kris Kowal" <[EMAIL PROTECTED]> wrote: > I had a thought that might be pepworthy.  Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > >     import string >     letters = iter(string.

Re: access variables from one Python session to another on the same machine?

2008-06-09 Thread Reckoner
On Jun 9, 5:23 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > Suppose I have two different command windows going on the same > > machine, each running their own Python interpreters. > > > Is it possible to access the variables in one of the interpreter- > > sessions from the other? > > > It

Re: Write to file and see content on screen

2008-06-09 Thread CM
On Jun 9, 9:01 pm, [EMAIL PROTECTED] wrote: > Hello all, > > New user to python. I can write to a file, however, I would like to > do both...whatever I do on the screen, I'd like to write it to a file. > > any pointers on where I can find this info. > > thanks, There is probably some smart way t

65K length limitation in MySQLdb?

2008-06-09 Thread TT
I'm trying to using the following code insert a long string into a MySQL table, the data type is of that column is TEXT. When the length of the content is longer than 65K, it get truncated in the database. Any idea about this? Thanks import MySQLdb import MySQLdb.cursors class MyDb: def __in

Re: Numpy, adding a row to a matrix

2008-06-09 Thread sapsi
Hello, Thank you. Yes, I will post to the numpy mailing list in future. Regards Saptarshi On Jun 9, 4:04 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > sapsi wrote: > > Hello, > > I have a numpy array (2 rows 3 colums) > > > import numpy > > a=numpy.array(  [ [1,2,3] , [3,3,1] ]) > > > I wish to ad

PEP on breaking outer loops with StopIteration

2008-06-09 Thread Kris Kowal
I had a thought that might be pepworthy. Might we be able to break outer loops using an iter-instance specific StopIteration type? This is the desired, if not desirable, syntax:: import string letters = iter(string.lowercase) for letter in letters: for number in range(10):

Re: How to kill a thread?

2008-06-09 Thread Rhamphoryncus
On Jun 9, 2:52 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 9, 9:20 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 6, 12:44 pm, The Pythonista <[E

Write to file and see content on screen

2008-06-09 Thread lamarts
Hello all, New user to python. I can write to a file, however, I would like to do both...whatever I do on the screen, I'd like to write it to a file. any pointers on where I can find this info. thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 5:34 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > Rainy <[EMAIL PROTECTED]> writes: > > I have a stylistic question. In most languages words in var. name are > > separated by underscores or cap letters, resulting in var names like > > var_name, VarName and varName. I don't like tha

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 5:45 pm, Lie <[EMAIL PROTECTED]> wrote: > > As Sebastian have said, it just can't work like that in python and > most languages. var1-var2 is a subtraction, because - is an operator. > Operator must allow spaces and lack of spaces, how would you want > these to be interpreted then: a+b,

Which Python Wiki engine?

2008-06-09 Thread Ariel Balter
Kenneth, I thought this was a very interesting set of requests. Did you ever find a solution? Thanks, Ariel I'm looking for a Wiki engine to set up for my company, so that we can incrementally add user documentation for a fairly complex program, plus allow users to add their own comments

Re: access variables from one Python session to another on the same machine?

2008-06-09 Thread Daniel Fetchinson
> Suppose I have two different command windows going on the same > machine, each running their own Python interpreters. > > Is it possible to access the variables in one of the interpreter- > sessions from the other? > > It turns out I have limited control over one of the sessions (i.e. > cannot co

Re: Do this as a list comprehension?

2008-06-09 Thread Ricardo Aráoz
Mensanator wrote: On Jun 6, 1:40 pm, The Pythonista <[EMAIL PROTECTED]> wrote: On Thu, 05 Jun 2008 23:42:07 -0400, John Salerno wrote: Is it possible to write a list comprehension for this so as to produce a list of two-item tuples? base_scores = range(8, 19) score_costs = [0, 1, 1, 1, 1, 1, 1,

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Fuzzyman
On Jun 9, 10:23 am, Bruno Desthuilliers wrote: > Mark Wooding a écrit : > > > > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > >> So, you are stating that no API programmer using Python *ever* has a > >> valid or genuine reason for wanting (even if he can't have it) genuine > >> 'hiding' of internal st

Re: access variables from one Python session to another on the same machine?

2008-06-09 Thread Larry Bates
Reckoner wrote: Suppose I have two different command windows going on the same machine, each running their own Python interpreters. Is it possible to access the variables in one of the interpreter- sessions from the other? It turns out I have limited control over one of the sessions (i.e. canno

Re: Question by someone coming from C...

2008-06-09 Thread Skye
Very cool - I'm liking the pythonic way of doing things more and more. The logger namespace/singleton idea makes great sense! I see how the module variables make globals irrelevant, thanks! Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Question by someone coming from C...

2008-06-09 Thread Carl Banks
On Jun 9, 5:00 pm, Skye <[EMAIL PROTECTED]> wrote: > Writing this app in Python, not sure what the "best practice" would > be. > > I want a bitfield global logging level that allows me to turn specific > debugging modules on and off. If I was doing this in C, I'd just use > some globals like: > >

access variables from one Python session to another on the same machine?

2008-06-09 Thread Reckoner
Suppose I have two different command windows going on the same machine, each running their own Python interpreters. Is it possible to access the variables in one of the interpreter- sessions from the other? It turns out I have limited control over one of the sessions (i.e. cannot control all the

Re: Getting current screen resolution

2008-06-09 Thread Larry Bates
Thomas Morton wrote: This is a "thing" that has been annoying me all morning: and I can't work out how to do it. I need a way to get the DPI or screen resolution of the monitor that a script is currently runnign on. I have a way in Windows but it doesnt port to Unix (which is important). Any i

Re: Question by someone coming from C...

2008-06-09 Thread Diez B. Roggisch
Skye schrieb: Writing this app in Python, not sure what the "best practice" would be. I want a bitfield global logging level that allows me to turn specific debugging modules on and off. If I was doing this in C, I'd just use some globals like: unsigned int debug_level = 0; #define DEBUG_GENER

Re: Question by someone coming from C...

2008-06-09 Thread John Krukoff
On Mon, 2008-06-09 at 15:02 -0700, Skye wrote: > On Jun 9, 2:35 pm, Matimus <[EMAIL PROTECTED]> wrote: > > The only time to do that sort of thing (in python) is when interacting > > with something else that isn't written in Python though. In general, > > for logging, just use the standard logging

Re: Question by someone coming from C...

2008-06-09 Thread Skye
On Jun 9, 2:35 pm, Matimus <[EMAIL PROTECTED]> wrote: > The only time to do that sort of thing (in python) is when interacting > with something else that isn't written in Python though. In general, > for logging, just use the standard logging > module:http://docs.python.org/lib/module-logging.html

Re: Question by someone coming from C...

2008-06-09 Thread Lie
On Jun 10, 4:32 am, Skye <[EMAIL PROTECTED]> wrote: > OK, sounds good.  So if not bitfields, what would be a good Python-y > way to do it? The word is "pythonic". > Flip booleans in a "debug config" dictionary or something? I'm not really sure, I've been programming with Python (and some other l

Re: Does the python library of Google Data API is truly free?

2008-06-09 Thread Diez B. Roggisch
Kless schrieb: On 9 jun, 21:40, Lie <[EMAIL PROTECTED]> wrote: Do you notice that the terms are for the SERVICE not for the SOFTWARE. The terms for the service is quite reasonable, as I see it. The software itself is governed by the Apache License 2.0, detailed here:http://www.apache.org/license

Re: Separators inside a var name

2008-06-09 Thread Lie
On Jun 10, 3:38 am, Rainy <[EMAIL PROTECTED]> wrote: > On Jun 9, 2:05 pm, "Sebastian \"lunar\" Wiesner" > > <[EMAIL PROTECTED]> wrote: > >  Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > > > > I have a stylistic question. In most languages words in var. name are > > > separated by unders

Re: pass data from optparse to other class instances

2008-06-09 Thread Diez B. Roggisch
Tim Arnold schrieb: Hi, I'm writing a command-line interface using optparse. The cli takes several options with a single action and several parameters to be used in the resulting worker classes. I've been passing parameters from optparse to the workers in two ways: (1) creating a Globals.py modu

Re: Separators inside a var name

2008-06-09 Thread [EMAIL PROTECTED]
On 9 juin, 20:05, "Sebastian \"lunar\" Wiesner" <[EMAIL PROTECTED]> wrote: > Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > (snip) > > From what I understand, scheme can have variables like var-name. I'm > > curious about reasons that python chose to disallow this. > > "-" is an operato

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > But if it takes 6 month to get the mentioned developer to release > something I can use, I'm screwed up. Fine. I've lost track of how many times I've said this now, but my suggestion for a "priv" keyword allowed for "indirect" ac

Re: Question by someone coming from C...

2008-06-09 Thread Matimus
On Jun 9, 2:00 pm, Skye <[EMAIL PROTECTED]> wrote: > Writing this app in Python, not sure what the "best practice" would > be. > > I want a bitfield global logging level that allows me to turn specific > debugging modules on and off. If I was doing this in C, I'd just use > some globals like: > >

Re: Separators inside a var name

2008-06-09 Thread Alexander Schmolck
Rainy <[EMAIL PROTECTED]> writes: > I have a stylistic question. In most languages words in var. name are > separated by underscores or cap letters, resulting in var names like > var_name, VarName and varName. I don't like that very much because all > 3 ways of naming look bad and/or hard to type.

Re: Question by someone coming from C...

2008-06-09 Thread Skye
OK, sounds good. So if not bitfields, what would be a good Python-y way to do it? Flip booleans in a "debug config" dictionary or something? Skye -- http://mail.python.org/mailman/listinfo/python-list

Re: Question by someone coming from C...

2008-06-09 Thread Lie
On Jun 10, 4:00 am, Skye <[EMAIL PROTECTED]> wrote: > Writing this app in Python, not sure what the "best practice" would > be. > > I want a bitfield global logging level that allows me to turn specific > debugging modules on and off.  If I was doing this in C, I'd just use > some globals like: > >

Re: Does the python library of Google Data API is truly free?

2008-06-09 Thread Kless
On 9 jun, 21:40, Lie <[EMAIL PROTECTED]> wrote: > Do you notice that the terms are for the SERVICE not for the SOFTWARE. > The terms for the service is quite reasonable, as I see it. > The software itself is governed by the Apache License 2.0, detailed > here:http://www.apache.org/licenses/LICENSE-

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread [EMAIL PROTECTED]
On 9 juin, 20:43, "Russ P." <[EMAIL PROTECTED]> wrote: (snip argument about s/private/public/g on a whole source tree not being a fork, and not being by far a worse hack than monkeypatching a small specific part of a whole lib - what can I say ?) > How about some common sense here. Good question

pass data from optparse to other class instances

2008-06-09 Thread Tim Arnold
Hi, I'm writing a command-line interface using optparse. The cli takes several options with a single action and several parameters to be used in the resulting worker classes. I've been passing parameters from optparse to the workers in two ways: (1) creating a Globals.py module, set parameters onc

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Stefan Behnel
Ray Cote wrote: > Beautiful Soup is a bit slower, but it will actually parse some of the > bizarre HTML you'll download off the web. [...] > I don't know if some of the quicker parsers discussed require > well-formed HTML since I've not used them. You may want to consider > using one of the quicker

Question by someone coming from C...

2008-06-09 Thread Skye
Writing this app in Python, not sure what the "best practice" would be. I want a bitfield global logging level that allows me to turn specific debugging modules on and off. If I was doing this in C, I'd just use some globals like: unsigned int debug_level = 0; #define DEBUG_GENERAL 0x0001 #defin

Odd behavior of python module listing

2008-06-09 Thread Lie
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to the python interpreter, I happen to do this: ### START OF PYTHON SESSION ### Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more

Re: How to kill a thread?

2008-06-09 Thread Fuzzyman
On Jun 9, 9:20 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > > >> It's always been my understanding

Re: Does the python library of Google Data API is truly free?

2008-06-09 Thread Lie
On Jun 10, 1:36 am, Kless <[EMAIL PROTECTED]> wrote: > The Python Client Library for Google Data APIs [1] has been licensed > as Apache 2.0 -a free license- but at the same time they are > restricting the rights of the users with these conditions [2], and I > don't like for anything this. > > --Wit

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:40 am, Scott David Daniels <[EMAIL PROTECTED]> wrote: > dj wrote: > > Hello again, > > > Does anyone know which method in the time module will generate and am > > or pm ? > > If none of the method will do this for me. Can I produce the value on > > my own ? > > Any suggestions ? > > Rea

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 2:05 pm, "Sebastian \"lunar\" Wiesner" <[EMAIL PROTECTED]> wrote: >  Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > > > I have a stylistic question. In most languages words in var. name are > > separated by underscores or cap letters, resulting in var names like > > var_name, V

Re: Web Crawler - Python or Perl?

2008-06-09 Thread George Sakkis
On Jun 9, 1:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of reso

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:24 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "dj" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hello again, > > > Does anyone know which method in the time module will generate and am > > or pm ? > > If none of the method will do this for me. Can I produce

Re: _POSIX_C_SOURCE

2008-06-09 Thread Nick Craig-Wood
Madhur <[EMAIL PROTECTED]> wrote: >I would like to know the difference between using the > C_INCLUDE_PATH and using the -I option with compilers. How are they > different? No idea on that - I always just use -I > The problem which I am facing is that I am having a > s

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of resource

Re: How to kill a thread?

2008-06-09 Thread Rhamphoryncus
On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > >> It's always been my understanding that you can't forcibly kill a thread > >> in Python (at least not in a po

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Sebastian "lunar" Wiesner
subeen <[EMAIL PROTECTED]> at Montag 09 Juni 2008 20:21: > On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> subeen wrote: >> > can use urllib2 module and/or beautiful soup for developing crawler >> >> Not if you care about a) speed and/or b) memory efficiency. >> >> http://blog.ia

Re: Numpy, adding a row to a matrix

2008-06-09 Thread Robert Kern
sapsi wrote: Hello, I have a numpy array (2 rows 3 colums) import numpy a=numpy.array( [ [1,2,3] , [3,3,1] ]) I wish to add a row, this is how i do it s=a.shape numpy.resize(a,s[0]+1,s[1]) a[s[0]]=new row vector. Q: Is this a costly operation? It can be if you have large arrays. What hap

Re: Getting current screen resolution

2008-06-09 Thread Miki
Hello, > This is a "thing" that has been annoying me all morning: and I can't > work out how to do it. > > I need a way to get the DPI or screen resolution of the monitor that a > script is currently runnign on. > > I have a way in Windows but it doesnt port to Unix (which is important). > > Any i

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Ray Cote
At 11:21 AM -0700 6/9/08, subeen wrote: On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: subeen wrote: > can use urllib2 module and/or beautiful soup for developing crawler Not if you care about a) speed and/or b) memory efficiency. > http://blog.ianbicking.org/2008/03/30/pyt

Numpy, adding a row to a matrix

2008-06-09 Thread sapsi
Hello, I have a numpy array (2 rows 3 colums) import numpy a=numpy.array( [ [1,2,3] , [3,3,1] ]) I wish to add a row, this is how i do it s=a.shape numpy.resize(a,s[0]+1,s[1]) a[s[0]]=new row vector. Q: Is this a costly operation? What happens if i have to it several (and unknown) number of ti

Re: Separators inside a var name

2008-06-09 Thread Roger Miller
On Jun 9, 7:29 am, Rainy <[EMAIL PROTECTED]> wrote: > ... Another question I have is what > other languages allow this naming scheme? The most widely used such language would probably be COBOL, where you write things like SUBTRACT DISCOUNT FROM LIST-PRICE GIVING AMOUNT-DUE I doubt that syntax

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:22 am, Bruno Desthuilliers wrote: > > Does > > anyone object to not having access from outside a function to local > > variables within the function? I doubt it. The other thing is that the > > vast majority of Python software, I would guess, is provided with > > source code. How many

Does the python library of Google Data API is truly free?

2008-06-09 Thread Kless
The Python Client Library for Google Data APIs [1] has been licensed as Apache 2.0 -a free license- but at the same time they are restricting the rights of the users with these conditions [2], and I don't like for anything this. --With a hand I show you one thing but with the another one I make an

Using ElementTree as backend for a chat web application issues

2008-06-09 Thread Marcelo de Moraes Serpa
Hello list, I've built a chat with a front-end Ajax client and backend usign ElementTree to persist the data. The problem is that the xml structure I use to persist some of the global configuration of the application usually gets corrupted, for example, let's say the structure is something like:

GIL cpu multi core usage problem

2008-06-09 Thread Pau Freixes
Hi List, Surly this is a recurring theme into python dev world, but I need your help for confirm if the follow image it's really http://www.milnou.net/~pfreixes/img/cpu_usage_gil_problem.png I'm writing a brief article for my blog

Re: Web Crawler - Python or Perl?

2008-06-09 Thread subeen
On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > subeen wrote: > > can use urllib2 module and/or beautiful soup for developing crawler > > Not if you care about a) speed and/or b) memory efficiency. > > http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ > > Stefan

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:23 am, Bruno Desthuilliers wrote: > Mark Wooding a écrit : > > > > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > >> So, you are stating that no API programmer using Python *ever* has a > >> valid or genuine reason for wanting (even if he can't have it) genuine > >> 'hiding' of internal sta

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Stefan Behnel
subeen wrote: > can use urllib2 module and/or beautiful soup for developing crawler Not if you care about a) speed and/or b) memory efficiency. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > 1) I/O issues: my biggest constraint in terms of resource will be > bandwidth throttle neck. > 2) Efficiency issues: The crawlers have to be fast, robust and as > "memory efficient" as possible. I am running all of my crawlers on > cheap pcs with about 500 mb RAM and P3 t

Re: Web Crawler - Python or Perl?

2008-06-09 Thread subeen
On Jun 9, 11:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of reso

Re: Separators inside a var name

2008-06-09 Thread Sebastian "lunar" Wiesner
Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > I have a stylistic question. In most languages words in var. name are > separated by underscores or cap letters, resulting in var names like > var_name, VarName and varName. I don't like that very much because all > 3 ways of naming look b

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 1:42 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Rainy wrote: > > I have a stylistic question. In most languages words in var. name are > > separated by underscores or cap letters, resulting in var names like > > var_name, VarName and varName. I don't like that very much because all > >

Re: How to get full path to script?

2008-06-09 Thread Mike Driscoll
On Mon, Jun 9, 2008 at 12:42 PM, Sebastian lunar Wiesner <[EMAIL PROTECTED]> wrote: > Mike Driscoll <[EMAIL PROTECTED]> at Montag 09 Juni 2008 18:20: > >> On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: >>> In <[EMAIL PROTECTED]> "Mike Driscoll" >>> <[EMAIL PROTECTED]> writes: >>> >

Web Crawler - Python or Perl?

2008-06-09 Thread disappearedng
Hi all, I am currently planning to write my own web crawler. I know Python but not Perl, and I am interested in knowing which of these two are a better choice given the following scenario: 1) I/O issues: my biggest constraint in terms of resource will be bandwidth throttle neck. 2) Efficiency issu

Re: How to get full path to script?

2008-06-09 Thread Sebastian "lunar" Wiesner
Mike Driscoll <[EMAIL PROTECTED]> at Montag 09 Juni 2008 18:20: > On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]> "Mike Driscoll" >> <[EMAIL PROTECTED]> writes: >> >>>For my compiled scripts, I usually use this variation: >> >>>path = os.path.abspath(os.pa

Re: Separators inside a var name

2008-06-09 Thread Gary Herron
Rainy wrote: I have a stylistic question. In most languages words in var. name are separated by underscores or cap letters, resulting in var names like var_name, VarName and varName. I don't like that very much because all 3 ways of naming look bad and/or hard to type. From what I understand, sch

Separators inside a var name

2008-06-09 Thread Rainy
I have a stylistic question. In most languages words in var. name are separated by underscores or cap letters, resulting in var names like var_name, VarName and varName. I don't like that very much because all 3 ways of naming look bad and/or hard to type. From what I understand, scheme can have va

Re: money data type

2008-06-09 Thread Stephan Diehl
Lie wrote: > On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: >> Hi lazyweb, >> I'm wondering, if there is a usable money data type for python available. >> A quick search in pypi and google didn't convey anything, even though the >> decimal data type seemed to be planned as a money da

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread allendowney
Thanks Maric! That's very close to what I want, although using dir() can be misleading because if you invoke it on class B you get all of class A's methods as well. I took your idea and wrote it up like this: def find_defining_class(obj, meth_name): """find and return the class object that w

Re: investigate python auth problem

2008-06-09 Thread Michael Ströder
David Hláčik wrote: I have reproduced steps, to show you sample on another module and its results in INN (becouse i really like to solve this :) Since I don't see anything related to python-ldap please don't follow-up on python-ldap-dev mailing list (removed it from Cc:). Thank you. If the

Re: money data type

2008-06-09 Thread Lie
On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Hi lazyweb, > I'm wondering, if there is a usable money data type for python available. > A quick search in pypi and google didn't convey anything, even though the > decimal data type seemed to be planned as a money data type originaly.

Re: Can this be done with list comprehension?

2008-06-09 Thread Maric Michaud
Le Sunday 08 June 2008 02:27:54 Terry Reedy, vous avez écrit : > "Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | I figured that out few minutes ago, such a newbie mistake :). The fix I > | came up with is: > | > | result = ['something'] + [someMethod(i) for i i

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Gary Herron
Lie wrote: On Jun 9, 10:28 pm, [EMAIL PROTECTED] wrote: Hi All. In a complex inheritance hierarchy, it is sometimes difficult to find where a method is defined. I thought it might be possible to get this info from the method object itself, but it looks like maybe not. Here is the test case

Re: How to get full path to script?

2008-06-09 Thread Mike Driscoll
On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]> "Mike Driscoll" <[EMAIL PROTECTED]> writes: > >>For my compiled scripts, I usually use this variation: > >>path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))) > > Thanks. But why the os.path.join

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Lie
On Jun 9, 10:28 pm, [EMAIL PROTECTED] wrote: > Hi All. > > In a complex inheritance hierarchy, it is sometimes difficult to find > where a > method is defined.  I thought it might be possible to get this info > from the > method object itself, but it looks like maybe not.  Here is the test > case I

Re: How to get full path to script?

2008-06-09 Thread kj
In <[EMAIL PROTECTED]> "Mike Driscoll" <[EMAIL PROTECTED]> writes: >For my compiled scripts, I usually use this variation: >path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))) Thanks. But why the os.path.join()? (BTW, I did read the docs before posting, but they make no sense to

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Maric Michaud
Le Monday 09 June 2008 17:28:45 [EMAIL PROTECTED], vous avez écrit : > So, is there any way to inspect a method to see where (in what class) > it > is defined? In [56]: class a(object) : def a() : return def b() : return : : In [59]: class b(a) : def b() : return de

Re: Q re documentation Python style

2008-06-09 Thread kj
Wow. That was a great bunch of advice. Thank you all very much! Kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find the first space?

2008-06-09 Thread Maric Michaud
Le Monday 09 June 2008 17:02:51 Johny, vous avez écrit : > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' > > The last space I can remove by > Text=re.sub(r"\s(?!\w)",'',Text) > For spaces at the end of line, I prefer this one : re.sub(r'\s*$',

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Lie
On Jun 9, 7:20 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> Now of course noone would defend such a limitation on the grounds > >> that one doesn't need th

Re: How to find the first space?

2008-06-09 Thread Diez B. Roggisch
Johny wrote: > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' > > The last space I can remove by > Text=re.sub(r"\s(?!\w)",'',Text) > > but I do not know how to remove the first space. > Can anyone help? Use the strip-method, as defined on s

  1   2   >