Re: Unicode/UTF-8 confusion

2008-03-15 Thread Carsten Haese
On Sat, 2008-03-15 at 16:33 -0400, Tom Stambaugh wrote: > I appreciate the answers the community has provided, I think I need to add > some additional context. > [...] > var aSerializedObject = '%(jsonString)s'; > [...] > Once back in the browser, the loadObject method calls JSON.parse on > a

Re: string literal or NoneType

2008-03-15 Thread castironpi
> > | hi all > > | i want to check a condition and if true should return a filename > > | string  from a list.if the condition is false i am returning a > > | ""  (string literal).. Identity is the strictest test, and you can't define your own. Lots of things can evaluate to True. Only None is N

Re: 'join' in the wrong word for the method in class Thread.

2008-03-15 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > 'join' in the wrong word for the method in class Thread. That's the standard term in threading. If it's not familiar to you, well, bummer, but there's not much more that can be done about that than for you to read the literature. -- Erik Max Francis && [EMAIL PROTE

Re: Spaces in path name

2008-03-15 Thread Tim Golden
joep wrote: > On Mar 15, 5:42 pm, joep <[EMAIL PROTECTED]> wrote: >>> http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... >> Note: this works for subprocess.call but for subprocess.Popen this >> does not work if there are two arguments in the command line with >> spaces. Especi

Re: 'join' in the wrong word for the method in class Thread.

2008-03-15 Thread castironpi
On Mar 15, 9:28 pm, Benjamin <[EMAIL PROTECTED]> wrote: > On Mar 15, 7:29 pm, [EMAIL PROTECTED] wrote:> 'join' in the wrong word for > the method in class Thread. > > > The agent-patient semantics of calling functions can get ambiguous. > > It is not a problem of native Pythoners alone.  Is it due

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Marc 'BlackJack' Rintsch
On Sat, 15 Mar 2008 16:33:24 -0400, Tom Stambaugh wrote: > I use a trick to let me pass the information into my browser client > application. The browser requests the server information from a form whose > target is a hidden iframe. The string the server serializes is wrapped in > html that emb

Re: call by reference howto????

2008-03-15 Thread Steven D'Aprano
On Sat, 15 Mar 2008 11:50:17 -0700, Dennis Lee Bieber wrote: > Small integers are cached in Python, so they always have a fixed ID > (address). Small integers are cached in CPython, making it an implementation- dependent feature. I don't believe that caching is promised by the language definitio

Re: Urgent : How to do memory leaks detection in python ?

2008-03-15 Thread tsuraan
> Python doesn't have memory leaks. Yeah, interesting bit of trivia: python is the world's only non-trivial program that's totally free of bugs. Pretty exciting! But seriously, python 2.4, at least, does have some pretty trivially exposed memory leaks when working with strings. A simple example

RE: Python for BlackBerry

2008-03-15 Thread Sandipan Gangopadhyay
Thanks, Mike. This one seems to be for Nokia, particularly S60 and Symbian in general. Does BlackBerry work on Symbian? Let me check. Thanks. Sandipan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Driscoll Sent: Saturday, March 15, 2008 6:04 PM To:

Re: os.path.isdir question

2008-03-15 Thread John Machin
On Mar 16, 12:12 pm, lampshade <[EMAIL PROTECTED]> wrote: > Hello, > > I'm having some problems with os.path.isdir I think it is something > simple that I'm overlooking. > > #!/usr/bin/python > import os > > my_path = os.path.expanduser("~/pictures/") > print my_path > results = os.listdir(my_pat

Re: os.path.isdir question

2008-03-15 Thread lampshade
On Mar 15, 9:27 pm, Benjamin <[EMAIL PROTECTED]> wrote: > On Mar 15, 8:12 pm, lampshade <[EMAIL PROTECTED]> wrote:> Hello, > > > I'm having some problems with os.path.isdir I think it is something > > simple that I'm overlooking. > > > #!/usr/bin/python > > import os > > > my_path = os.path.expan

Re: 'join' in the wrong word for the method in class Thread.

