Call for papers: SETP-10, USA, July 2010

2010-05-18 Thread James Heralds
It would be highly appreciated if you could share this announcement with your colleagues, students and individuals whose research is in software engineering, software testing, software quality assurance, software design and related areas. Call for papers: SETP-10, USA, July 2010 The 2010

Re: getting attributes and methods of class without creating object

2010-05-18 Thread shuvro
On May 18, 11:50 am, Patrick Maupin pmau...@gmail.com wrote: On May 17, 10:52 pm, shuvro shuvr...@gmail.com wrote: Suppose I have a class like this - class myClass(object):     def __init__(self):         self.a = 10         self.b = 20     def my_method(self,var = 20):        

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 ?xml version=1.0 encoding=UTF-8? opml version=1.0 head titleMy Podcasts/title dateCreatedSun, 07 Mar 2010 15:53:26 GMT/dateCreated dateModifiedSun, 07 Mar 2010 15:53:26 GMT/dateModified

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.6 (r26:66721,

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 jonvspyt...@gmail.comwrote: Hi, I'm trying to store frames received via serial port (using Pyserial) into a sqlite

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 10:18 am, shanti bhushan ershantibhus...@gmail.com wrote: I have a sample.XML file the code is like this ?xml version=1.0 encoding=UTF-8? opml version=1.0 head         titleMy Podcasts/title         dateCreatedSun, 07 Mar 2010 15:53:26 GMT/dateCreated         dateModifiedSun,

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 12:04 pm, Stefan Behnel stefan...@behnel.de wrote: shanti bhushan, 18.05.2010 07:18: I have a sample.XML file the code is like this ?xml version=1.0 encoding=UTF-8? opml version=1.0 head    titleMy Podcasts/title    dateCreatedSun, 07 Mar 2010 15:53:26

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 ?xml version=1.0 encoding=UTF-8? opml version=1.0 head titleMy Podcasts/title dateCreatedSun, 07 Mar 2010 15:53:26 GMT/dateCreated dateModifiedSun, 07 Mar 2010 15:53:26 GMT/dateModified

Re: url fetching from xml depending upon selection

2010-05-18 Thread shanti bhushan
On May 18, 12:04 pm, Stefan Behnel stefan...@behnel.de wrote: shanti bhushan, 18.05.2010 07:18: I have a sample.XML file the code is like this ?xml version=1.0 encoding=UTF-8? opml version=1.0 head    titleMy Podcasts/title    dateCreatedSun, 07 Mar 2010 15:53:26

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 Behnelstefan...@behnel.de wrote: shanti bhushan, 18.05.2010 07:18: [...] body TestCase name=Sprint_001 Input url=http://first.co.jp; / Input url=http://www.google.com; / Input

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 load a pickled object.

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Sat, 5/15/10, Ben Finney ben+pyt...@benfinney.id.au wrote: From: Ben Finney ben+pyt...@benfinney.id.au 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

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Sat, 5/15/10, Duncan Booth duncan.bo...@invalid.invalid wrote: From: Duncan Booth duncan.bo...@invalid.invalid Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 8:52 AM Ed Keith e_...@yahoo.com wrote: I can not imagine anyone being stupid

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 l...@geek-central.gen.new_zealand wrote: From: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 11:09 PM In message

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

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

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. --

Fw: Re: Re: joining files

2010-05-18 Thread mannu jha
Note: Forwarded message attached -- Original Message -- From: mannu jhamannu_0...@rediffmail.com To: tuomas.vesteri...@iki.fi Subject: Re: Re: joining files---BeginMessage--- 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 st...@remove-this-cybersource.com.au 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 =

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 vinc...@vincentdavis.net 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. --

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 This is

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 pengyu...@gmail.com wrote: On May 17, 6:38 pm, a...@pythoncraft.com (Aahz) wrote: In article mailman.323.1274135213.32709.python-l...@python.org, Peng Yu  pengyu...@gmail.com wrote: I compiled python2.6.4 from source. But I can't find _sqlite3.so in

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 does :

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.6

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 backgoo...@gmail.com 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: Regular expression

2010-05-18 Thread Back9
On May 18, 10:09 am, ilvecchio terenzio.be...@gmail.com wrote: On May 18, 3:48 pm, Back9 backgoo...@gmail.com 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.

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 backgoo...@gmail.com wrote: On May 18, 10:09 am, ilvecchio terenzio.be...@gmail.com wrote: On May 18, 3:48 pm, Back9 backgoo...@gmail.com wrote:  Hi, I have a string like this: 0x340x5A0x9B0xBA I want to extract 0x from the string but the first one.

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 case?

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

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 vinc...@vincentdavis.net 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

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 class.

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 to do

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

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 error

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

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'Oliveirol...@geek-central.gen.new_zealand wrote: From: Lawrence D'Oliveirol...@geek-central.gen.new_zealand Subject: Re: Picking a license To: python-list@python.org Date: Saturday, May 15, 2010, 11:09 PM In

Re: Multi-Threading in Python

2010-05-18 Thread geremy condra
On Tue, May 18, 2010 at 7:35 AM, Lou louro...@gmail.com 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

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

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

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

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: http://docs.python.org/library/multiprocessing.html I did a Multiprocessing presentation recently:

Re: Picking a license

2010-05-18 Thread Ed Keith
--- On Tue, 5/18/10, Robert Kern robert.k...@gmail.com wrote: From: Robert Kern robert.k...@gmail.com 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

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:

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 There is

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 wrote:

Re: Picking a license

2010-05-18 Thread Patrick Maupin
On May 18, 11:03 am, Robert Kern robert.k...@gmail.com 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

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

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-list

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 ute...@esempio.net 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 like this around?

Re: recall function definition from shell

2010-05-18 Thread superpollo
Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net 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 ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net 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 superpollo
Patrick Maupin ha scritto: On May 18, 1:41 pm, superpollo ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to list the funcion definition, something like

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 ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to list the funcion

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 ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to

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 ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to list the funcion

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, but

Re: Picking a license

2010-05-18 Thread Ethan Furman
Ben Finney wrote: a...@pythoncraft.com (Aahz) writes: Ben Finney ben+pyt...@benfinney.id.au 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

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 bruno.42.desthuilli...@websiteburo.invalid wrote: Simon Brunning a écrit : On 18 May 2010 06:21:32 UTC+1, Vincent Davis vinc...@vincentdavis.net wrote: Just wondering if there is a problem with mixing a

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

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']

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

Re: setting variables in pdb

2010-05-18 Thread Duncan Booth
Art grenan...@gmail.com 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 --

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.

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 et...@stoneleaf.us 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

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 vinc...@vincentdavis.net 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

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 et...@stoneleaf.us mailto:et...@stoneleaf.us 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

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

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 et...@stoneleaf.us 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 good way

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

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

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 astan.c...@al.com.au wrote: Hi, I have a sound file (e.g. .wav; .mp3, etc) in python that I'd

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

Re: sound effects in python

2010-05-18 Thread technocake
On 19 Mai, 00:05, Astan Chee astan.c...@al.com.au 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

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

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

Re: upgrade python

2010-05-18 Thread Aahz
In article mailman.367.1274206734.32709.python-l...@python.org, packet fasteliteprogram...@gmail.com 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

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

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 --

Re: another question about classes and subclassing

2010-05-18 Thread Alex Hall
On 5/18/10, Dave Angel da...@ieee.org 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

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

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 articlemailman.367.1274206734.32709.python-l...@python.org, packetfasteliteprogram...@gmail.com 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

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 et...@stoneleaf.us writes: This doesn't make sense to me, but I'm willing

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 mailman.205.1273907726.32709.python-l...@python.org: Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary. snip/ Extend the spell-checking tool so that the program will

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 =

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 hkiri...@yahoo.com.au 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

  1   2   3   >