Re: converting JSON to string

2008-01-11 Thread Gowri
On Jan 11, 7:21 pm, Adonis Vargas <[EMAIL PROTECTED]> wrote: > Gowri wrote: > > Hello, > > > I actually have two questions: > > 1. Are there any libraries which convert XML to JSON? > > 2. I am currently doing the above using the DOM parser and creating a > > JSON array > > > > > for node in doc.g

Successfully created installer for python2.5 compiled code under .net2005

2008-01-11 Thread abhishek
Hi group i have created an installer for python 2.5 compiled under .NET 2005. Any one looking for help on doing this feel free to contact me at [EMAIL PROTECTED] or [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: opensg or openscenegraph

2008-01-11 Thread Roman Yakovenko
On Jan 11, 2008 10:01 PM, <[EMAIL PROTECTED]> wrote: > On Jan 4, 3:08pm, yomgui <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I need to use a scengraph for my python/opengl application > > but I have trouble finding out which one I should use. > > > > opensg or openscenegraph (OSG) ? > > > > I suppos

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-11 Thread radiosrfun
"ChairmanOfTheBored" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 11 Jan 2008 18:25:53 -0800 (PST), [EMAIL PROTECTED] wrote: > >>The yank... > > > You're a goddamned retard. Go back to yanking your pathetic excuse for > a dick. American Bastards deserve to be raped? WTF?

Re: Magic function

2008-01-11 Thread Carl Banks
On Fri, 11 Jan 2008 08:29:18 -0800, dg.google.groups wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > calling 'm

Great Python books for the beginner

2008-01-11 Thread Landon
Hi, I'm a freshman in college and I'm going to be taking an intro to programming course next semester which mainly uses Python, so I thought it might be a good time to pick up Python beyond the scope of the class as well. The text book for this class is Python for the Absolute Beginner or something

Re: Using a proxy with urllib2

2008-01-11 Thread Jack
>> I'm trying to use a proxy server with urllib2. >> So I have managed to get it to work by setting the environment >> variable: >> export HTTP_PROXY=127.0.0.1:8081 >> >> But I wanted to set it from the code. However, this does not set the >> proxy: >> httpproxy = '127.0.0.1:3129' >> prox

Re: ISO Python example projects (like in Perl Cookbook)

2008-01-11 Thread Tim Roberts
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > >You know you've been working at a large company for too long when you >see that subject and think "ISO-certified Python?" That's exactly what I thought, too. After reading the post I assume he actually meant "In Search Of"? -- Tim Roberts, [

Re: Image/Video Processing in Python

2008-01-11 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >Hello, I'm trying to work on a project in Python that involves the use >of a webcam to track a laser pointer. I found some example code here >http://janto.blogspot.com/2006/01/motion-capture-in-python.html, but >the problem is that it's quite slow

Re: FindWindowById returns None..... ?

2008-01-11 Thread Tim Roberts
Soren <[EMAIL PROTECTED]> wrote: > >I'm trying to split my GUI into several files since its beginning to >become a bit large.. I've placed a panel class inside gui2.py, but it >needs some information from a panel in gui1.py... if I import gui1 in >gui2 and try to find the panel by its ID, (using t

Re: ctypes, GetWindowLongPtr

2008-01-11 Thread David Wahler
On Jan 11, 2008 9:14 PM, Henry Baxter <[EMAIL PROTECTED]> wrote: > Hello, > > I have been happily using ctypes for a while to do win32 programming. I use > the Microsoft documentation to understand the function, then call it with the > help of ctypes. > > The problem is that the docs says user32.

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 19:36:24 -0800, Michael Tobis wrote: > On Jan 11, 8:40 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > >> Read the OP's post again. His (her?) users aren't expected to create >> the toolkit, merely to use it. To create good toolkits you need both a >> mas

Re: Import and execfile()

2008-01-11 Thread George Sakkis
On Jan 11, 6:54 pm, Mitko Haralanov <[EMAIL PROTECTED]> wrote: > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) > > George Sakkis <[EMAIL PROTECTED]> wrote: > > # trying to set the configuration: > > CFG = {} > > execfile('path/to/some_config.py', CFG) > > > Traceback (most recent call last): > > ... >

Re: Import and execfile()

2008-01-11 Thread George Sakkis
On Jan 11, 5:24 pm, Mike Meyer <[EMAIL PROTECTED]> wrote: > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> > wrote: > > > I maintain a few configuration files in Python syntax (mainly nested > > dicts of ints and strings) and use execfile() to read them back to > > Pyt

Re: Persistent HTTP Connections with Python?

2008-01-11 Thread Rob Kapteyn
On Jan 10, 12:46 pm, Scott Sharkey <[EMAIL PROTECTED]> wrote: > Hello All, > > I am trying to write a python script to talk to an xml-based stock feed > service.  They are telling me that I must connect and login, and then > "issue refresh requests" to fetch the data.  This sounds a lot (to me) > l

Re: IDLE won't start in Python 2.5 for Windows

2008-01-11 Thread mikez302
How would I go about cleaning the registry? What specifically should I look for? Should I use any registry cleaner programs? Where are the IDLE preference files stored? When I uninstalled Python, it seems like everything was gone except for a few personal .py and .pyc files. Elias -- http://m

Re: Boa constructor

2008-01-11 Thread Joel
On Jan 12, 9:37 am, Joel <[EMAIL PROTECTED]> wrote: > Hi, > In BOA constructor, is there any way to do the following: > Once a breakpoint has reached, I want to enter some code > and execute it. > Can anyone tell me of a technique? > > Also input stream doesn't seem to work, I do a standard input r

Boa constructor

2008-01-11 Thread Joel
Hi, In BOA constructor, is there any way to do the following: Once a breakpoint has reached, I want to enter some code and execute it. Can anyone tell me of a technique? Also input stream doesn't seem to work, I do a standard input read and then i enter something in the input window, but it isn't

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 8:40 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Read the OP's post again. His (her?) users aren't expected to create the > toolkit, merely to use it. To create good toolkits you need both a master > programmer and an expert in the field. It is an advantage if th

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 12/01/08 00:23 +0100, Hrvoje Niksic wrote: > "Faber J. Fedor" <[EMAIL PROTECTED]> writes: > > Does this '("" if not where...' syntax actually work? > > http://docs.python.org/whatsnew/pep-308.html C'mon! I'm in Day Two of learning Python. You can't expect me to be reading "What's New" docs a

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 11/01/08 18:29 -0500, Mike Meyer wrote: > It is a 2.5 feature, though. I was beginning to wonder of that was the case. > I converted all my clients to 2.5.1, > shortly after it was available, and haven't used anything older > since. Sorry 'bout that. No prob. -- Regards, Faber Fedor

Re: alternating string replace

2008-01-11 Thread Paddy
On Jan 11, 8:55 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of cesco > > Sent: Wednesday, January 09, 2008 5:34 AM > > To: [EMAIL PROTECTED] > > Subject: alternating string replace > > >

easy_install on Mac

2008-01-11 Thread sween119
Hi all, I got easy_install to work a few times on my Mac, but now I want to put PyOpenGL in my ~/site-packages folder and now I am having a heckuva time getting anything to work. I've tried changing directories to where the PyOpenGL egg is and all sorts of other folders. I usually get a message st

Re: alternating string replace

2008-01-11 Thread Paddy
On Jan 12, 2:55 am, Pablo Ziliani <[EMAIL PROTECTED]> wrote: > * die, thread! :-) def altrep7(s): from itertools import cycle import re a = cycle(':,') return re.sub('_', lambda x: a.next(), s) altrep7.author="George Sakkis(&Paul Rubin)" Gives: ## Program by: George Sakkis(&Paul Rubi

Re: Python too slow?

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 09:52:17 -0800, Paul Boddie wrote: > These days, I seriously doubt that anyone uses the term "interpreted" to > mean "parses the source text and works out what to do, over and over > again as the program runs". Given the way that people seem to use "interpreted" as a pejorativ

Re: alternating string replace

2008-01-11 Thread Pablo Ziliani
Paul Rubin wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > >> from itertools import chain, izip, cycle >> print ''.join(chain(*izip(s1.split('_'),cycle(':,'[:-1] >> > > from itertools import cycle > a = cycle(':,') > print re.sub('_', lambda x: a.next(), s1) > Lovely. If there

Re: Python too slow?

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 09:55:08 -0800, sturlamolden wrote: > It seems the code he is referring to is doing k-means clustering on each > frame. The clustering is done by from SciPy's cluster module, which is > doing 'vector quantitization'. The algorithm is written in plain C. It > is not Python that

Re: os.rename() problems on OS X

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 12:29:24 -0800, lukas wrote: > hello, > > i recently had the job of having to rename about 200 files. The source > for the renaming was a bunch of names in a file. I know next to nothing > when it comes to bash scripting (which would have seemed the obvious > choice) so i used

Re: alternating string replace

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 14:55:18 -0600, Reedick, Andrew wrote: > For those of us who still think in Perl, here's an easy to read ... > s = re.sub(r'_(.*?(_|$))', r':\1', s) "Easy to read"? Oh that's priceless. Andrew, you should consider writing comedy professionally! -- Steven -- http://mail.

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 17:36:10 -0800, Michael Tobis wrote: > On Jan 11, 6:15 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> Your users are *scientists*, and you don't trust their intellectual >> ability to learn a programming language as simple as Python? >> >> Instead of spe

Re: alternating string replace

2008-01-11 Thread Paul Rubin
George Sakkis <[EMAIL PROTECTED]> writes: > from itertools import chain, izip, cycle > print ''.join(chain(*izip(s1.split('_'),cycle(':,'[:-1] from itertools import cycle a = cycle(':,') print re.sub('_', lambda x: a.next(), s1) -- http://mail.python.org/mailman/listinfo/python-list

ctypes, GetWindowLongPtr

2008-01-11 Thread Henry Baxter
Hello, I have been happily using ctypes for a while to do win32 programming. I use the Microsoft documentation to understand the function, then call it with the help of ctypes. The problem is that the docs says user32.dll has GetWindowLongPtr, but ctypes can't find it using windll.user32.GetWindo

Re: alternating string replace

2008-01-11 Thread George Sakkis
On Jan 9, 6:34 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > cesco <[EMAIL PROTECTED]> wrote: > > Hi, > > > say I have a string like the following: > > s1 = 'hi_cat_bye_dog' > > and I want to replace the even '_' with ':' and the odd '_' with ',' > > so that I get a new string like the following: >

Re: removeall() in list

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Could you: > > lockerA= Locker( listA, listB ) > lockerA.op( listB.reverse ) > lockerA.op( listA.pop ) > > Where lockerA ops acquire the locks on all its threads? I don't understand that question. The main thing to understand is that multi-threaded programming is com

Re: converting JSON to string

2008-01-11 Thread Gowri
Hi Adonis, Thanks so much. Appreciate it :) -- http://mail.python.org/mailman/listinfo/python-list

Re: encrypting python modules

2008-01-11 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Sat, 12 Jan 2008 09:47:26 +1100, Ben Finney wrote: > > > Trying to make bits uncopyable and unmodifiable is like trying to > > make water not wet. > > Certainly not. I can put water into the freezer Turning it into ice, and making it no

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 6:15 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Your users are *scientists*, and you don't trust their intellectual > ability to learn a programming language as simple as Python? > > Instead of spending time and effort writing, debugging and maintaining > such a

Re: converting JSON to string

2008-01-11 Thread Adonis Vargas
Gowri wrote: > Hello, > > I actually have two questions: > 1. Are there any libraries which convert XML to JSON? > 2. I am currently doing the above using the DOM parser and creating a > JSON array > > > for node in doc.getElementsByTagName("book"): > isbn = node.getAttribute("is

Re: encrypting python modules

2008-01-11 Thread Marc 'BlackJack' Rintsch
On Sat, 12 Jan 2008 09:47:26 +1100, Ben Finney wrote: > Trying to make bits uncopyable and unmodifiable is like trying to make > water not wet. Certainly not. I can put water into the freezer, but I have no idea how to make bits uncopyable and unmodifiable while still delivering them to the clie

Re: Python in IIS + WSGI

2008-01-11 Thread mr . zeitgeist
On Jan 12, 1:42 am, Phillip Sitbon <[EMAIL PROTECTED]> wrote: > Pardon my typo! > > http://pyisapie.sourceforge.net > > On Jan 11, 4:37 pm, Phillip Sitbon <[EMAIL PROTECTED]> wrote: > > > Recently (finally) updated the PyISAPIe project. Version 1.0.4 > > includes WSGI support (tested with current D

Re: IDLE won't start in Python 2.5 for Windows

2008-01-11 Thread Tommy Nordgren
On 12 jan 2008, at 01.18, mikez302 wrote: > I have Python 2.5 and Windows XP SP2. For a while, IDLE worked, but > now it doesn't. The last time I was using it, I was changing some > keyboard shortcuts, then the window suddenly disappeared. Since then, > I haven't been able to start it. > > Whe

Re: Python in IIS + WSGI

2008-01-11 Thread Phillip Sitbon
Pardon my typo! http://pyisapie.sourceforge.net On Jan 11, 4:37 pm, Phillip Sitbon <[EMAIL PROTECTED]> wrote: > Recently (finally) updated the PyISAPIe project. Version 1.0.4 > includes WSGI support (tested with current Django SVN and Trac 0.10) > and a Django-native handler, as well as other exa

Re: removeall() in list

2008-01-11 Thread castironpi
On Jan 11, 6:17 pm, [EMAIL PROTECTED] wrote: > On Jan 11, 5:51 pm, Paul Rubin wrote: > > > > > [EMAIL PROTECTED] writes: > > > listA.op( insert, x ) > > > listA.op( remove, x ) > > > Sure, there are various ways you can make the code look uniform. What > > gets messy is

Python in IIS + WSGI

2008-01-11 Thread Phillip Sitbon
Recently (finally) updated the PyISAPIe project. Version 1.0.4 includes WSGI support (tested with current Django SVN and Trac 0.10) and a Django-native handler, as well as other examples of using it as a standalone web app. Also added some installation/usage docs on the project page. Comments/fee

IDLE won't start in Python 2.5 for Windows

2008-01-11 Thread mikez302
I have Python 2.5 and Windows XP SP2. For a while, IDLE worked, but now it doesn't. The last time I was using it, I was changing some keyboard shortcuts, then the window suddenly disappeared. Since then, I haven't been able to start it. When I try to start it, I see pythonw.exe come up on my Ta

Re: removeall() in list

2008-01-11 Thread castironpi
On Jan 11, 5:51 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > listA.op( insert, x ) > > listA.op( remove, x ) > > Sure, there are various ways you can make the code look uniform. What > gets messy is if you want to (say) operate on several lists at the > same tim

Re: Magic function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 08:29:18 -0800, dg.google.groups wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. ... > This is fine, but we decided that for clarity o

converting JSON to string

2008-01-11 Thread Gowri
Hello, I actually have two questions: 1. Are there any libraries which convert XML to JSON? 2. I am currently doing the above using the DOM parser and creating a JSON array for node in doc.getElementsByTagName("book"): isbn = node.getAttribute("isbn") titleNode =

Re: encrypting python modules

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 10:44:36 +0100, Paul Sijben wrote: > Hello, > > this question has come by repeatedly in several guises over the past > years but has never been solved in this forum as far as I have been able > to Google. > > However since so many people are asking the question, I hope someon

Re: Import and execfile()

2008-01-11 Thread Mitko Haralanov
On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > # trying to set the configuration: > CFG = {} > execfile('path/to/some_config.py', CFG) > > Traceback (most recent call last): > ... > ImportError: No module named master_config > > > I understand why this fails

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Paul Boddie
On 11 Jan, 21:44, Goldfish <[EMAIL PROTECTED]> wrote: > > What about security holes, like a malicious version of socket getting > downloaded into a user's directory, and overriding the default, safe > version? Don't forget that in your PEP. As Christian points out, there are various exploitable we

Re: removeall() in list

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > 2. Associate a lock with the list. Anything wanting to access the > > list should acquire the lock, do its stuff, then release the lock. > > This gets confusing after a while. > > To keep it generic, how about: > > listA.op( insert, x ) > listA.op( remove, x ) Sure

Re: removeall() in list

2008-01-11 Thread castironpi
On Jan 11, 5:43 pm, [EMAIL PROTECTED] wrote: > On Jan 11, 5:26 pm, Paul Rubin wrote: > > > [EMAIL PROTECTED] writes: > > > This function just wants X out of the list. It doesn't matter if this > > > happens before, during, or after something else; so long as it happens.

Re: removeall() in list

2008-01-11 Thread castironpi
On Jan 11, 5:26 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > This function just wants X out of the list. It doesn't matter if this > > happens before, during, or after something else; so long as it happens. > > 2. Associate a lock with the list. Anything wantin

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Hrvoje Niksic
"Faber J. Fedor" <[EMAIL PROTECTED]> writes: > On 10/01/08 22:53 -0500, Mike Meyer wrote: >> Personally, I think it would be more pythonic to not try and use two >> different APIs to walk the list of jobs (... One Way To Do it): >> >> def __call__(self, where=None): >> q = "select * from %s"

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 18:11:41 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > On 10/01/08 22:53 -0500, Mike Meyer wrote: > > Personally, I think it would be more pythonic to not try and use two > > different APIs to walk the list of jobs (... One Way To Do it): > > > > def __call__(self, where

Re: removeall() in list

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > This function just wants X out of the list. It doesn't matter if this > happens before, during, or after something else; so long as it happens. If you're asking in a general way how to do something like that, there are several basic methods: 1. Put a single thread in

Re: python recursive function

2008-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2008 06:30:04 -0600, Nick Craig-Wood wrote: > HYRY <[EMAIL PROTECTED]> wrote: >> def bears (n): >> if n==42: >> return True ... >> return False > > Almost but you missed a case... Why are you people doing the OP's homework for him? And then DEBUGGING it as wel

Re: encrypting python modules

2008-01-11 Thread Mike Meyer
On Sat, 12 Jan 2008 09:47:26 +1100 Ben Finney <[EMAIL PROTECTED]> wrote: > Paul Sijben <[EMAIL PROTECTED]> writes: > > I know that I can not stop a dedicated hacker deconstructing my code. > A direct consequence of this is that you can not stop *anyone* from > deconstructing your code if it's in t

installing mod_python

2008-01-11 Thread Milad
I downloaded mod_python and Enter: sh install-sh but the installer said that you would install DSO http://httpd.apache.org/docs/2.0/dso.html http://httpd.apache.org/docs/2.0/programs/apxs.html but how cat in install DSO and apxs? I'm using ubuntu gnu/linux -- http://mail.python.org/mailman/listin

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 10/01/08 22:53 -0500, Mike Meyer wrote: > Personally, I think it would be more pythonic to not try and use two > different APIs to walk the list of jobs (... One Way To Do it): > > def __call__(self, where=None): > q = "select * from %s" % (self.name,) + ("" if not where else (" where > %s

Re: encrypting python modules

2008-01-11 Thread Ben Finney
Paul Sijben <[EMAIL PROTECTED]> writes: > I know that I can not stop a dedicated hacker deconstructing my code. A direct consequence of this is that you can not stop *anyone* from deconstructing your code if it's in their possession. It takes only one dedicated, skilled person to crack your obfus

Re: for loop without variable

2008-01-11 Thread Tim Chase
>> I recently faced a similar issue doing something like this: >> >> data_out = [] >> for i in range(len(data_in)): >> data_out.append([]) > > Another way to write this is > data_out = [[]] * len(data_in) ...if you're willing to put up with this side-effect: >>> data_in = ran

Re: split parameter line with quotes

2008-01-11 Thread teddyber
here's the solution i have for the moment : t = shlex.shlex(data) t.wordchars = t.wordchars + "/+.-" r='' while 1: token = t.get_token() if not token: break if not token==',': r = r+token else: r = r +

Re: for loop without variable

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 22:18:22 GMT Neil Hodgson <[EMAIL PROTECTED]> wrote: > Marty: > > I recently faced a similar issue doing something like this: > > data_out = [] > > for i in range(len(data_in)): > > data_out.append([]) > > Another way to write this is > data_out = [[]] * le

Re: split parameter line with quotes

2008-01-11 Thread teddyber
i know this is some kind of bad design but the problem is that i receive this string from a jabber server and i cannot do anything to change this. i should try to verify if that's correct implementation of jabber protocol still... On 11 jan, 22:02, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jan 11,

Re: split parameter line with quotes

2008-01-11 Thread teddyber
wow! that's perfect this shlex module! thanks for pointing this! On 11 jan, 20:36, Joshua Kugler <[EMAIL PROTECTED]> wrote: > teddyber wrote: > > first i'm a newbie to python (but i searched the Internet i swear). > > i'm looking for some way to split up a string into a list of pairs > > 'key=valu

Re: removeall() in list

2008-01-11 Thread castironpi
On Jan 11, 2:57 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Any ideas for a thread-safe list.removeall( X ): removing all > > occurrences of X within list L, when L might be modified concurrently? > > That way lies madness. Do something sensible instead. Put a

Re: for loop without variable

2008-01-11 Thread Neil Hodgson
Marty: > I recently faced a similar issue doing something like this: > > data_out = [] > for i in range(len(data_in)): > data_out.append([]) Another way to write this is data_out = [[]] * len(data_in) Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Import and execfile()

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > I maintain a few configuration files in Python syntax (mainly nested > dicts of ints and strings) and use execfile() to read them back to > Python. This has been working great; it combines the convenience of > pic

extracting Javadocs using Python

2008-01-11 Thread Rajarshi
Hi, I work on a Java project and I was thinking out creating a hook in the subversion repo for the project that would check whether a class and it's associated methods were documented with Javadocs. Since I have written Subversion hooks for other purposes in Python, I'd like to try and do this tas

Import and execfile()

2008-01-11 Thread George Sakkis
I maintain a few configuration files in Python syntax (mainly nested dicts of ints and strings) and use execfile() to read them back to Python. This has been working great; it combines the convenience of pickle with the readability of Python. So far each configuration is contained in a single stand

Re: Newbie wants to get visual

2008-01-11 Thread Mike
On Jan 11, 1:50 pm, [EMAIL PROTECTED] wrote: > I'm ready to start coding the parser for my Decaf (beginners) > language. I think that a "visual" parser (one that shows what it's > doing as it does it) would be nice. (And I think that it would help > the parser author by saving the requirement for a

Re: Graphics Module

2008-01-11 Thread Mike
On Jan 11, 3:31 pm, "Gabriel" <[EMAIL PROTECTED]> wrote: > Hi all ! > > I'm developing a math program that shows graphics of functions. > I would hear suggestions about the way of drawing 2D . > > Thanks a lot for your answers. > > - Gabriel - That's not a very descriptive question, however most p

number of element in array/matrix

2008-01-11 Thread Tommy Grav
On Jan 11, 2008, at 11:09 AM, [EMAIL PROTECTED] wrote: > > Hi, > I have what I suspect to be a fairly simple problem while using > python Numeric. > I am attempting to count the number of times that an element 'b' > occurs in > numeric array 'a'. I tried unsuccessfully to find a more efficien

Graphics Module

2008-01-11 Thread Gabriel
Hi all ! I'm developing a math program that shows graphics of functions. I would hear suggestions about the way of drawing 2D . Thanks a lot for your answers. - Gabriel - -- http://mail.python.org/mailman/listinfo/python-list

RE: Newbie question on Classes

2008-01-11 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of John Machin > Sent: Friday, January 11, 2008 4:08 PM > To: python-list@python.org > Subject: Re: Newbie question on Classes > > On Jan 11, 9:27 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: >

RE: split parameter line with quotes

2008-01-11 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of teddyber > Sent: Friday, January 11, 2008 1:51 PM > To: python-list@python.org > Subject: split parameter line with quotes > > Hello, > > first i'm a newbie to python (but i searched the Inte

[Kamaelia] TCPClient: How to sense connection failure?

2008-01-11 Thread Bjoern Schliessmann
Hello, I'm currently trying to implement a simulation program with Kamaelia and need a reliable TCP connection to a data server. >From Twisted, I know that a method is called if the connection fails by whatever reason. I tried to get the same results with Kamaelia's TCPClient component. If I star

Re: Newbie question on Classes

2008-01-11 Thread John Machin
On Jan 11, 9:27 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of Adrian Wood > > Sent: Thursday, January 10, 2008 4:47 PM > > To: [EMAIL PROTECTED] > > Subject: Newbie question on Classes >

Re: split parameter line with quotes

2008-01-11 Thread Russ P.
On Jan 11, 12:53 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jan 11, 10:50 am, teddyber <[EMAIL PROTECTED]> wrote: > > > Hello, > > > first i'm a newbie to python (but i searched the Internet i swear). > > i'm looking for some way to split up a string into a list of pairs > > 'key=value'. This co

Re: removeall() in list

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Any ideas for a thread-safe list.removeall( X ): removing all > occurrences of X within list L, when L might be modified concurrently? That way lies madness. Do something sensible instead. Put a lock around the list, or put all mutators for the list into a single thre

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Christian Heimes
Goldfish wrote: > What about security holes, like a malicious version of socket getting > downloaded into a user's directory, and overriding the default, safe > version? Don't forget that in your PEP. A malicious piece of software has already hundreds of way to overwrite modules. It could add a py

RE: alternating string replace

2008-01-11 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of cesco > Sent: Wednesday, January 09, 2008 5:34 AM > To: python-list@python.org > Subject: alternating string replace > > Hi, > > say I have a string like the following: > s1 = 'hi_cat_bye_dog'

Re: Magic function

2008-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > obj1 = Obj(params1) > obj2 = Obj(params2) > ... > run() > > The idea is that the run() function inspects the stack, and looks for > object which are instances of class Obj, creates a Bigobj with those > objects and calls its run() method. > > So, any comments on that

Re: split parameter line with quotes

2008-01-11 Thread Russ P.
On Jan 11, 10:50 am, teddyber <[EMAIL PROTECTED]> wrote: > Hello, > > first i'm a newbie to python (but i searched the Internet i swear). > i'm looking for some way to split up a string into a list of pairs > 'key=value'. This code should be able to handle this particular > example string : > > qop

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Goldfish
On Jan 11, 11:45 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Damjan wrote: > > My question is, shoudn't it be enough to set PYTHONPATH and everything > > automagically to work then? Is there some work done on this for python 3.0 > > or 2.6 perhaps? > > I'm working on a PEP for a per user site

os.rename() problems on OS X

2008-01-11 Thread lukas
hello, i recently had the job of having to rename about 200 files. The source for the renaming was a bunch of names in a file. I know next to nothing when it comes to bash scripting (which would have seemed the obvious choice) so i used python. The files i was renaming were canon raw files (.CR2).

Re: Help needed

2008-01-11 Thread Bjoern Schliessmann
Devraj wrote: > Sorry to diverge from the topic, but is there a reason you need to > develop something like again? It's obvious, isn't it? > On Jan 11, 1:15 pm, tijo <[EMAIL PROTECTED]> wrote: >> I dont know how to check the rest like how many bytes send or how >> much time taken since this is

removeall() in list

2008-01-11 Thread castironpi
Any ideas for a thread-safe list.removeall( X ): removing all occurrences of X within list L, when L might be modified concurrently? Sincerely, Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: Magic function

2008-01-11 Thread Ruediger
[EMAIL PROTECTED] wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > calling 'magic functions', and I'm a little b

Re: split parameter line with quotes

2008-01-11 Thread Paul McGuire
On Jan 11, 12:50 pm, teddyber <[EMAIL PROTECTED]> wrote: > Hello, > > first i'm a newbie to python (but i searched the Internet i swear). > i'm looking for some way to split up a string into a list of pairs > 'key=value'. This code should be able to handle this particular > example string : > > qop

Re: scope question in a switch mixin

2008-01-11 Thread John Machin
[EMAIL PROTECTED] wrote: > The code that follows is the result of noodling around with switches as a > learning tool. I've played with python for a few years, but I'm self-taught, > so . . . > > Class Switch builds a set of functions. Method switch executes one of them > given a value of the sw

Re: MFC app to Python IDLE communication

2008-01-11 Thread konstantin . smolin
>         IDLE is a Tkinter/TK IDE for Python... Why would you invoke a whole > IDE to manipulate application data? It was just an idea. I have never dealt with python before... I need some hints to understand where the answer to my problem is. > >          If you already have MFC in the mix, woul

Re: alternating string replace

2008-01-11 Thread Paddy
On Jan 11, 9:54 am, Chris <[EMAIL PROTECTED]> wrote: > On Jan 9, 12:34 pm, cesco <[EMAIL PROTECTED]> wrote: > > > Hi, > > > say I have a string like the following: > > s1 = 'hi_cat_bye_dog' > > and I want to replace the even '_' with ':' and the odd '_' with ',' > > so that I get a new string like

Re: opensg or openscenegraph

2008-01-11 Thread serilanimi
On Jan 4, 3:08 pm, yomgui <[EMAIL PROTECTED]> wrote: > Hi, > > I need to use a scengraph for my python/opengl application > but I have trouble finding out which one I should use. > > opensg or openscenegraph (OSG) ? > > I suppose the quality of the python bindings will make the decision. > > any ad

Newbie wants to get visual

2008-01-11 Thread MartinRinehart
I'm ready to start coding the parser for my Decaf (beginners) language. I think that a "visual" parser (one that shows what it's doing as it does it) would be nice. (And I think that it would help the parser author by saving the requirement for a bazillion print statements while debugging the tool.

Re: split parameter line with quotes

2008-01-11 Thread teddyber
On 11 jan, 20:28, Nanjundi <[EMAIL PROTECTED]> wrote: > On Jan 11, 1:50 pm, teddyber <[EMAIL PROTECTED]> wrote: > > > Hello, > > > first i'm a newbie to python (but i searched the Internet i swear). > > i'm looking for some way to split up a string into a list of pairs > > 'key=value'. This code sh

Re: Analyzing Python GC output - turns out to be MySQLdb problem

2008-01-11 Thread John Nagle
Francesco Guerrieri wrote: > On Jan 11, 2008 6:20 PM, John Nagle <[EMAIL PROTECTED]> wrote: >> Tried: >> print item.dir() >> got: >> 'cell' object has no attribute 'dir' It's a problem inside MySQLdb's "connections.py": def _get_unicode_literal(): def uni

Re: split parameter line with quotes

2008-01-11 Thread Joshua Kugler
teddyber wrote: > first i'm a newbie to python (but i searched the Internet i swear). > i'm looking for some way to split up a string into a list of pairs > 'key=value'. This code should be able to handle this particular > example string : > > qop="auth,auth-int,auth-conf",cipher="rc4-40,rc4-56,rc

  1   2   3   >