2008-03-15 Thread Benjamin
On Mar 15, 7:29 pm, [EMAIL PROTECTED] wrote: > 'join' in the wrong word for the method in class Thread. > > The agent-patient semantics of calling functions can get ambiguous. > It is not a problem of native Pythoners alone. Is it due to lazy > programming, an inability of English (do you have it

Re: os.path.isdir question

2008-03-15 Thread yoz
lampshade wrote: > Hello, > > I'm having some problems with os.path.isdir I think it is something > simple that I'm overlooking. > > #!/usr/bin/python > import os > > my_path = os.path.expanduser("~/pictures/") > print my_path > results = os.listdir(my_path) > for a_result in results: > if

Re: os.path.isdir question

2008-03-15 Thread Benjamin
On Mar 15, 8:12 pm, lampshade <[EMAIL PROTECTED]> wrote: > Hello, > > I'm having some problems with os.path.isdir I think it is something > simple that I'm overlooking. > > #!/usr/bin/python > import os > > my_path = os.path.expanduser("~/pictures/") > print my_path > results = os.listdir(my_path

Re: string literal or NoneType

2008-03-15 Thread castironpi
On Mar 15, 2:41 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | hi all > | i want to check a condition and if true should return a filename > | string  from a list.if the condition is false i am returning a > | ""  (string literal).

os.path.isdir question

2008-03-15 Thread lampshade
Hello, I'm having some problems with os.path.isdir I think it is something simple that I'm overlooking. #!/usr/bin/python import os my_path = os.path.expanduser("~/pictures/") print my_path results = os.listdir(my_path) for a_result in results: if os.path.isdir(str(my_path) + str(a_result)

'join' in the wrong word for the method in class Thread.

2008-03-15 Thread castironpi
'join' in the wrong word for the method in class Thread. The agent-patient semantics of calling functions can get ambiguous. It is not a problem of native Pythoners alone. Is it due to lazy programming, an inability of English (do you have it in other languages?), or not a problem at all? th1.jo

how can pulldom save to xml file?

2008-03-15 Thread sun
I have a large xml file parsed by pulldom. I did some editing on some node,change attributes and remove some child node, how do I save it back to this xml file or write a new xml file? The save method in minidom does not work for pulldom. Thanks -- http://mail.python.org/mailman/listinfo/pytho

Re: replace string in a file

2008-03-15 Thread joep
you can also use standard module fileinput.input with ''inplace'' option which backs up original file automatically. from python help for fileinput: Optional in-place filtering: if the keyword argument inplace=1 is passed to input() or to the FileInput constructor, the file is moved to a backup f

Re: Big file

2008-03-15 Thread hdante
On Mar 12, 10:50 pm, "Andrew Rekdal" <[EMAIL PROTECTED]> wrote: > Well, I can see how this could get real messy but within defining a GUI > there are many elements and so the block of elements such as a wx.notebook > for instance I would hope I could place all the code for this in another > file an

Re: Python and 3D

2008-03-15 Thread Carl Banks
On Mar 15, 4:09 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for Python modules that allow you to manipulate 3D > objects, more specifically Alias Wavefront .OBJ objects. > Also, a module that would allow you to vizualize these models and > rotate them etc.. > > The goal is

Re: Convert int to float

2008-03-15 Thread Dan Bishop
On Mar 15, 4:43 pm, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > > > def gem(a): > > g = sum(a) / len(a) > > return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) > > It now gives a int, but i would like to see floats.

Re: string literal or NoneType

2008-03-15 Thread castironpi
On Mar 15, 10:27 am, [EMAIL PROTECTED] wrote: > hi all > i want to check a condition and if true should return a filename > string  from a list.if the condition is false i am returning a > ""  (string literal).. > > retv="" > if  somecondition: >     retv=mylist[x] > ... > return retv > > The calli

Re: Convert int to float

2008-03-15 Thread sturlamolden
On 15 Mar, 22:43, Guido van Brakel <[EMAIL PROTECTED]> wrote: > > def gem(a): > > g = sum(a) / len(a) > > return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) gem( map(float,[1,2,3,4]) ) gem( float(i) for i in [1,2,3,4] ) -- http://mail.py

Re: Python Generators

2008-03-15 Thread Peter Otten
mpc wrote: > I am trying to write a while loop that will iterate over generators to > capture all the headers of FFCache directories. However, the > generators embedded within the argument of another generator do not > seem to re-initiate. the example below loops through and initiates the > genera

Re: Code to send RSS news by Sendmail

2008-03-15 Thread Mike Driscoll
On Mar 15, 3:18 pm, Ulysse <[EMAIL PROTECTED]> wrote: > Hello, > > I'm searching a code which allow you to parse each item in the RSS > feed, get the news page of each item, convert it to text and send it > by mail. > > Do you know if it exists ? > > Thanks Try using Google next time. In the meant

