Re: url fetching from xml depending upon selection

2010-05-18 Thread Stefan Behnel
shanti bhushan, 18.05.2010 07:18: I have a sample.XML file the code is like this My Podcasts Sun, 07 Mar 2010 15:53:26 GMT Sun, 07 Mar 2010 15:53:26 GMT http://first.co.jp"; /> http://www.google.com"; /> http://www.epaper.times.india.com"; />

Re: pickle unable to load collection

2010-05-18 Thread Peter Otten
paragk wrote: > Hi, > > I am unable to figure out the cause of python pickle unable to find > the collection module. > > I am getting > > __import__(module) > ImportError: No module named collections > > when I try to load a pickled object. > > Details: > > Python version: > > Python 2.

Re: Pyserial and pysqlite data types, need advice

2010-05-18 Thread jon vs. python
The best thing I've found is this: http://eli.thegreenplace.net/2009/05/29/storing-blobs-in-a-sqlite-db-with-pythonpysqlite/ On Mon, May 17, 2010 at 5:05 PM, jon vs. python wrote: > Hi, > I'm trying to store frames received via serial port (using Pyserial) into a > sqlite database (using Pysqlit

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 10:18 am, shanti bhushan wrote: > I have a sample.XML file > the code is like this > > > > >         My Podcasts >         Sun, 07 Mar 2010 15:53:26 > > GMT >         Sun, 07 Mar 2010 15:53:26 > > GMT > > >   >     http://first.co.jp"; /> >     http://www.google.com"; /> >     htt

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 12:04 pm, Stefan Behnel wrote: > shanti bhushan, 18.05.2010 07:18: > > > > > > > I have a sample.XML file > > the code is like this > > > > > > > > >    My Podcasts > >    Sun, 07 Mar 2010 15:53:26 > > > GMT > >    Sun, 07 Mar 2010 15:53:26 > > > GMT > > > > > >     > >      http:/

Re: url fetching from xml depending upon selection

2010-05-18 Thread Stefan Behnel
shanti bhushan, 18.05.2010 07:18: I have a sample.XML file the code is like this My Podcasts Sun, 07 Mar 2010 15:53:26 GMT Sun, 07 Mar 2010 15:53:26 GMT http://first.co.jp"; /> http://www.google.com"; /> http://www.epaper.times.india.com"; />

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 12:04 pm, Stefan Behnel wrote: > shanti bhushan, 18.05.2010 07:18: > > > > > > > I have a sample.XML file > > the code is like this > > > > > > > > >    My Podcasts > >    Sun, 07 Mar 2010 15:53:26 > > > GMT > >    Sun, 07 Mar 2010 15:53:26 > > > GMT > > > > > >     > >      http:/

Re: url fetching from xml depending upon selection

2010-05-18 Thread Stefan Behnel
shanti bhushan, 18.05.2010 10:08: On May 18, 12:04 pm, Stefan Behnel wrote: shanti bhushan, 18.05.2010 07:18: >>> [...] http://first.co.jp"; /> http://www.google.com"; /> http://www.epaper.times.india.com"; /> http://second.co.jp"; /> http://www.g

Re: pickle unable to load collection

2010-05-18 Thread paragk
On May 18, 12:10 am, Peter Otten <__pete...@web.de> wrote: > paragk wrote: > > Hi, > > > I am unable to figure out the cause of python pickle unable to find > > the collection module. > > > I am getting > > >     __import__(module) > > ImportError: No module named collections > > > when I try to lo

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Sat, 5/15/10, Ben Finney wrote: > From: Ben Finney > Subject: Re: Picking a license > To: python-list@python.org > Date: Saturday, May 15, 2010, 12:57 AM > a...@pythoncraft.com > (Aahz) writes: > > > You can't really sell Open Source software in any > practical way; > > someone will alwa

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Sat, 5/15/10, Duncan Booth wrote: > From: Duncan Booth > Subject: Re: Picking a license > To: python-list@python.org > Date: Saturday, May 15, 2010, 8:52 AM > Ed Keith > wrote: > > > I can not imagine anyone being stupid enough to pay me > for rights to > > use code I had already publis

Is there conversion method to convert pyunicodeobject to pybyteobject?

2010-05-18 Thread MathanK
Hi All, A variable whose data type is PyUnicodeObject is to be assigned to varioable of PyBytesObject type example : PyUnicodeObject *p = ...whatever...; function( (PyByteObject*p)); compiled and got a Bus Error. Cheers, Mathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Sat, 5/15/10, Lawrence D'Oliveiro wrote: > From: Lawrence D'Oliveiro > Subject: Re: Picking a license > To: python-list@python.org > Date: Saturday, May 15, 2010, 11:09 PM > In message , > Ed Keith > wrote: > > > But if my client give someone else a copy of the > binary I gave them, t

Re: Picking a license

2010-05-18 Thread Ethan Furman
Paul Boddie wrote: As I said before, spare me the condescension. Spare us your self-righteous bull-crap. Do you think we haven't seen your false accusations and made-up motives against Patrick Maupin? If I cared more and/or had more time, I'd make a summary -- but quite frankly Pat has defe

Convert PyUnicodeObject to PyBytesObject in python3.x?

2010-05-18 Thread gmail
Hi All, A variable whose data type is PyUnicodeObject needs to passed to a function as an argument whose data type should be PyBytesObject type example : PyUnicodeObject *p = ...whatever...; function (PyByteObject* a); function((PyBytesObject *)p); compiled and got a Bus Error. Thanks for

Conversion method for PyUnicodeObject type to PyBytesObject type

2010-05-18 Thread mathan kumar
A variable whose data type is PyUnicodeObject needs to be passed to a function as an argument whose data type should be PyBytesObject type example : function (PyByteObject* a){ .operations } PyUnicodeObject *p = somevalue; function((PyBytesObject *)p); ouptut: Got a Bus Error. -- http://

Fw: Re: Re: joining files

2010-05-18 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: "mannu jha"mannu_0...@rediffmail.com To: tuomas.vesteri...@iki.fi Subject: Re: Re: joining files--- Begin Message --- > import os > def merge_sources(sources): > # sources is a list of tuples (source_name, source_data) > data = []

python and GNU plot

2010-05-18 Thread Sandy Ydnas
pls pls help how to use Gnuplot Gnuplot runs from Python under Vista downloaded Gnuplot, but what they suggest only Run wgnuplot.exe Thank you very much in advance!!! Sandy _

subprocess and gvfs-mount

2010-05-18 Thread Samuel Bancal
Hi, I'm coding a script that does some automates for my users ... including mounting a smb share. Because we are using Gnome, I choosed to use gvfs-mount, which is quite similar to "Places > Connect to Server > ..." Now my script does : print "*** Mounting the FILER ..." cmd = "/

Re: Re: joining files

2010-05-18 Thread mannu jha
On Mon, 17 May 2010 23:57:18 +0530 wrote >Try: file = open("input11.txt") file1 = file.read() # file1 is a string file.close() or file1 = open("input11.txt") # file1 is an open file object and replace lines: for line in sce.split(os.linesep): lst = line.split() lines[lst[0]] =

Re: Global variables for python applications

2010-05-18 Thread Duncan Booth
Steven D'Aprano wrote: > I think it is an abuse of the term constant to allow you to talk about a > mutable object being "constant", since it can vary. Generally, you don't > care about identity, only equality. Making up a syntax on the spot: > > constant pi = [3.1415] > assert pi = 3.1415 > p

Re: Is this an ok thing to do in a class

2010-05-18 Thread Simon Brunning
On 18 May 2010 06:21:32 UTC+1, Vincent Davis wrote: > > Just wondering if there is a problem with mixing a dictionary into a class > like this. Everything seems to work as I would expect. No problem at all AFAIC. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

max time wait for a function

2010-05-18 Thread pacopyc
Hi, I've a question for you. I'd like to call a function and waiting its return value for a time max (30 sec). The function could not respond and then I must avoid to wait for infinite time. OS is Windows XP. Can you help me? Thank -- http://mail.python.org/mailman/listinfo/python-list

Re: max time wait for a function

2010-05-18 Thread Albert Hopkins
On Tue, 2010-05-18 at 02:45 -0700, pacopyc wrote: > Hi, I've a question for you. I'd like to call a function and waiting > its return value for a time max (30 sec). > The function could not respond and then I must avoid to wait for > infinite time. OS is Windows XP. > Can you help me? > > Thank T

Re: Can't find _sqlite3.so in lib-dynload

2010-05-18 Thread Kushal Kumaran
On Tue, May 18, 2010 at 5:38 AM, Peng Yu wrote: > On May 17, 6:38 pm, a...@pythoncraft.com (Aahz) wrote: >> In article , >> Peng Yu   wrote: >> >> >> >> >I compiled python2.6.4 from source. But I can't find _sqlite3.so in >> >the install directory. I thought that _sqlite3.so should be generated >>

Re: subprocess and gvfs-mount

2010-05-18 Thread Adam Tauno Williams
On Mon, 2010-05-17 at 17:54 +0200, Samuel Bancal wrote: > Hi, > I'm coding a script that does some automates for my users ... > including mounting a smb share. > Because we are using Gnome, I choosed to use gvfs-mount, which is > quite similar to "Places > Connect to Server > ..."= > Now my script

Re: max time wait for a function

2010-05-18 Thread Bryan
pacopyc wrote: > I'd like to call a function and waiting > its return value for a time max (30 sec). > The function could not respond and then I must avoid to wait for > infinite time. OS is Windows XP. You can do that using the multiprocessing module, which is in the standard library of Python 2

Regular expression

2010-05-18 Thread Back9
Hi, I have a string like this: 0x340x5A0x9B0xBA I want to extract 0x from the string but the first one. How I can use re for this case? The string size will vary. TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression

2010-05-18 Thread ilvecchio
On May 18, 3:48 pm, Back9 wrote: >  Hi, > > I have a string like this: > 0x340x5A0x9B0xBA > I want to extract 0x from the string but the first one. > > How I can use re for this case? > > The string size will vary. > > TIA Maybe the easy way is something like this: m = re.match('(0x)(.*)','0x340

Re: Regular expression

2010-05-18 Thread Back9
On May 18, 10:09 am, ilvecchio wrote: > On May 18, 3:48 pm, Back9 wrote: > > >  Hi, > > > I have a string like this: > > 0x340x5A0x9B0xBA > > I want to extract 0x from the string but the first one. > > > How I can use re for this case? > > > The string size will vary. > > > TIA > > Maybe the easy

Multi-Threading in Python

2010-05-18 Thread Lou
Can anyone tell me how easy it is to do multi-threading in Python? This has probably been brought up already, so if it has, thanks anyway -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression

2010-05-18 Thread Jon Clements
On 18 May, 15:32, Back9 wrote: > On May 18, 10:09 am, ilvecchio wrote: > > > > > On May 18, 3:48 pm, Back9 wrote: > > > >  Hi, > > > > I have a string like this: > > > 0x340x5A0x9B0xBA > > > I want to extract 0x from the string but the first one. > > > > How I can use re for this case? > > > > T

Re: Regular expression

2010-05-18 Thread J. Cliff Dyer
Don't use regular expressions for that. s = '0x340x5A0x9B0xBA' return '0x' + ''.join(s.split('0x')) On Tue, 2010-05-18 at 06:48 -0700, Back9 wrote: > Hi, > > I have a string like this: > 0x340x5A0x9B0xBA > I want to extract 0x from the string but the first one. > > How I can use re for this cas

Re: Multi-Threading in Python

2010-05-18 Thread Adam Tauno Williams
On Tue, 2010-05-18 at 07:35 -0700, Lou wrote: > Can anyone tell me how easy it is to do multi-threading in Python? Very easy. Or as easy as in any other platform - and as easy to screw up. Personally I prefer to use multiprocessing [which is a module that 'simulates' threads using separate proce

Re: Is this an ok thing to do in a class

2010-05-18 Thread Bruno Desthuilliers
Simon Brunning a écrit : On 18 May 2010 06:21:32 UTC+1, Vincent Davis wrote: Just wondering if there is a problem with mixing a dictionary into a class like this. Everything seems to work as I would expect. No problem at all AFAIC. OP didn't show up on c.l.py, so too bad you snipped the re

Re: abc don't play well with private method

2010-05-18 Thread Bruno Desthuilliers
mouadino a écrit : Hello and thanx for your answer it's was very helpful but just to clear some thinks : There's no such thing as a "private" attribute in Python. The name-mangling mechanism invoked by "__name" is really meant to avoid accidental redefinition of the attribute in a derived clas

RE: Multi-Threading in Python

2010-05-18 Thread Sandy Ydnas
great can help to find some examples of multiprocessing Sandy > Subject: Re: Multi-Threading in Python > From: awill...@whitemice.org > To: python-list@python.org > Date: Tue, 18 May 2010 10:45:11 -0400 > > On Tue, 2010-05-18 at 07:35 -0700, Lou wrote: > > Can anyone tell me how easy it is t

Getting System error with PyModule_AddIntConstant funtion

2010-05-18 Thread MathanK
Following is a Python C api which runs properly without PyModule_AddIntConstant function. But when PyModule_AddIntConstant() function is used, getting the following error when i call c. path("test call"); " SystemError: NULL result without error in PyObject_Call " Python C api- c.c int te

Re: Getting System error with PyModule_AddIntConstant funtion

2010-05-18 Thread Philip Semanchuk
On May 18, 2010, at 11:41 AM, MathanK wrote: Following is a Python C api which runs properly without PyModule_AddIntConstant function. But when PyModule_AddIntConstant() function is used, getting the following error when i call c. path("test call"); " SystemError: NULL result without err

Re: getting attributes and methods of class without creating object

2010-05-18 Thread Terry Reedy
On 5/18/2010 2:11 AM, shuvro wrote: to know the attributes of an instance of a class without actually creating that instance is very difficult. Is it not possible with the existing python facilities (without adding external libraries) ? To know what a function would do if you were to call it

Re: Picking a license

2010-05-18 Thread Robert Kern
On 2010-05-16 09:25 , Ed Keith wrote: --- On Sat, 5/15/10, Lawrence D'Oliveiro wrote: From: Lawrence D'Oliveiro Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 11:09 PM In message, Ed Keith wrote: But if my client give someone else a copy of the bin

Re: Multi-Threading in Python

2010-05-18 Thread geremy condra
On Tue, May 18, 2010 at 7:35 AM, Lou wrote: > Can anyone tell me how easy it is to do multi-threading in Python? > This has probably been brought up already, so if it has, thanks anyway > -- > http://mail.python.org/mailman/listinfo/python-list It's very easy, but it's probably best to use multip

Discover PyH

2010-05-18 Thread bluesmanu
Hi all, I would like to present my first python library : PyH. PyH is a concise and powerful module that lets you build your HTML pages like a GUI. Tags are objects that can be created, included and modified at any time during your script. Discover it at http://pyh.googlecode.com . You can file bu

Re: Is there conversion method to convert pyunicodeobject to pybyteobject?

2010-05-18 Thread Terry Reedy
On 5/15/2010 10:50 AM, MathanK wrote: This is the third time, at least, that you posted this, though the first time you asked a question. You have given no indication that you bothered to look in the manual before or between postings. A variable whose data type is PyUnicodeObject is to be as

Re: max time wait for a function

2010-05-18 Thread Terry Reedy
On 5/18/2010 6:24 AM, Albert Hopkins wrote: On Tue, 2010-05-18 at 02:45 -0700, pacopyc wrote: Hi, I've a question for you. I'd like to call a function and waiting its return value for a time max (30 sec). The function could not respond and then I must avoid to wait for infinite time. OS is Windo

Re: Multi-Threading in Python

2010-05-18 Thread Terry Reedy
On 5/18/2010 11:29 AM, Sandy Ydnas wrote: can help to find some examples of multiprocessing Multiprocessing is designed to be api-compatible with threading. Search the archives of this list/newsgroup for several examples. -- http://mail.python.org/mailman/listinfo/python-list

RE: Multi-Threading in Python

2010-05-18 Thread Adam Tauno Williams
On Tue, 2010-05-18 at 20:29 +0500, Sandy Ydnas wrote: > great > can help to find some examples of multiprocessing There is the reasonably good documentation at: I did a Multiprocessing presentation recently:

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Tue, 5/18/10, Robert Kern wrote: > From: Robert Kern > Subject: Re: Picking a license > To: python-list@python.org > Date: Tuesday, May 18, 2010, 12:03 PM > On 2010-05-16 09:25 , Ed Keith > wrote: > > > > --- On Sat, 5/15/10, Lawrence D'Oliveiro  > wrote: > > > >> From: Lawrence D'Oliveir

Re: pickle unable to load collection

2010-05-18 Thread Terry Reedy
On 5/18/2010 3:10 AM, Peter Otten wrote: Now simulate the effect of writing in text mode and reading in binary mode: >>> garbled_data = data.replace("\n", "\r\n") >>> pickle.loads(garbled_data) Traceback (most recent call last): ... ImportError: No module named collections >>> try: pick

RE: Multi-Threading in Python

2010-05-18 Thread Sandy Ydnas
good thanks a lot Sandy > Subject: RE: Multi-Threading in Python > From: awill...@whitemice.org > To: python-list@python.org > Date: Tue, 18 May 2010 12:45:37 -0400 > > On Tue, 2010-05-18 at 20:29 +0500, Sandy Ydnas wrote: > > great > > can help to find some examples of multiprocessing > >

Re: Regular expression

2010-05-18 Thread Terry Reedy
On 5/18/2010 10:40 AM, J. Cliff Dyer wrote: Don't use regular expressions for that. s = '0x340x5A0x9B0xBA' return '0x' + ''.join(s.split('0x')) or >>> '0x'+s[2:].replace('0x','') '0x345A9BBA' Take your pick, you should learn and understand both. On Tue, 2010-05-18 at 06:48 -0700, Back9 wrot

Re: Picking a license

2010-05-18 Thread Patrick Maupin
On May 18, 11:03 am, Robert Kern wrote: > On 2010-05-16 09:25 , Ed Keith wrote: > > No, the GPL makes it clear that the responsibly is on the distributor to > > either supply the source or written notice, Caveat venditor. The violation > > exists regardless of whether or not the recipient makes

Re: Getting System error with PyModule_AddIntConstant funtion

2010-05-18 Thread MathanK
I checked for Null also. But No change in the result. Still getting the system error. But when i m calling only c.c(5) function and not calling c.path("hi python c api") function, i m getting proper output without any system error. Any clue? Subject: Re: Getting System error with PyModule_Add

recall function definition from shell

2010-05-18 Thread superpollo
>>> def myfun(): ... return "WOW" ... >>> myfun() 'WOW' >>> now, i would like to "list" the funcion definition, something like this: >>> myfun.somethinglikethis() def myfun(): return "WOW" >>> is there something like this around? bye -- http://mail.python.org/mailman/listinfo/python-li

upgrade python

2010-05-18 Thread packet
Would it be safe to upgrade from python 2.6.4 to 2.6.5 without hurting the 2.6.4? -- http://mail.python.org/mailman/listinfo/python-list

Re: recall function definition from shell

2010-05-18 Thread Patrick Maupin
On May 18, 12:31 pm, superpollo wrote: >  >>> def myfun(): > ...     return "WOW" > ... >  >>> myfun() > 'WOW' >  >>> > > now, i would like to "list" the funcion definition, something like this: > >  >>> myfun.somethinglikethis() > def myfun(): >      return "WOW" >  >>> > > is there something lik

Re: recall function definition from shell

2010-05-18 Thread superpollo
Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo wrote: >>> def myfun(): ... return "WOW" ... >>> myfun() 'WOW' >>> now, i would like to "list" the funcion definition, something like this: >>> myfun.somethinglikethis() def myfun(): return "WOW" >>> is there something

Re: recall function definition from shell

2010-05-18 Thread Patrick Maupin
On May 18, 1:41 pm, superpollo wrote: > Patrick Maupin ha scritto: > > > > > On May 18, 12:31 pm, superpollo wrote: > >>  >>> def myfun(): > >> ...     return "WOW" > >> ... > >>  >>> myfun() > >> 'WOW' > > >> now, i would like to "list" the funcion definition, something like this: > > >>  >>> my

Re: recall function definition from shell

2010-05-18 Thread superpollo
Patrick Maupin ha scritto: On May 18, 1:41 pm, superpollo wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo wrote: >>> def myfun(): ... return "WOW" ... >>> myfun() 'WOW' now, i would like to "list" the funcion definition, something like this: >>> myfun.somethinglik

Re: recall function definition from shell

2010-05-18 Thread Peter Otten
superpollo wrote: > Patrick Maupin ha scritto: >> On May 18, 1:41 pm, superpollo wrote: >>> Patrick Maupin ha scritto: >>> >>> >>> On May 18, 12:31 pm, superpollo wrote: > >>> def myfun(): > ... return "WOW" > ... > >>> myfun() > 'WOW' > now, i would like to "l

Re: pickle unable to load collection

2010-05-18 Thread Peter Otten
Terry Reedy wrote: > Nice catch, Peter. I filed a request that the message quote the name it > cannot import, so that the OP would have seen the more informative > > ImportError: No module named 'collections\r' > > http://bugs.python.org/issue8754 Good idea; thank you for taking the initiative.

Re: recall function definition from shell

2010-05-18 Thread superpollo
Peter Otten ha scritto: superpollo wrote: Patrick Maupin ha scritto: On May 18, 1:41 pm, superpollo wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo wrote: >>> def myfun(): ... return "WOW" ... >>> myfun() 'WOW' now, i would like to "list" the funcion definition,

Re: recall function definition from shell

2010-05-18 Thread Ethan Furman
superpollo wrote: Patrick Maupin ha scritto: On May 18, 1:41 pm, superpollo wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo wrote: >>> def myfun(): ... return "WOW" ... >>> myfun() 'WOW' now, i would like to "list" the funcion definition, something like this: >

Re: recall function definition from shell

2010-05-18 Thread René 'Necoro' Neumann
Am 18.05.2010 20:55, schrieb superpollo: > > yes python does not, but maybe the *shell* does, or so i thought. i just > wanted to dump the code for the function in a file, after i tested in > the shell... You might want to have a look at the IPython shell [1]. I personally do not use it myself, b

Re: Picking a license

2010-05-18 Thread Ethan Furman
Ben Finney wrote: a...@pythoncraft.com (Aahz) writes: Ben Finney wrote: [It is impractical to] sell free software like selling loaves of bread, but that's a much more limited case and a far cry from your claim [that it's impractical to sell free software]. Selling free software is quite prac

Re: Is this an ok thing to do in a class

2010-05-18 Thread Vincent Davis
Thanks for the feed back Vincent On Tue, May 18, 2010 at 8:50 AM, Bruno Desthuilliers wrote: > Simon Brunning a écrit : > >> On 18 May 2010 06:21:32 UTC+1, Vincent Davis >> wrote: >> >>> Just wondering if there is a problem with mixing a dictionary into a >>> class like this. Everything seems

setting variables in pdb

2010-05-18 Thread Art
If I am in Pdb, I would like to set a temporary variable, for example: (Pdb) r = 1 The 'r' gets interpreted as 'return' by Pdb. Is there a Pdb instruction that guarantees the intended effect, like: (Pdb) let r = 1 I can usually avoid using such variable names, but if I am changing the value of

Re: Is this an ok thing to do in a class

2010-05-18 Thread Ethan Furman
Vincent Davis wrote: Just wondering if there is a problem with mixing a dictionary into a class like this. Everything seems to work as I would expect. class foo(object): def __init__(self, x): self.letter = dict(a=1,b=2,c=3) self.A=self.letter['a'] self.x=self.letter

Re: setting variables in pdb

2010-05-18 Thread John Posner
On 5/18/2010 4:15 PM, Art wrote: If I am in Pdb, I would like to set a temporary variable, for example: (Pdb) r = 1 The 'r' gets interpreted as 'return' by Pdb. Is there a Pdb instruction that guarantees the intended effect, like: (Pdb) let r = 1 I can usually avoid using such variable names

Re: setting variables in pdb

2010-05-18 Thread Duncan Booth
Art wrote: > If I am in Pdb, I would like to set a temporary variable, for example: > > (Pdb) r = 1 > > The 'r' gets interpreted as 'return' by Pdb. > > Is there a Pdb instruction that guarantees the intended effect, like: > > (Pdb) let r = 1 (Pdb) exec "r=1" -- http://mail.python.org/mailm

how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Vincent Davis
Lets say I have class foo(object): def __init__(self, x, y): self.x=x self.y=y def xplusy(self): self.xy = x+y inst = foo(1,2) inst.xy # no value, but I what this to cause the calculation of inst.xy I don't what to have self.xy calculated before it is called. T

Re: Is this an ok thing to do in a class

2010-05-18 Thread Vincent Davis
On Tue, May 18, 2010 at 2:41 PM, Ethan Furman wrote: > > Do you expect afoo.letter[x] to always be afoo.x? Because they aren't: > > >>> afoo.A = 9 > >>> afoo.letter['a'] > 1 > What you are pointing out is that the assignment is not reversed . But that does make me thing of something I had not.

Re: how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Chris Rebert
On Tue, May 18, 2010 at 1:39 PM, Vincent Davis wrote: > > Lets say I have > class foo(object): >     def __init__(self, x, y): >         self.x=x >         self.y=y >     def xplusy(self): >         self.xy = x+y > inst = foo(1,2) > inst.xy   # no value, but I what this to cause the calculation of

Re: Is this an ok thing to do in a class

2010-05-18 Thread Ethan Furman
Vincent Davis wrote: On Tue, May 18, 2010 at 2:41 PM, Ethan Furman > wrote: Do you expect afoo.letter[x] to always be afoo.x? Because they aren't: >>> afoo.A = 9 >>> afoo.letter['a'] 1 What you are pointing out is that the assignment is not revers

Re: how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Ethan Furman
Vincent Davis wrote: Lets say I have class foo(object): def __init__(self, x, y): self.x=x self.y=y def xplusy(self): self.xy = x+y ^ this needs to be self.x + self.y inst = foo(1,2) inst.xy # no value, but I what this to cause the calcul

Re: Is this an ok thing to do in a class

2010-05-18 Thread Vincent Davis
On Tue, May 18, 2010 at 3:15 PM, Ethan Furman wrote: > Vincent Davis wrote: > >> >> What you are pointing out is that the assignment is not reversed . But >> that does make me thing of something I had not. >> >> >>> afoo.letter['a'] = 345 >> >>> afoo.A >> 1 >> >> Thats kinda a bummer, whats a g

another question about classes and subclassing

2010-05-18 Thread Alex Hall
Hi again all, More about classes. I am still looking into my battleship game, and I will have several different craft. All craft have common attribs (position, alive, and so on) but each craft may be a surface ship, submarine, or airplane. All three are craft, but a submarine can be submerged or no

sound effects in python

2010-05-18 Thread Astan Chee
Hi, I have a sound file (e.g. .wav; .mp3, etc) in python that I'd like to modify (e.g. change tempo, pitch, add echo, amplify, etc). Any recommendation on how I can achieve this in python independent of platform? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: how to cause a request for a missing class attribute cause its calculation

2010-05-18 Thread Ethan Furman
Ethan Furman wrote: Vincent Davis wrote: Lets say I have class foo(object): def __init__(self, x, y): self.x=x self.y=y def xplusy(self): self.xy = x+y ^ this needs to be self.x + self.y inst = foo(1,2) inst.xy # no value, but I what this

Re: sound effects in python

2010-05-18 Thread Vincent Davis
There was a talk at pycon about this. Sounded interecting but I don't know much about it. http://us.pycon.org/2010/conference/schedule/event/136/ Vincent On Tue, May 18, 2010 at 4:05 PM, Astan Chee wrote: > Hi, > I have a sound file (e.g. .wav; .mp3, etc) in python that I'd like to > modify (e.

Re: Access to comp.lang.python

2010-05-18 Thread Tim Chase
On 05/15/2010 05:34 PM, cjw wrote: It seems that messages are coming from a number of sources, such as gmane and google groups. The problem is that many messages seem to get unlinked from their threads. I use Thunderbird 3.0.5 and wonder whether the problem lies with the merge process, the serv

Re: sound effects in python

2010-05-18 Thread technocake
On 19 Mai, 00:05, Astan Chee wrote: > Hi, > I have a sound file (e.g. .wav; .mp3, etc) in python that I'd like to > modify (e.g. change tempo, pitch, add echo, amplify, etc). > Any recommendation on how I can achieve this in python independent of > platform? > Thanks You could have a look on PyAu

Re: another question about classes and subclassing

2010-05-18 Thread Dave Angel
Alex Hall wrote: Hi again all, More about classes. I am still looking into my battleship game, and I will have several different craft. All craft have common attribs (position, alive, and so on) but each craft may be a surface ship, submarine, or airplane. All three are craft, but a submarine can

Re: another question about classes and subclassing

2010-05-18 Thread Alex Hall
Okay, that makes sense. So by calling submarine(craft) I am bringing in all of craft's attribs (subclassing)? Or does calling craft's __init__ method do that instead? Is there an advantage to doing it this way, rather than just making separate classes for everything, except for my own sense of orga

Re: upgrade python

2010-05-18 Thread Aahz
In article , packet wrote: > >Would it be safe to upgrade from python 2.6.4 to 2.6.5 without hurting >the 2.6.4? Define "hurting". Generally speaking, it's always safe to upgrade a point release, but you should replace the previous version. -- Aahz (a...@pythoncraft.com) <*>

Re: another question about classes and subclassing

2010-05-18 Thread Dave Angel
Alex Hall wrote: Okay, that makes sense. So by calling submarine(craft) I am bringing in all of craft's attribs (subclassing)? Or does calling craft's __init__ method do that instead? Is there an advantage to doing it this way, rather than just making separate classes for everything, except for m

Pointers on packaging python programs for installation on multiple platforms?

2010-05-18 Thread gobnat
Hi all I am trying to release my first python program. I would like to be able to create a download which will automatically do stuff like add menu items (eg for KDE, GNOME and Windows). Is there anywhere which explains how to do this? Thanks in advance Brendan -- http://mail.python.org/

Re: another question about classes and subclassing

2010-05-18 Thread Alex Hall
On 5/18/10, Dave Angel wrote: > Alex Hall wrote: >> Okay, that makes sense. So by calling submarine(craft) I am bringing >> in all of craft's attribs (subclassing)? Or does calling craft's >> __init__ method do that instead? Is there an advantage to doing it >> this way, rather than just making se

Re: Access to comp.lang.python

2010-05-18 Thread Terry Reedy
On 5/18/2010 7:27 PM, Tim Chase wrote: On 05/15/2010 05:34 PM, cjw wrote: It seems that messages are coming from a number of sources, such as gmane and google groups. The problem is that many messages seem to get unlinked from their threads. I use Thunderbird 3.0.5 and wonder whether the probl

Re: recall function definition from shell

2010-05-18 Thread Terry Reedy
On 5/18/2010 2:55 PM, superpollo wrote: yes python does not, but maybe the *shell* does, or so i thought. i just wanted to dump the code for the function in a file, after i tested in the shell... On Windows, you can tell the shell (command window) how many lines to remember. One can sensibly

Re: upgrade python

2010-05-18 Thread Terry Reedy
On 5/18/2010 9:47 PM, Aahz wrote: In article, packet wrote: Would it be safe to upgrade from python 2.6.4 to 2.6.5 without hurting the 2.6.4? Define "hurting". Generally speaking, it's always safe to upgrade a point release, but you should replace the previous version. The default action

Re: Picking a license

2010-05-18 Thread Ben Finney
This thread is already off-topic and too long. I'm conflicted about my role in that; I have endeavoured only to address falsehoods that IMO were not otherwise being addressed. So I'll try to keep this brief. Ethan Furman writes: > This doesn't make sense to me, but I'm willing to learn -- how d

Re: help need to write a python spell checker

2010-05-18 Thread Nigel Rowe
On Fri, 14 May 2010 18:19, harry k wrote in comp.lang.python <>: > Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary. > > > > Extend the spell-checking tool so that the program will also print out a list of possible correct spellings f

Re: help need to write a python spell checker

2010-05-18 Thread Steven D'Aprano
On Wed, 19 May 2010 13:01:10 +1000, Nigel Rowe wrote: > I'm happy to do you homework for you, cost is us$1000 per hour. Email > to your professor automatically on receipt. I'll do it for $700 an hour! -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Classes and threading

2010-05-18 Thread Adam W.
I thought I knew how classes worked, but this code sample is making my second guess myself: import threading class nThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self,args): print self.name print self.args pants = nThread(a

question on logging module

2010-05-18 Thread frank zhu
Hi, >From the python 2.6.4 tutorial, refer to http://docs.python.org/release/2.6.4/tutorial/stdlib2.html#logging The above example doesn't work for me. Here is script log # o...@oem-desktop ~ $ python -V Python 2.6.4 o...@oem-desktop ~ $ python Python

Re: Classes and threading

2010-05-18 Thread Erik Max Francis
Adam W. wrote: I thought I knew how classes worked, but this code sample is making my second guess myself: import threading class nThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self,args): print self.name print self.args

Re: help need to write a python spell checker

2010-05-18 Thread Patrick Maupin
On May 14, 3:19 am, "harry k" wrote: > Write a spell checking tool that will identify all misspelled word in a text > file using a provided dictionary. Well, this has been educational. Both my daughters just finished their final exams last week, so I was confused about seeing the homework assi

Re: help need to write a python spell checker

2010-05-18 Thread John Machin
On May 19, 1:37 pm, Steven D'Aprano wrote: > On Wed, 19 May 2010 13:01:10 +1000, Nigel Rowe wrote: > > I'm happy to do you homework for you, cost is us$1000 per hour.  Email > > to your professor automatically on receipt. > > I'll do it for $700 an hour! he could save the money if he oogledgay or

Re: question on logging module

2010-05-18 Thread Cameron Simpson
On 18May2010 23:42, frank zhu wrote: | Hi, | >From the python 2.6.4 tutorial, refer to | http://docs.python.org/release/2.6.4/tutorial/stdlib2.html#logging | | The above example doesn't work for me. | Here is script log | | # | | o...@oem-desktop ~ $

  1   2   >