Elisa Media Center 0.5.2 Release

2008-07-22 Thread Olivier Tilloy
Dear Elisa Users, The Elisa team is happy to announce the second official release of the 0.5 series of the Elisa Media Center, Elisa 0.5.2 'Good news everyone...'. With this release Elisa takes another step towards its goal of being a true cross-platform media center. It works under Windows

Re: string[i:j:k]

2008-07-22 Thread Gary Herron
konstantin wrote: On Jul 22, 9:18 am, alex23 [EMAIL PROTECTED] wrote: On Jul 22, 3:10 pm, konstantin [EMAIL PROTECTED] wrote: some_string[i:j:k] What does it mean? i = start position, j = end position, k = step size s = ABABABABABABAB s[0:6:2] 'AAA' s

Web Page Construction in Python

2008-07-22 Thread SUBHABRATA
Dear Group, I am getting some questions on doing Web Pages in Python. I have some interactive codes in python for which I like to make web pages. I am trying to use kid. Kid I learnt, and is easy, too. My questions are: i) Am I going correct? ii) Is there any language other than kid? iii)

Re: string[i:j:k]

2008-07-22 Thread John McMonagle
konstantin wrote: Thanks! It seems that negative step leads in reverse direction. But logic isn't completely clear for me. s = '123456789' s[::-2] '97531' but s[:-1:-2] '' though I expected something like '8642' What did i missed? -- You need to *start* at the second from last

Re: Python Embedding Thread

2008-07-22 Thread googler . 1 . webmaster
Hi! Thank you very much for your answers. I have a menue with a script in it. So my app starts a new thread for each script. So I would like to run two scripts all the same time. Could someone give me a tip, what I have to set in my code? Thank you :) --

Re: Web Page Construction in Python

2008-07-22 Thread Diez B. Roggisch
SUBHABRATA schrieb: Dear Group, I am getting some questions on doing Web Pages in Python. I have some interactive codes in python for which I like to make web pages. I am trying to use kid. Kid I learnt, and is easy, too. My questions are: i) Am I going correct? ii) Is there any

Re: Python Written in C?