Re: Socket Performance

2008-03-15 Thread castironpi
On Mar 15, 8:18 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Gabriel Genellina wrote: > >> No need to reinvent the wheel. socket objects already have a makefile   > >> method returning a file-like object, which behaves like a buffered socket. > > That wheel is far from

Re: Python and 3D

2008-03-15 Thread Mike Driscoll
On Mar 15, 3:09 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for Python modules that allow you to manipulate 3D > objects, more specifically Alias Wavefront .OBJ objects. > Also, a module that would allow you to vizualize these models and > rotate them etc.. > > The goal is

Re: Python for BlackBerry

2008-03-15 Thread Mike Driscoll
On Mar 15, 7:24 am, "Sandipan Gangopadhyay" <[EMAIL PROTECTED]> wrote: > Is there a Python for BlackBerry? Thanks. > > -Original Message- > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of E-Lo > Sent: Saturday, March 15, 2008 6:03 AM > To: [EMAIL PROTECTED] > Subject: Pyt

Re: Joseph Weizenbaum

2008-03-15 Thread castironpi
> >>> I am embarrassed to say that this vaguely disrespectful exchange made me > >>> laugh out loud. > > >> Serious: why do you think this is disrespectful? > > >Not to speak for Tim, but I imagine it could be perceived as > >disrespectful because Prof. Weizenbaum has only recently passed away. > >

Re: Convert int to float

2008-03-15 Thread Guido van Brakel
Grant Edwards wrote: > On 2008-03-15, Guido van Brakel <[EMAIL PROTECTED]> wrote: >> Hello >> >> I have this now: >> >>> def gem(a): >>> g = sum(a) / len(a) > >g = float(sum(a)) / len(a) > >>> return g Hi, Thank you very much,sometimes it is so amazing simple. Regards -- Guid

Re: replace string in a file

2008-03-15 Thread Unknown
Thanks, andrei. I'll try that. Le Sat, 15 Mar 2008 14:25:21 -0700, andrei.avk a écrit : > What you want to do is either 1. load everything up into a string, > replace > text, close file, reopen it with 'w' flag, write string to it. OR if > file is too big, you can read each line, replace, write t

Re: Spaces in path name

2008-03-15 Thread joep
On Mar 15, 5:42 pm, joep <[EMAIL PROTECTED]> wrote: > >http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... > > Note: this works for subprocess.call but for subprocess.Popen this > does not work if there are two arguments in the command line with > spaces. Especially, even after

Convert int to float

2008-03-15 Thread Guido van Brakel
Hello I have this now: > def gem(a): > g = sum(a) / len(a) > return g > print gem([1,2,3,4]) > print gem([1,10,100,1000]) > print gem([1,-2,3,-4,5]) It now gives a int, but I would like to see floats. How can I integrate that into the function? Regards, -- Guido van Brakel

Re: Convert int to float

2008-03-15 Thread sturlamolden
On 15 Mar, 22:43, Guido van Brakel <[EMAIL PROTECTED]> wrote: > > def gem(a): > > g = sum(a) / len(a) > > return g > It now gives a int, but i would like to see floats. How can integrate > that into the function? You get an int because you are doing integer division. Cast one int to floa

Re: Convert int to float

2008-03-15 Thread Grant Edwards
On 2008-03-15, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > >> def gem(a): >> g = sum(a) / len(a) g = float(sum(a)) / len(a) >> return g > It now gives a int, but i would like to see floats. How can integrate > that into the function? See above. >

Re: Spaces in path name

2008-03-15 Thread joep
> > http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... Note: this works for subprocess.call but for subprocess.Popen this does not work if there are two arguments in the command line with spaces. Especially, even after trying out many different versions, I never managed to ge

Re: Getting started with OS X Leopard

2008-03-15 Thread Mark Carter
[EMAIL PROTECTED] wrote: > if you are not satisfied with the native version, why not install the > official version directly from python site > http://www.python.org/download/ (macpython) instead of using that of > macports. It moreover is provided with many utilities > > There is a macpython list

Re: Python Generators

2008-03-15 Thread sturlamolden
On 15 Mar, 21:35, mpc <[EMAIL PROTECTED]> wrote: > generator embedded in the argument only once. Can anyone explain while > the generator will not re-initiate, and suggest a simple fix? I am not sure what you are trying to do, but it seems a bit confused. >>> def concat(seq): for s in

Re: replace string in a file

2008-03-15 Thread andrei . avk
On Mar 15, 3:54 pm, Unknown <[EMAIL PROTECTED]> wrote: > Hi, > I've got this code : > > cb = open("testfile", "r+") > f = cb.readlines() > for line in f: >     rx = re.match(r'^\s*(\d+).*', line) >     if not rx: >         continue >     else: >         serial = rx.group(1) >         now = time.tim

replace string in a file

2008-03-15 Thread Unknown
Hi, I've got this code : cb = open("testfile", "r+") f = cb.readlines() for line in f: rx = re.match(r'^\s*(\d+).*', line) if not rx: continue else: serial = rx.group(1) now = time.time() today = time.strftime('%Y%m%d00', time.localtime(now)) to

Re: Getting started with OS X Leopard

2008-03-15 Thread martin . laloux
if you are not satisfied with the native version, why not install the official version directly from python site http://www.python.org/download/ (macpython) instead of using that of macports. It moreover is provided with many utilities There is a macpython list that you can consult at http://www.

Python Generators

2008-03-15 Thread mpc
HI all, I am trying to write a while loop that will iterate over generators to capture all the headers of FFCache directories. However, the generators embedded within the argument of another generator do not seem to re-initiate. the example below loops through and initiates the generator embedded i

Re: Getting started with OS X Leopard

2008-03-15 Thread Kevin Walzer
Mark Carter wrote: > Arnaud Delobelle wrote: > >> Is there a particular reason you want python from MacPorts? OSX >> Leopard comes with python 2.5, that's what I use on my mac. > > I heard from somewhere that Apple's version was a bit wonky, and that I > would be better off with a "proper" build

Code to send RSS news by Sendmail

2008-03-15 Thread Ulysse
Hello, I'm searching a code which allow you to parse each item in the RSS feed, get the news page of each item, convert it to text and send it by mail. Do you know if it exists ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Python and 3D

2008-03-15 Thread Eric von Horst
Hi, I am looking for Python modules that allow you to manipulate 3D objects, more specifically Alias Wavefront .OBJ objects. Also, a module that would allow you to vizualize these models and rotate them etc.. The goal is not to build a new renderer or something; just a small program that I need t

Re: Getting started with OS X Leopard

2008-03-15 Thread Mark Carter
Arnaud Delobelle wrote: > Is there a particular reason you want python from MacPorts? OSX > Leopard comes with python 2.5, that's what I use on my mac. I heard from somewhere that Apple's version was a bit wonky, and that I would be better off with a "proper" build. -- http://mail.python.org/ma

Cannot install SOAPpy

2008-03-15 Thread shaq . koby
I installed SOAPpy on my server with Python 2.5. But now everytime I exit, I get the following error: Exception exceptions.AttributeError: '_shutdown' in ignored Here is the command line output: [EMAIL PROTECTED]:~$ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1

Re: Getting started with OS X Leopard

2008-03-15 Thread Arnaud Delobelle
On Mar 15, 7:31 pm, Mark Carter <[EMAIL PROTECTED]> wrote: > has wrote: > > On 15 Mar, 18:05, Mark Carter <[EMAIL PROTECTED]> wrote: > >> The sorts of things I want to do are: > >> * copy the directory of Finder to the clipboard > >> * add a new file to Finder's directory. > >> * find out the size

Re: Getting started with OS X Leopard

2008-03-15 Thread Mark Carter
has wrote: > On 15 Mar, 18:05, Mark Carter <[EMAIL PROTECTED]> wrote: >> The sorts of things I want to do are: >> * copy the directory of Finder to the clipboard >> * add a new file to Finder's directory. >> * find out the size of a directory >> * open a file with Aquamacs, regardless of file type,

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Tom Stambaugh
I appreciate the answers the community has provided, I think I need to add some additional context. I use a trick to let me pass the information into my browser client application. The browser requests the server information from a form whose target is a hidden iframe. The string the server ser

Re: string literal or NoneType

2008-03-15 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | hi all | i want to check a condition and if true should return a filename | string from a list.if the condition is false i am returning a | "" (string literal).. | | retv="" | if somecondition: |retv=mylist[x] | ... | return ret

Weight Problem