2008-07-22 Thread cokofreedom
On Jul 22, 5:59 am, Larry Bates [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-07-22, Larry Bates [EMAIL PROTECTED] wrote: You talk about writing it in assembly language for each MPU chip. Actually it is even better than that. We now have these modern inventions, called

Re: fromfile error on windows, not mac

2008-07-22 Thread Uwe Schmitt
jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read the data. I use it like this: Signal = zeros((N, 16), dtype=float32)

Re: Python Written in C?

2008-07-22 Thread Paul Rudin
DaveM [EMAIL PROTECTED] writes: On Mon, 21 Jul 2008 03:18:01 +0200, Michiel Overtoom [EMAIL PROTECTED] wrote: Many major text/word processing programs (Emacs, vi, MS-Word) are also written in C. I thought Emacs was written in Lisp. The core - including the lisp interpreter - is written in

Re: string[i:j:k]

2008-07-22 Thread konstantin
Now it's clear. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing sqlite3.h Error when Building Debug Python -- Windows Vista

2008-07-22 Thread Tim Golden
Bev in TX wrote: Thanks for letting me know about this. I installed Subversion and tried to make the build work like that, but it fails. [... snip problems ...] I'm afraid I'm not using VS 2005, nor Vista, nor 64-bit, so I hope someone else can help. If you don't get any take-up here try the

Hello,who can help me!

2008-07-22 Thread birdprince
I have implemented a C++ COM,which contains two interface in one coclass. when i use this COM in python: dll=win32com.client.Dispatch(X) then i can only call default interface's method,but can't call non default interface's method. who can tell me how to call non default interface's method.

RE: Change PC to Win or Windows

2008-07-22 Thread Michael . Coll-Barth
From: Derek Martin The term PC is commonly used in English, in the United States and other English speaking countries, to mean a computer running Microsoft Windows. That isn't quite true. My kids are heading off to college and are in the market for laptops. The question they had for

Re: Change PC to Win or Windows

2008-07-22 Thread Derek Martin
On Mon, Jul 21, 2008 at 02:47:31PM -0700, Lie wrote: Common usage isn't always correct. Actually it is, inherently... When usage becomes common, the language becomes redefined, and its correctness is therefore true by identity (to borrow a mathematical term). The scholars complain for a

Re: scanf in python

2008-07-22 Thread Fredrik Lundh
AMD wrote: I had seen this pure python implementation, but it is not as fast or as elegant as would be an implementation written in C directly within python with no need for import. maybe you should wait with disparaging comments about how Python is not what you want it to be until you've

xpathEval fails for large files

2008-07-22 Thread Kanchana
Hi, I tried to extract some data with xpathEval. Path contain more than 100,000 elements. doc = libxml2.parseFile(test.xml) ctxt = doc.xpathNewContext() result = ctxt.xpathEval('//src_ref/@editions') doc.freeDoc() ctxt.xpathFreeContext() this will stuck in following line and will result in high

Re: Instance

2008-07-22 Thread karthikbalaguru
On Jul 17, 5:34 pm, Calvin Spealman [EMAIL PROTECTED] wrote: On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru [EMAIL PROTECTED] wrote: Hi, I am new to python. I am trying to use the python files given to me for bringing up a setup. I get the following error while trying to use a python

Re: proliferation of computer languages

2008-07-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: There is a proliferation of computer languages today like never before. ... today ... 1,700 special programming languages used to 'communicate' in over 700 application areas. -- Computer Software Issues, an American Mathematical Association Prospectus, July 1965. (as

Re: xpathEval fails for large files

2008-07-22 Thread Fredrik Lundh
Kanchana wrote: I tried to extract some data with xpathEval. Path contain more than 100,000 elements. doc = libxml2.parseFile(test.xml) ctxt = doc.xpathNewContext() result = ctxt.xpathEval('//src_ref/@editions') doc.freeDoc() ctxt.xpathFreeContext() this will stuck in following line and will

Re: The Importance of Terminology's Quality

2008-07-22 Thread Martin Gregorie
On Tue, 24 Jun 2008 18:42:15 -0400, John W Kennedy wrote: David Combs wrote: passing *unnamed* functions as args (could Algol 60 also do something like that, via something it maybe termed a thunk) No, the thunks were necessary at the machine-language level to /implement/ ALGOL 60, but

Re: Hello,who can help me!

2008-07-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: I have implemented a C++ COM,which contains two interface in one coclass. when i use this COM in python: dll=win32com.client.Dispatch(X) then i can only call default interface's method,but can't call non default interface's method. who can tell me how to call

regarding SWIG

2008-07-22 Thread Anish Chapagain
Hi.. I'm new to SWIG and need to create Wrapper for C code, so, I have installed the SWIG already but doesnot know how to run it for generating Interface file... My C code is in message.c so what do i need to do the first step..uisng SWIG..i read the documentation but cannot grasp creating

Re: The Importance of Terminology's Quality

2008-07-22 Thread arsyed
On Tue, Jul 22, 2008 at 5:21 AM, Martin Gregorie [EMAIL PROTECTED] wrote: On Tue, 24 Jun 2008 18:42:15 -0400, John W Kennedy wrote: David Combs wrote: passing *unnamed* functions as args (could Algol 60 also do something like that, via something it maybe termed a thunk) No, the thunks were

Re: The Importance of Terminology's Quality

2008-07-22 Thread Josef Moellers
Martin Gregorie wrote: Are you sure about that? I used Algol 60 on an Elliott 503 and the ICL 1900 series back when it was a current language. The term thunking did not appear in either compiler manual nor in any Algol 60 language definition I've seen. A60 could pass values by name or value

Re: automating python programs

2008-07-22 Thread Anish Chapagain
On Jul 21, 7:28 pm, Dan Upton [EMAIL PROTECTED] wrote: On Mon, Jul 21, 2008 at 2:12 PM, Zach Hobesh [EMAIL PROTECTED] wrote: Hi, I'm trying to figure out how to run a python program on a schedule, maybe every half an hour...  Is this possible? Thanks! -Zach --

DB Pool

2008-07-22 Thread bcurtu
Hi, I use MySQLdb lib to access my DB, because I want to opttimize my sql queries. The application I'm working on has quite a few traffic load, so I want to minimize the time of creating/destroying cursors: My typical code is sth like: cursor=con.cursor() cursor.execute(sql)

Re: xpathEval fails for large files

2008-07-22 Thread Paul Boddie
On 22 Jul, 11:00, Kanchana [EMAIL PROTECTED] wrote: I tried to extract some data with xpathEval. Path contain more than 100,000 elements. doc = libxml2.parseFile(test.xml) ctxt = doc.xpathNewContext() result = ctxt.xpathEval('//src_ref/@editions') doc.freeDoc() ctxt.xpathFreeContext()

Re: proliferation of computer languages

2008-07-22 Thread J�rgen Exner
Chris Rathman [EMAIL PROTECTED] wrote: I can't say that I see any particular point to the essay. You must be new here. There never is any particular point to Xah Lee's rantings except to cross-post borderline topics to borderline relevant NGs and then lay back and enjoy the ensuing slaughter.

Re: Python Embedding Thread

2008-07-22 Thread googler . 1 . webmaster
Hi! I fixed the code. This code snippet runs in a seperate thread: PyObject *dict=NULL; PyGILState_STATE state = PyGILState_Ensure(); dict = CreateMyGlobalDictionary();

Re: Converting List of String to Integer

2008-07-22 Thread dusans
a = [['1', '2'], ['3'], ['4', '5', '6'], ['7', '8', '9', '0']] [map(int, i) for i in a] [[1, 2], [3], [4, 5, 6], [7, 8, 9, 0]] On Jul 21, 9:06 pm, Samir [EMAIL PROTECTED] wrote: Hi Everyone, I am relatively new to Python so please forgive me for what seems like a basic question. Assume

Automatically loading and initialising objects from a plugins directory

2008-07-22 Thread Dave Challis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to write some code which: 1. Finds all modules in a plugin directory 2. Imports those modules 3. Creates an instance of each object defined in the module (each module will contain exactly 1 object, which is a subclass of 'Plugin') The

Re: xpathEval fails for large files

2008-07-22 Thread Jim Washington
Kanchana wrote: Hi, I tried to extract some data with xpathEval. Path contain more than 100,000 elements. doc = libxml2.parseFile(test.xml) ctxt = doc.xpathNewContext() result = ctxt.xpathEval('//src_ref/@editions') doc.freeDoc() ctxt.xpathFreeContext() this will stuck in following

Re: Converting List of String to Integer

2008-07-22 Thread Rishabh Manocha
Just to throw my hat in the ring, this is another way you can do this: [(lambda x : [int(ii) for ii in x])(y) for y in a] However, I do think dusans way is more elegant. Best, R On Tue, Jul 22, 2008 at 4:58 PM, dusans [EMAIL PROTECTED] wrote: a = [['1', '2'], ['3'], ['4', '5', '6'], ['7',

Re: Python embedding question (2).

2008-07-22 Thread Thomas Troeger
Carl Banks wrote: On Jul 17, 9:57 am, Thomas Troeger [EMAIL PROTECTED] wrote: I'd say that PyGame could be a solution. Or otherwise you could do your own audio/graphics programming (you don't tell us which OS you use, but there exist python modules that allow you to do barebones graphics sound

Re: Web Page Construction in Python

2008-07-22 Thread [EMAIL PROTECTED]
Also, look at: http://www.djangoproject.com/ /Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Time Complexity of String Operations

2008-07-22 Thread youtoo
On 22 jul, 01:39, David Wahler [EMAIL PROTECTED] wrote: On Mon, Jul 21, 2008 at 10:31 PM, youtoo [EMAIL PROTECTED] wrote: It has been extensively discussed the time complexity (quadratic) of string concatenation (due to string's immutability). Actually, it is roughly linear, at least for

is it possible to add a property to an instance?

2008-07-22 Thread Darren Dale
Does anyone know if it is possible to add a property to an instance at runtime? I didn't see anything about it in the standard library's new module, google hasn't turned up much either. Thanks, Darren -- http://mail.python.org/mailman/listinfo/python-list

Re: The Importance of Terminology's Quality

2008-07-22 Thread Rob Warnock
Martin Gregorie [EMAIL PROTECTED] wrote: +--- | John W Kennedy wrote: | No, the thunks were necessary at the machine-language level to | /implement/ ALGOL 60, but they could not be expressed /in/ ALGOL. | | Are you sure about that? +--- I don't know if John is, but

Re: Problem with Python Server Pages (PSP)

2008-07-22 Thread Sebastian lunar Wiesner
[EMAIL PROTECTED] [EMAIL PROTECTED]: Hi, I am facing a very basic problem with PSP. I have installed mod_python (in fedora Core 1), added the lines required for loading Python modules and handling PSP pages. I have created a hello.psp page. But when I try to view this hello.psp page, all

Re: simple question about dictionaries

2008-07-22 Thread Jeff
On Jul 21, 8:14 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Jeff wrote:   throw KeyError('%s not found' % str(val)) throw?  and shouldn't that be a ValueError? ;-) /F Whoops. Been working in too many different languages at the same time :). --

Re: Python embedding question (2).

2008-07-22 Thread Uwe Schmitt
On 22 Jul., 14:07, Thomas Troeger [EMAIL PROTECTED] wrote: Carl Banks wrote: On Jul 17, 9:57 am, Thomas Troeger [EMAIL PROTECTED] wrote: I'd say that PyGame could be a solution. Or otherwise you could do your own audio/graphics programming (you don't tell us which OS you use, but there

Re: Python Written in C?

2008-07-22 Thread Grant Edwards
On 2008-07-22, Larry Bates [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-07-22, Larry Bates [EMAIL PROTECTED] wrote: You talk about writing it in assembly language for each MPU chip. Actually it is even better than that. We now have these modern inventions, called compilers that

Re: is it possible to add a property to an instance?

2008-07-22 Thread GHUM
Does anyone know if it is possible to add a property to an instance at runtime? I didn't see anything about it in the standard library's new module, google hasn't turned up much either. yes. You need nothing special, just add it: class fish(object): pass a=fish() a.legs=4 print a.legs

Re: Python embedding question (2).

2008-07-22 Thread alex23
On Jul 22, 10:07 pm, Thomas Troeger [EMAIL PROTECTED] wrote: Maybe this is the wrong list to ask, so please forgive the question but direct me to somewhere better. http://groups.google.com/group/pygame-mirror-on-google-groups There are instructions on that page for joining the mailing list if

Re: is it possible to add a property to an instance?

2008-07-22 Thread Darren Dale
GHUM wrote: Does anyone know if it is possible to add a property to an instance at runtime? I didn't see anything about it in the standard library's new module, google hasn't turned up much either. yes. You need nothing special, just add it: class fish(object): pass a=fish()

Re: Change PC to Win or Windows

2008-07-22 Thread Lie Ryan
On Mon, 2008-07-21 at 18:50 -0400, Derek Martin wrote: On Mon, Jul 21, 2008 at 02:47:31PM -0700, Lie wrote: Common usage isn't always correct. Actually it is, inherently... When usage becomes common, the language becomes redefined, and its correctness is therefore true by identity (to

Re: Converting List of String to Integer

2008-07-22 Thread ptn
n = [] for k in a:     n.append([int(v) for v in k]) print n Does anyone know what I am doing wrong? Thanks in advance. Samir Use extend instead of append: * Append - add the one item to the end of the list * Extend - add the list of items to the end of the list --

tkinter for my python program !!

2008-07-22 Thread karthikbalaguru
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to my pc. But, it is not getting installed and is failing by throwing the below errors. Should i need to

Re: DB Pool

2008-07-22 Thread Diez B. Roggisch
bcurtu wrote: Hi, I use MySQLdb lib to access my DB, because I want to opttimize my sql queries. The application I'm working on has quite a few traffic load, so I want to minimize the time of creating/destroying cursors: My typical code is sth like: cursor=con.cursor()

Re: regarding SWIG

2008-07-22 Thread Diez B. Roggisch
Anish Chapagain wrote: Hi.. I'm new to SWIG and need to create Wrapper for C code, so, I have installed the SWIG already but doesnot know how to run it for generating Interface file... My C code is in message.c so what do i need to do the first step..uisng SWIG..i read the documentation but

Re: tkinter for my python program !!

2008-07-22 Thread Diez B. Roggisch
karthikbalaguru wrote: Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to my pc. But, it is not getting installed and is failing by throwing the

Re: fromfile error on windows, not mac

2008-07-22 Thread jadamwil
On Jul 22, 2:05 am, Uwe Schmitt [EMAIL PROTECTED] wrote: jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read the data. I

Re: The Importance of Terminology's Quality

2008-07-22 Thread Lew
Rob Warnock wrote: Martin Gregorie [EMAIL PROTECTED] wrote: +--- | John W Kennedy wrote: | No, the thunks were necessary at the machine-language level to | /implement/ ALGOL 60, but they could not be expressed /in/ ALGOL. | | Are you sure about that? +--- I don't

need thumbnail from video

2008-07-22 Thread John Fabiani
Hi, I need a py tool that will provide a thumbnail (bmp?) from a video (avi, wmv) that will be cross platform (linux, windows). Research has provided pymedia for Linux but I haven't found anything for windows. Hopefully, someone has had to do this in the past and knows what has to be done.

Re: Python Written in C?

2008-07-22 Thread Ethan Furman
Iain King wrote: On Jul 21, 6:58 am, Krishnakant Mane [EMAIL PROTECTED] wrote: First off all c# is absolute rubbish waist of time. if I need to learn it then I better lern java or pythonfor that matter. and by the way what is a real programmer? The story of a Real Programmer:

Re: regarding SWIG

2008-07-22 Thread Hyuga
On Jul 22, 5:34 am, Anish Chapagain [EMAIL PROTECTED] wrote: Hi.. I'm new to SWIG and need to create Wrapper for C code, so, I have installed the SWIG already but doesnot know how to run it for generating Interface file... My C code is in message.c so what do i need to do the first

Re: tkinter for my python program !!

2008-07-22 Thread karthikbalaguru
On Jul 22, 6:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: karthikbalaguru wrote: Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to my pc.

Re: tkinter for my python program !!

2008-07-22 Thread Diez B. Roggisch
karthikbalaguru wrote: On Jul 22, 6:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: karthikbalaguru wrote: Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm

Re: Converting List of String to Integer

2008-07-22 Thread Samir
Wow! Thanks for all of the great additional feedback and responses since I last checked in. The help this group provides is amazing. I'm glad I found it. @Andrew -- Thanks for the clarification on the nested for loop and how to intrepret it. Also, thanks for the information on generators. I

Re: Best Python packages?

2008-07-22 Thread Ben Sizer
On Jul 19, 5:59 pm, Kay Schluehr [EMAIL PROTECTED] wrote: In the original post you asked for hidden gems and now it seems you just want to know about Madonna or Justin Timberlake. Not really, and I don't see why you'd say that. Maybe a look on this collection helps

convert list of lists to list

2008-07-22 Thread antar2
Is there a way to convert list_of_listsA to list_of_listsB, where one list in listof lists A is one element of listB? list_of_listsA: [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] listB: ['klas* * *', 'mooi* * * *, 'koe',

Is this a valid use of 'import'?

2008-07-22 Thread Frank Millman
Hi all I am familiar enough with the normal use of 'import'. However, I have found a use for it which seems effective, but I have not seen it used like this before, so I am not sure if there are any downsides. I know that when a module is imported the first time, it is 'executed'. This normally

Re: Is this a valid use of 'import'?

2008-07-22 Thread Tim Golden
Frank Millman wrote: In this particular case, when it is executed, it does a whole lot more. It reads in some parameters, establishes a socket connection, starts a thread, and starts monitoring the socket using select.select. It also exposes some functions that disguise the complexity of reading

Re: convert list of lists to list

2008-07-22 Thread Fredrik Lundh
antar2 wrote: Is there a way to convert list_of_listsA to list_of_listsB, where one list in listof lists A is one element of listB? list_of_listsA: [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] listB: ['klas* * *', 'mooi*

Re: convert list of lists to list

2008-07-22 Thread Stephen Johnson
list_A = [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] list_B = [] for inner_list in list_A: #join elements of list into a string with separator ' ' list_B.append(' '.join(inner_list)) print list_B Output:

Question about admin rights and IDLE

2008-07-22 Thread Murphy . MarkS
Hi All, Apologies in advance for a potentially redundant posting -- I sent a similar question to the help box yesterday. I have a Geographic Info System (GIS) user that is having problems editing with Python IDLE on a WindowsXP machine unless she has admin rights. I had initially thought there

Re: Is this a valid use of 'import'?

2008-07-22 Thread Matimus
On Jul 22, 8:12 am, Frank Millman [EMAIL PROTECTED] wrote: Hi all I am familiar enough with the normal use of 'import'. However, I have found a use for it which seems effective, but I have not seen it used like this before, so I am not sure if there are any downsides. I know that when a

Re: Is this a valid use of 'import'?

2008-07-22 Thread Frank Millman
On Jul 22, 5:22 pm, Tim Golden [EMAIL PROTECTED] wrote: Frank Millman wrote: In this particular case, when it is executed, it does a whole lot more. It reads in some parameters, establishes a socket connection, starts a thread, and starts monitoring the socket using select.select. It also

Re: Is this a valid use of 'import'?

2008-07-22 Thread Fredrik Lundh
Frank Millman wrote: I know that when a module is imported the first time, it is 'executed'. This normally entails setting up constants, classes, functions, etc, that you want to make available to the importer. In this particular case, when it is executed, it does a whole lot more. It reads in

Re: convert list of lists to list

2008-07-22 Thread Peter Otten
antar2 wrote: Is there a way to convert list_of_listsA to list_of_listsB, where one list in listof lists A is one element of listB? list_of_listsA: [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] listB: ['klas* * *',

Re: simple question about dictionaries

2008-07-22 Thread Bruno Desthuilliers
skazhy a écrit : hi, i am new to python, so i've a really simple question about dictionaries. if i have a dictionary and I make have an input after it (to input numbers) can i get the key of value that was in input? What if many keys are associated with a same value, ie: d = {'a':100, 'b':200,

Re: convert list of lists to list

2008-07-22 Thread Fredrik Lundh
Fredrik Lundh wrote: ['klas* * *', 'mooi* * * *, 'koe', 'arm* * * (haar)', 'groei* * * * *'] if there's only one level of recursion, and the lists aren't too long, you can simply do: sum(list_of_lists, []) oops. that's what you get for taking the subject line too literally... --

Re: DB Pool

2008-07-22 Thread John Nagle
bcurtu wrote: Hi, I use MySQLdb lib to access my DB, because I want to optimize my SQL queries. The application I'm working on has quite a few traffic load, so I want to minimize the time of creating/destroying cursors: My typical code is sth like: cursor=con.cursor()

Re: convert list of lists to list

2008-07-22 Thread Bruno Desthuilliers
antar2 a écrit : Is there a way to convert list_of_listsA to list_of_listsB, where one list in listof lists A is one element of listB? list_of_listsA: [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] listB: ['klas* * *', 'mooi*

Re: Automatically loading and initialising objects from a plugins directory

2008-07-22 Thread Dave Challis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Diez B. Roggisch wrote: Dave Challis wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to write some code which: 1. Finds all modules in a plugin directory 2. Imports those modules 3. Creates an instance of each object defined

Re: convert list of lists to list

2008-07-22 Thread Raymond Hettinger
On Jul 22, 8:25 am, Fredrik Lundh [EMAIL PROTECTED] wrote: if there's only one level of recursion, and the lists aren't too long, you can simply do:      sum(list_of_lists, []) (this has quadratic performance, so don't use it for large structures) For linear performance, you can use

Re: string[i:j:k]

2008-07-22 Thread Terry Reedy
konstantin wrote: Hello, I'm not a newbie in python, but recently faced a problem in simple expression: some_string[i:j:k] What does it mean? I believe this grammar (http://docs.python.org/ref/ slicings.html) describes the syntax. But I can't grasp it. When you post a link, please put it on

Re: Automatically loading and initialising objects from a plugins directory

2008-07-22 Thread Fredrik Lundh
Dave Challis wrote: Thanks for that, it helped as a starting point. I had some trouble with using issubclass though (issubclass(Plugin, Plugin) returns true), which was complicating things. I modified your code to the following instead (which may well have it's own pitfalls I'm not aware

Question about inheritence

2008-07-22 Thread Catherine Heathcote
If I create a new class inherited from another with a constructor, what happens with the new class's constructer? Thanks for your time. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Importance of Terminology's Quality

2008-07-22 Thread Steve Schafer
On Tue, 22 Jul 2008 10:21:50 +0100, Martin Gregorie [EMAIL PROTECTED] wrote: The first time I ran across the term thunking was when Windows 3 introduced the Win32S shim and hence the need to switch addressing between 16 bit and 32 bit modes across call interfaces. That was called thunking by

Re: Question about inheritence

2008-07-22 Thread Matimus
On Jul 22, 9:26 am, Catherine Heathcote [EMAIL PROTECTED] wrote: If I create a new class inherited from another with a constructor, what happens with the new class's constructer? Thanks for your time. Nothing, unless you call it in your constructor. class Base(object): def __init__(self):

Re: Question about inheritence

2008-07-22 Thread Catherine Heathcote
On Tue, 22 Jul 2008 09:35:58 -0700, Matimus wrote: On Jul 22, 9:26 am, Catherine Heathcote [EMAIL PROTECTED] wrote: If I create a new class inherited from another with a constructor, what happens with the new class's constructer? Thanks for your time. Nothing, unless you call it in your

Re: Question about inheritence

2008-07-22 Thread Jordan
On Jul 22, 12:26 pm, Catherine Heathcote [EMAIL PROTECTED] wrote: If I create a new class inherited from another with a constructor, what happens with the new class's constructer? Thanks for your time. Well, the __init__ method of the subclass is called, and from within it you can call the

Re: Question about inheritence

2008-07-22 Thread Fredrik Lundh
Catherine Heathcote wrote: If I create a new class inherited from another with a constructor, what happens with the new class's constructer? assuming that you mean is it called or not?: Python doesn't really have constructors; when you create an object, Python first creates the object and

Re: Not entirely serious: recursive lambda?

2008-07-22 Thread Michael Tobis
Thanks all! What a remarkable set of answers, intelligent, thought provoking and informative without exception. Of course, now I can't use Paul's version; it hardly counts as a japh if someone else wrote it! It is probably the closest to my original vision, alas. Miles' second suggestion was the

Re: Importing different versions of a module

2008-07-22 Thread mercado mercado
It seems that you can specify the name of the module to be imported at runtime using the following syntax: X = __import__('X') (from http://effbot.org/zone/import-confusion.htm) Of course, I would rather specify the path to the module at runtime, not the module name itself, but at least this is

Re: Importing different versions of a module

2008-07-22 Thread Fredrik Lundh
mercado mercado wrote: It seems that you can specify the name of the module to be imported at runtime using the following syntax: X = __import__('X') (from http://effbot.org/zone/import-confusion.htm) Of course, I would rather specify the path to the module at runtime, not the module name

Re: Is this a valid use of 'import'?

2008-07-22 Thread Terry Reedy
Frank Millman wrote: I know that when a module is imported the first time, it is 'executed'. This normally entails setting up constants, classes, functions, etc, that you want to make available to the importer. And every time thereafter, the module code is not executed*. So module code

Authentication for XML-RPC Calls

2008-07-22 Thread whitemice
The only documentation regarding doing authentication for XML-RPC I can find is - Both the HTTP and HTTPS transports support the URL syntax extension for HTTP Basic Authentication: http://user:[EMAIL PROTECTED]:port/path. The user:pass portion will be base64-encoded as an HTTP `Authorization'

Re: Not entirely serious: recursive lambda?

2008-07-22 Thread Paul McGuire
On Jul 22, 11:52 am, Michael Tobis [EMAIL PROTECTED] wrote: Thanks all! What a remarkable set of answers, intelligent, thought provoking and informative without exception. Of course, now I can't use Paul's version; it hardly counts as a japh if someone else wrote it! It is probably the

Re: Hello,who can help me!

2008-07-22 Thread James Matthews
I would recommended on asking on the pywin32 mailing list. On Tue, Jul 22, 2008 at 2:26 AM, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I have implemented a C++ COM,which contains two interface in one coclass. when i use this COM in python:

Re: Question about admin rights and IDLE

2008-07-22 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hi All, Apologies in advance for a potentially redundant posting -- I sent a similar question to the help box yesterday. I have a Geographic Info System (GIS) user that is having problems editing with Python IDLE on a WindowsXP machine unless she has admin rights. I

Re: Authentication for XML-RPC Calls

2008-07-22 Thread Larry Bates
whitemice wrote: The only documentation regarding doing authentication for XML-RPC I can find is - Both the HTTP and HTTPS transports support the URL syntax extension for HTTP Basic Authentication: http://user:[EMAIL PROTECTED]:port/path. The user:pass portion will be base64-encoded as an HTTP

Re: The Importance of Terminology's Quality

2008-07-22 Thread Grant Edwards
On 2008-07-22, Steve Schafer [EMAIL PROTECTED] wrote: On Tue, 22 Jul 2008 10:21:50 +0100, Martin Gregorie [EMAIL PROTECTED] wrote: The first time I ran across the term thunking was when Windows 3 introduced the Win32S shim and hence the need to switch addressing between 16 bit and 32 bit modes

sys.stderr.write returns string length in Python 3

2008-07-22 Thread Alan G Isaac
Is this new behavior intentional? :: sys.stderr.write(thisisatest\n) thisisatest 12 Here is the reason for it: help(sys.stderr.write) Help on method write in module io: write(self, s: str) method of io.TextIOWrapper instance Thank you, Alan

CPython VM internals - Wiki page

2008-07-22 Thread Terry Reedy
Various people have asked on c.l.p about documentation of CPython's virtual machine internals. The usual answers have been to see the dis module doc for bytecodes and 'read the code' for more. Jakob Sievers did so and posted his notes, with additions from Martin v. Löwis, as

Re: CPython VM internals - Wiki page

2008-07-22 Thread John Nagle
Terry Reedy wrote: Various people have asked on c.l.p about documentation of CPython's virtual machine internals. The usual answers have been to see the dis module doc for bytecodes and 'read the code' for more. Jakob Sievers did so and posted his notes, with additions from Martin v. Löwis,

software engineering foundations?

2008-07-22 Thread skip
Sorry for the off-topic-ish post. My son (a fairly junior sysadmin type) mentioned to me today that he was looking for online courses for Perl. (I don't hold that against him. Perl is still a lingua franca in the sysadmin realm.) In my work I have from time-to-time had to pick up and maintain

Re: proliferation of computer languages

2008-07-22 Thread szr
Jürgen Exner wrote: Chris Rathman [EMAIL PROTECTED] wrote: I can't say that I see any particular point to the essay. You must be new here. There never is any particular point to Xah Lee's rantings except to cross-post borderline topics to borderline relevant NGs and then lay back and enjoy

Re: CPython VM internals - Wiki page

2008-07-22 Thread Martin v. Löwis
That's interesting. It's dumber than I thought. All temporaries on the stack are boxed as PyObjects. That's simple and portable, but slow. Not only that - Python does not ever have the concept of unboxed values, except for local variables in the C implementations of arithmetic operations

  1   2   >