2008-03-15 Thread Ravi Kumar
An Interesting problem, """ A man has only 4 bricks of different weights, lies between 1-40KG, Also, the total weights of Brick A, B, C, D (ie A+B+C+D) is 40KG. The man uses that brick to calculate every possible weight from 1 KG to 40 KG in his shop. (only whole numbers 1KG, 2KG etc, not like 2.3

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Marc Christiansen
Tom Stambaugh <[EMAIL PROTECTED]> wrote: >> Somehow I don't get what you are after. The ' doesn't have to be escaped >> at all if " are used to delimit the string. If ' are used as delimiters >> then \' is a correct escaping. What is the problem with that!? > > If I delimit the string with doub

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Carsten Haese
On Sat, 2008-03-15 at 20:03 +0100, Carsten Haese wrote: > On Sat, 2008-03-15 at 12:09 -0400, Tom Stambaugh wrote: > > [...] > > I use simplejson to serialize html strings that the server is delivering to > > a browser. Since the apostrophe is a string terminator in javascript, I > > need > > to

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Carsten Haese
On Sat, 2008-03-15 at 12:09 -0400, Tom Stambaugh wrote: > [...] > I use simplejson to serialize html strings that the server is delivering to > a browser. Since the apostrophe is a string terminator in javascript, I need > to escape any apostrophe embedded in the html. > [...] simplejson escapes

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Matt Nordhoff
Tom Stambaugh wrote: > I'm still confused about this, even after days of hacking at it. It's > time I asked for help. I understand that each of you knows more about > Python, Javascript, unicode, and programming than me, and I understand > that each of you has a higher SAT score than me. So please

Re: Getting started with OS X Leopard

2008-03-15 Thread has
On 15 Mar, 18:05, Mark Carter <[EMAIL PROTECTED]> wrote: > The sorts of things I want to do are: > * copy the directory of Finder to the clipboard > * add a new file to Finder's directory. > * find out the size of a directory > * open a file with Aquamacs, regardless of file type, If you want to c

Re: Joseph Weizenbaum

2008-03-15 Thread Aahz
In article <[EMAIL PROTECTED]>, Jeff Schwab <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Tim Roberts <[EMAIL PROTECTED]> wrote: >>> >>> I am embarrassed to say that this vaguely disrespectful exchange made me >>> laugh out loud. >> >> Serious: why do you think t

Re: Creating a file with $SIZE

2008-03-15 Thread rbossy
Quoting Bryan Olson <[EMAIL PROTECTED]>: > Robert Bossy wrote: > > Bryan Olson wrote: > >> Robert Bossy wrote: > Robert Bossy wrote: > > Indeed! Maybe the best choice for chunksize would be the file's buffer > > size... > >> > >> That bit strikes me as silly. > >> > > The size of the

Re: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-15 Thread geert
On Mar 14, 11:49 am, "Robert Rawlins" <[EMAIL PROTECTED]> wrote: > Geert, > > I've not seen this issue myself, however, you might get a little more luck > asking over on theMySQLdbmailing list as this seems to be more an issue > with the db than your python code. It might be worth posting your ques

Getting started with OS X Leopard

2008-03-15 Thread Mark Carter
One thing I really liked about Ubuntu was that Nautilus allowed you to add scripts to a directory which could be accessed via the RMB. It was a very simple thing to do. I've recently switched to Leopard, and I'm trying to do the same thing. I'm fairly experienced with Python, but new to OS X. I

Re: Joseph Weizenbaum

2008-03-15 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Tim Roberts <[EMAIL PROTECTED]> wrote: >> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> Roel Schroeven wrote: [EMAIL PROTECTED] schreef: > On Mar 14, 1:47 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: >> How do you feel about creator of

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Tom Stambaugh
> Somehow I don't get what you are after. The ' doesn't have to be escaped > at all if " are used to delimit the string. If ' are used as delimiters > then \' is a correct escaping. What is the problem with that!? If I delimit the string with double quote, then I have to escape every double quo

[no subject]

2008-03-15 Thread Tom Stambaugh
> Somehow I don't get what you are after. The ' doesn't have to be escaped > at all if " are used to delimit the string. If ' are used as delimiters > then \' is a correct escaping. What is the problem with that!? If I delimit the string with double quote, then I have to escape every double qu

Re: Unicode/UTF-8 confusion

2008-03-15 Thread Marc 'BlackJack' Rintsch
On Sat, 15 Mar 2008 12:09:19 -0400, Tom Stambaugh wrote: > I'm still confused about this, even after days of hacking at it. It's time I > asked for help. I understand that each of you knows more about Python, > Javascript, unicode, and programming than me, and I understand that each of > you ha

Unicode/UTF-8 confusion

2008-03-15 Thread Tom Stambaugh
I'm still confused about this, even after days of hacking at it. It's time I asked for help. I understand that each of you knows more about Python, Javascript, unicode, and programming than me, and I understand that each of you has a higher SAT score than me. So please try and be gentle with you

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 13 Mar, 09:22, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Whatever python has for a calling convention, it is close enough that > naming it "call by reference" gives people a reasonable idea of what > is going on. Only to the extent that many mistake passing Java or C# reference types for "cal

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 28 Feb, 02:24, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Python doesn't do call by reference. Nor does it do call by value. Please > pay no attention to anyone who says it does. Exactly. Python pass variables the same way as Lisp, which is neither "call-by-value" (cf. C)

Unicode/UTF-8 confusion

2008-03-15 Thread Tom Stambaugh
I'm still confused about this, even after days of hacking at it. It's time I asked for help. I understand that each of you knows more about Python, Javascript, unicode, and programming than me, and I understand that each of you has a higher SAT score than me. So please try and be gentle with your r

Re: call by reference howto????

2008-03-15 Thread sturlamolden
On 28 Feb, 02:24, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Python doesn't do call by reference. Nor does it do call by value. Please > pay no attention to anyone who says it does. Exactly. Python pass variables the same way as Lisp, which is neither "call-by-value" (cf. C)

Re: Joseph Weizenbaum

2008-03-15 Thread Aahz
In article <[EMAIL PROTECTED]>, Tim Roberts <[EMAIL PROTECTED]> wrote: >Jeff Schwab <[EMAIL PROTECTED]> wrote: >>Roel Schroeven wrote: >>> [EMAIL PROTECTED] schreef: On Mar 14, 1:47 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > How do you feel about creator of Eliza?

Exciting FREE Details

2008-03-15 Thread sreya9636
Tips On Buying A Desktop Computer While the case may not be important to some computer users it is a consideration to be thought about before purchasing a desktop computer. ... Log on : http://www.computer-solution.page.tl -- http://mail.python.org/mailman/listinfo/python-list

string literal or NoneType

2008-03-15 Thread menosaint
hi all i want to check a condition and if true should return a filename string from a list.if the condition is false i am returning a "" (string literal).. retv="" if somecondition: retv=mylist[x] ... return retv The calling function will check the return value and print the filename if i

Re: Joseph Weizenbaum

2008-03-15 Thread castironpi
On Mar 15, 4:56 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Mar 15, 5:47 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > > > > > Jeff Schwab <[EMAIL PROTECTED]> wrote: > > >Roel Schroeven wrote: > > >> [EMAIL PROTECTED] schreef: > > >>> On Mar 14, 1:47 pm, "Reedick, Andrew" <[EMAIL PROTEC

Python for BlackBerry

2008-03-15 Thread Sandipan Gangopadhyay
Is there a Python for BlackBerry? Thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of E-Lo Sent: Saturday, March 15, 2008 6:03 AM To: python-list@python.org Subject: Python for Palm OS Is there any other edition of Python for Palm OS instead of Pippy?

Using threads in python is safe ?

2008-03-15 Thread Deepak Rokade
Hi All, I want to use therads in my application. Going through the docs , I read about GIL. Now I am confused whether using threads in python is safe or not. One thing I know that if I am accessing global variables in two or more threads I need to synchronize them using locking or such mechanism s

Re: Socket Performance

2008-03-15 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Gabriel Genellina wrote: >> No need to reinvent the wheel. socket objects already have a makefile >> method returning a file-like object, which behaves like a buffered socket. That wheel is far from round, and needs some reinvention. Python's file-like objects do not p

Re: Python-list Digest, Vol 54, Issue 199

2008-03-15 Thread Thomas Boland
what the? why can this get through? [EMAIL PROTECTED] wrote: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-list > or, via email, send a message with

Re: Python for Palm OS

2008-03-15 Thread Malcolm Greene
E-Lo, PalmPython http://c2.com/cgi/wiki?PalmPython I have no experience with Python for Palm OS's. This is just a reference from my personal notes. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Spaces in path name

2008-03-15 Thread Tim Golden
joep wrote: > I had the same problem recently with subprocess.popen, when there is a > space in the executable and a space in an additional argument as in > the acrobat example. I finally found a past thread in this news group > that explained that you have to use two (2) leading double quotes, and

I found affordable health insurance.

2008-03-15 Thread MSmith
I couldn't believe it. Do yourself a favour and at least check it out: http://www.jdoqocy.com/click-2924912-10359791 Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there Python equivalent to Perl BEGIN{} block?

2008-03-15 Thread Alex
On Mar 15, 5:42 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Mar 14, 6:37 pm, Alex <[EMAIL PROTECTED]> wrote: > > > > > On Mar 13, 6:21 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Mar 13, 7:02 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > > > Alex a écrit : > > > > (sni) >

Python for Palm OS

2008-03-15 Thread E-Lo
Is there any other edition of Python for Palm OS instead of Pippy? -- http://mail.python.org/mailman/listinfo/python-list

Re: Joseph Weizenbaum

2008-03-15 Thread Arnaud Delobelle
On Mar 15, 5:47 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: > >Roel Schroeven wrote: > >> [EMAIL PROTECTED] schreef: > >>> On Mar 14, 1:47 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > Subject: RIP: Joseph Weizenbaum > > Creator of Eliza: > >>>

Re: ImportError while Embedding python in C

2008-03-15 Thread kaush
On Mar 15, 2:10 am, kaush <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a simple python script saved to "test.py" as > > import os > import base64 > > def Testfunction(): > print "Hello World" > return > > Testfunction() > > I am trying to invoke this from a C program as follows > > int m

Re: unitests don't run under pdb

2008-03-15 Thread Gabriel Genellina
En Fri, 14 Mar 2008 17:23:14 -0200, Amit Gupta <[EMAIL PROTECTED]> escribi�: > So What do I do, if my testcase if failing because of an uncaught > exception and I want to run it in pdb. Oh, sorry, my last message doesn't apply because the unittest framework caughts the exception. Looks like y

ImportError while Embedding python in C

2008-03-15 Thread kaush
Hi All, I have a simple python script saved to "test.py" as import os import base64 def Testfunction(): print "Hello World" return Testfunction() I am trying to invoke this from a C program as follows int main(int argc, char* argv[]) { Py_Initialize(); PyObject* main_

Re: unitests don't run under pdb

2008-03-15 Thread Gabriel Genellina
En Fri, 14 Mar 2008 17:23:14 -0200, Amit Gupta <[EMAIL PROTECTED]> escribi�: > On Feb 20, 8:51 pm, Miki <[EMAIL PROTECTED]> wrote: >> Hello Amit, >> >> > python testname.py : the unitests runs as usual and I get the >> > following results: >> >

Re: Socket Performance

2008-03-15 Thread castironpi
On Mar 15, 3:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 13 Mar 2008 15:18:44 -0200, <[EMAIL PROTECTED]> escribió: > > > Well, lets say you have a situation where you're going to be > > alternating between sending large and small chunks of data. Is the > > solution to create a N

Re: List mutation method gotcha - How well known?

2008-03-15 Thread Hendrik van Rooyen
On Thu, Mar 13, 2008 at 8:36 AM, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > foo = [1,2,3,4] > x = foo.append(5) > print x > > What will be the output (choose one): > > 1) [1,2,3,4] > 2) [1,2,3,4,5] > 3) That famous picture of Albert Einstein sticking out his tongue > 4) Nothing - n

Re: Socket Performance

2008-03-15 Thread Gabriel Genellina
En Thu, 13 Mar 2008 15:18:44 -0200, <[EMAIL PROTECTED]> escribió: > Well, lets say you have a situation where you're going to be > alternating between sending large and small chunks of data. Is the > solution to create a NetworkBuffer class and only call send when the > buffer is full, always recv

Re: Handling global variables (Newbie)

2008-03-15 Thread Gabriel Genellina
En Thu, 13 Mar 2008 02:25:12 -0200, David S <[EMAIL PROTECTED]> escribi�: > I have an error occurring at > self.build_root = os.path.abspath(os.path.split(__file__)[0]) > > The error states 'NameError: global name '__file__' is not defined' > > In Python 2.5 I ran my script as a module in ID

Re: call by reference howto????

2008-03-15 Thread castironpi
On Mar 15, 12:39 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 14 Mar 2008 10:38:52 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > In that case I find it very strange that when this question comes > > up, I see so few attempts to explain how the