ANN: SfePy 2009.2

2009-05-13 Thread Robert Cimrman
I am pleased to announce the release of SfePy 2009.2. SfePy (simple finite elements in Python) is a software, distributed under the BSD license, for solving systems of coupled partial differential equations by the finite element method. The code is based on NumPy and SciPy packages. Mailing

ANN Chicago Python User Group May Meeting This Thursday

2009-05-13 Thread Brian Ray
Chicago Python User Group = Calling all Python Programmers in (or near enough) the Windy City!!! (and JAVA Programmers, and those into REST, too) We are having the highest meeting yet!! 25th floor! May 14, 2009 at ThoughtWorks Inc. 200 E Randolph St 25th Floor

Regular Toronto Python Users' Group (PyGTA) meeting Tuesday 19th, 7:15pm

2009-05-13 Thread Mike C. Fletcher
We will be having our regular PyGTA meeting at our regular time (7:15 on the 19th) and place (Linux Caffe) this month. Please note that *next* month (June 2009) we'll be meeting on the 17th (a Wednesday) as our speaker for June is not available on Tuesdays. Linux Caffe is at the corner of Grace

Re: py2exe + win32com + DAO

2009-05-13 Thread David Lyon
On Tue, 12 May 2009 22:06:42 -0700 (PDT), Trevor trevor.la...@gmail.com wrote: I do not believe your assertion applies to the following line of code: daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36') It doesn't. I'm simply suggesting that it is possible you are opening the database in

Updates to enviironment variables and ctypes

2009-05-13 Thread Scott Flynn
I was hoping I could update LD_LIBRARY_PATH at runtime and load a library through ctypes from there, but I haven't been able to. I've tried all of these. os.environ['LD_LIBRARY_PATH'] = ./lib os.putenv('LD_LIBRARY_PATH', ./lib) os.system(export LD_LIBRARY_PATH=./lib) lib = CDLL(libevaluator.so)

Re: Representing a Tree in Python

2009-05-13 Thread godshorse
On May 13, 11:54 am, CTO debat...@gmail.com wrote: On May 13, 12:10 am, godshorse chinthak...@gmail.com wrote: Hello, I want to find out the shortest path tree from a root to several nodes in a graph data structure. I found a Dijkstra code from internet that finds shortest path between

Re: New to python, can i ask for a little help?

2009-05-13 Thread guang . zeng37
On May 13, 12:18 pm, warhammer1...@gmail.com warhammer1...@gmail.com wrote: I loaded python 3.1 I can use the gui and i see the following: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. It

Re: Representing a Tree in Python

2009-05-13 Thread CTO
But let me clear the my problem again. I have a graph. and I want to find 'shortest path tree' from a root node to several nodes. as a example if we have a graph of 5 nodes from 1 to 5, I need to build the shortest path tree from node 1 to nodes 2,3,5. So my question is instead of keeping

Help needed to resolve ImportError

2009-05-13 Thread Venkat Raju
Hi, We currently use VC6.0 and Python 2.2 for our project. As part of porting our project to VC2005 when i try to compile our application, it gives the following error Traceback (most recent call last): File

Re: How to build Python 2.6.2 on HP-UX Itanium with thread support?

2009-05-13 Thread henning . vonbargen
New info: The problem is not related to the specific program - it is definitely a build problem, as the following test shows: Python 2.6.2 (r262:71600, Apr 28 2009, 17:38:15) [GCC 4.2.3] on hp-ux11 Type help, copyright, credits or license for more information. import threading threading._test()

python script as service

2009-05-13 Thread prakash jp
Hi all, could any one tell how to run a python script as a scheduled service(say every one minute). I tried out the windows registration method but encountered an error . The error reads: The 'script name' on local Computer started and then stopped. Some services stop automatically if they

Re: Representing a Tree in Python

2009-05-13 Thread Jaime Fernandez del Rio
Dijkstra's algorithm computes shortest paths between a node and _ALL_ other nodes in the graph. It is usually stopped once computing the shortest path to the target node is done, but that's simply for efficiency, not a limitation of the algorithm. So you should be able to tweak the code you are

Re: What's the use of the else in try/except/else?

2009-05-13 Thread Lawrence D'Oliveiro
In message pan.2009.05.12.09.35...@remove.this.cybersource.com.au, Steven D'Aprano wrote: On Tue, 12 May 2009 09:20:36 +, Steven D'Aprano wrote: It seems pretty straightforward to me. Except of course such a pattern won't work ... I rest my case. --

Re: Nimrod programming language

2009-05-13 Thread Martin Vilcans
On Tue, May 12, 2009 at 3:10 PM, rump...@web.de wrote: You can certainly have a string type that uses byte arrays in UTF-8 encoding internally, but your string functions should be aware of that and treat it as a unicode string. The len function and index operators should count characters, not

Re: Representing a Tree in Python

2009-05-13 Thread godshorse
On May 13, 3:19 pm, Jaime Fernandez del Rio jaime.f...@gmail.com wrote: Dijkstra's algorithm computes shortest paths between a node and _ALL_ other nodes in the graph. It is usually stopped once computing the shortest path to the target node is done, but that's simply for efficiency, not a

Re: Convert UNIX formated text files to DOS formated?

2009-05-13 Thread David Robinow
On Tue, May 12, 2009 at 11:47 PM, walterbyrd walterb...@iname.com wrote: On May 12, 6:15 pm, norseman norse...@hughes.net wrote: Subject line says UNIX to DOS I hope that means you are using a UNIX machine. I should have mentioned, I am working in an environment that is very restrictive

(Winows) Finding out which process has locked a file.

2009-05-13 Thread CinnamonDonkey
Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by another process. When this happens I want it to

Re: python script as service

2009-05-13 Thread David Lyon
On XP, go to Start Menu/All Programs/Accessories/System Tools/Scheduled Tasks Add your program in with the scheduled task wizard... On Wed, 13 May 2009 13:10:25 +0530, prakash jp prakash.st...@gmail.com wrote: Hi all, could any one tell how to run a python script as a scheduled service(say

PythonCard - My app stuck when button clicked

2009-05-13 Thread daved170
Hi there, I'm newbie in pythonCard. I have an application with 2 buttons : START , STOP Start execute a while(1) loop that execute my calculations. Stop suppose to raise a flag that will end that loop. Whenever I pish the START button my GUI is stuck. the calculation executes but I can't push the

about Python doc reader

2009-05-13 Thread Shailja Gulati
Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? Thanks and regards, Shailja =-=-= Notice: The information contained in

json vs. simplejson

2009-05-13 Thread Thomas Heller
Python 2.6 contains the json module, which I thought was the renamed (and improved?) simplejson module that also works on older Python versions. However, it seems the json is a lot slower than simplejson. This little test, run on Python 2.6.2 and WinXP shows a dramatic difference: C:\py26 -m

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread Thomas Heller
David Lyon schrieb: On Wed, 13 May 2009 05:32:16 +0200, Martin v. Löwis mar...@v.loewis.de wrote: I think this was a case of obscure misconfiguration of the system. It is always possible to configure a system in such a way that even the most resilient installation procedure will break.

Re: json vs. simplejson

2009-05-13 Thread Diez B. Roggisch
Thomas Heller wrote: Python 2.6 contains the json module, which I thought was the renamed (and improved?) simplejson module that also works on older Python versions. However, it seems the json is a lot slower than simplejson. This little test, run on Python 2.6.2 and WinXP shows a dramatic

Re: Representing a Tree in Python

2009-05-13 Thread bearophileHUGS
godshorse, you may use the shortestPaths method of this graph class of mine: http://sourceforge.net/projects/pynetwork/ (It uses the same Dijkstra code by Eppstein). (Once you have all distances from a node to the other ones, it's not too much difficult to find the tree you talk about). Also see

Re: json vs. simplejson

2009-05-13 Thread Thomas Heller
Diez B. Roggisch schrieb: Thomas Heller wrote: Python 2.6 contains the json module, which I thought was the renamed (and improved?) simplejson module that also works on older Python versions. However, it seems the json is a lot slower than simplejson. This little test, run on Python 2.6.2

Re: about Python doc reader

2009-05-13 Thread Kushal Kumaran
On Wed, May 13, 2009 at 4:28 PM, Shailja Gulati shailja.gul...@tcs.com wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you're

urllib2 slow for multiple requests

2009-05-13 Thread Tomas Svarovsky
Hello everybody, really new to python, so bear with me. I am trying to do some very basic scraping tool. Bascally it just grabs a page xy times and tells me how long it took. When I do this once, it is blazingly fast, but when I increase the number of repetitions, it is slowing down considerably

Re: about Python doc reader

2009-05-13 Thread Tim Golden
Shailja Gulati wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you haven't already, get hold of the pywin32 extensions:

Re: Updates to enviironment variables and ctypes

2009-05-13 Thread Dave Angel
Scott Flynn wrote: I was hoping I could update LD_LIBRARY_PATH at runtime and load a library through ctypes from there, but I haven't been able to. I've tried all of these. os.environ['LD_LIBRARY_PATH'] = ./lib os.putenv('LD_LIBRARY_PATH', ./lib) os.system(export LD_LIBRARY_PATH=./lib) lib =

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread David Lyon
On Wed, 13 May 2009 13:54:49 +0200, Thomas Heller thel...@python.net Well, if you don't like the windows installer than you can always install from the sources. Please go ahead and try it out. Thanks for the offer... but aren't python .eggs supposed to remove the need for doing that ?

Re: (Winows) Finding out which process has locked a file.

2009-05-13 Thread Emile van Sebille
On 5/13/2009 2:20 AM CinnamonDonkey said... Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by

Re: (Winows) Finding out which process has locked a file.

2009-05-13 Thread Tim Golden
CinnamonDonkey wrote: Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by another process. When

Re: How to build Python 2.6.2 on HP-UX Itanium with thread support?

2009-05-13 Thread Aahz
In article 51d1dd3f-322d-47fa-9d44-75b92c6ef...@e20g2000vbc.googlegroups.com, henning.vonbar...@arcor.de wrote: New info: The problem is not related to the specific program - it is definitely a build problem, as the following test shows: Python 2.6.2 (r262:71600, Apr 28 2009, 17:38:15) [GCC

Re: Convert UNIX formated text files to DOS formated?

2009-05-13 Thread walterbyrd
On May 13, 3:21 am, David Robinow drobi...@gmail.com wrote: cygwin has u2d and d2u- Hide quoted text - Thank you, I did not know about those utilities, until now. -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonCard - My app stuck when button clicked

2009-05-13 Thread Adam Gaskins
I second this. I am very interested in PyCard having just discovered it in your message here. I know I'll run in to this same problem in my application that will run test routines that must have a mechanism to abort. Sorry for the lack of any help here... -Adam daved170 daved...@gmail.com

Re: urllib2 slow for multiple requests

2009-05-13 Thread cgoldberg
Bascally it just grabs a page xy times and tells me how long it took. you aren't doing a read(), so technically you are just connecting to the web server and sending the request but never reading the content back from the socket. So your timing wouldn't be accurate. try this instead: response

spam

2009-05-13 Thread MadHatter7
spam -- http://mail.python.org/mailman/listinfo/python-list

Re: Call Web Service using proxy and http authentication

2009-05-13 Thread Steve Howell
On May 12, 12:51 pm, wdveloper tot...@gmail.com wrote: On May 12, 8:38 pm, Steve Howell showel...@yahoo.com wrote: On May 12, 8:59 am, wdveloper tot...@gmail.com wrote: Hi everyone, I am trying to call a webservice which requires an http authentication. To reach the ws, I must

Can't run PyQt apps with MacPython

2009-05-13 Thread Morad
I recently got a new MacBook Pro with Leopard, and would like to develop using Python and PyQt. I installed the latest Qt SDK, updated MacPython to V 2.5.4 and then proceeded to install SIP and PyQt as described in Mark Summerfield's book on PyQt Programming. Everything went fine and none of the

DOM implementation

2009-05-13 Thread Emanuele D'Arrigo
Hi everybody, I just spent the past hour or so trying to have a better understanding of how the various DOM-supporting libraries (xml.dom, xml.dom.minidom) work. I've used etree and lxml successfully before but I wanted to understand how close I can get to the W3C DOM standards. Ok, I think more

Re: php to python code converter

2009-05-13 Thread bvidinli
i designed php to python converter a few monthos ago, to translate some of my ready made code snippets to python. i was experienced with php and was learning python. as stated on project home, it is only intended for translating small code snippets or small functions to python. whole

n00b question: Possible to pass lists to a Template class?

2009-05-13 Thread Wells
Is it possible to pass a list to the Template.substitute method and use that in the template, like so.. g = string.Template(gametemplate) print g.substitute(recap = none, winner = game[winner], loser = game[loser]) Then in the template... bwinner.team Where winner.team would be the value of

Re: n00b question: Possible to pass lists to a Template class?

2009-05-13 Thread Wells
On May 13, 11:14 am, Wells we...@submute.net wrote: Is it possible to pass a list to the Template.substitute method and use that in the template, like so.. g = string.Template(gametemplate) print g.substitute(recap = none, winner = game[winner], loser = game[loser]) Then in the template...

Re: (Winows) Finding out which process has locked a file.

2009-05-13 Thread Dave Angel
CinnamonDonkey wrote: Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by another process. When

Re: DOM implementation

2009-05-13 Thread Paul Boddie
On 13 Mai, 18:08, Emanuele D'Arrigo man...@gmail.com wrote: I just spent the past hour or so trying to have a better understanding of how the various DOM-supporting libraries (xml.dom, xml.dom.minidom) work. I've used etree and lxml successfully before but I wanted to understand how close I

How to see the code definiton in the shell ?

2009-05-13 Thread Mohan Parthasarathy
Hi, I am new to Python. I tried searching this but could not find an answer. In the interactive shell, I write a new function and I want to be able to see all the code that I wrote at a later time. Just typing the function name only shows allmethods function allmethods at 0x822b0 How do I see

Re: How to see the code definiton in the shell ?

2009-05-13 Thread Matias Surdi
Mohan Parthasarathy escribió: Hi, I am new to Python. I tried searching this but could not find an answer. In the interactive shell, I write a new function and I want to be able to see all the code that I wrote at a later time. Just typing the function name only shows allmethods function

Re: How to see the code definiton in the shell ?

2009-05-13 Thread J. Cliff Dyer
On Wed, 2009-05-13 at 09:40 -0700, Mohan Parthasarathy wrote: Hi, I am new to Python. I tried searching this but could not find an answer. In the interactive shell, I write a new function and I want to be able to see all the code that I wrote at a later time. Just typing the function name

Re: PythonCard - My app stuck when button clicked

2009-05-13 Thread Dave Angel
daved170 wrote: Hi there, I'm newbie in pythonCard. I have an application with 2 buttons : START , STOP Start execute a while(1) loop that execute my calculations. Stop suppose to raise a flag that will end that loop. Whenever I pish the START button my GUI is stuck. the calculation executes

Re: What's the use of the else in try/except/else?

2009-05-13 Thread Scott David Daniels
greg wrote: kj wrote: Wow. As rationales for syntax constructs go, this has got to be the most subtle one I've ever seen... It's to avoid masking bugs. Suppose you accidentally wrote try: v = mumble.field sys.warming('field was actually there?') except AttributeError: pass

Re: json vs. simplejson

2009-05-13 Thread Ned Deily
In article 76vs9tf1f6c5...@mid.individual.net, Thomas Heller thel...@python.net wrote: Diez B. Roggisch schrieb: Thomas Heller wrote: Python 2.6 contains the json module, which I thought was the renamed (and improved?) simplejson module that also works on older Python versions.

Re: Representing a Tree in Python

2009-05-13 Thread Piet van Oostrum
godshorse chinthak...@gmail.com (g) wrote: g Hello, g I want to find out the shortest path tree from a root to several nodes g in a graph data structure. I found a Dijkstra code from internet that g finds shortest path between only two nodes. How can i extend it to a g tree?. And what is the

get detail about latest computer

2009-05-13 Thread adnan ji
its for you get about latest computer laptop free more visit www.glu007.blog.com -- http://mail.python.org/mailman/listinfo/python-list

Re: json vs. simplejson

2009-05-13 Thread Thomas Heller
Ned Deily schrieb: In article 76vs9tf1f6c5...@mid.individual.net, Thomas Heller thel...@python.net wrote: Diez B. Roggisch schrieb: Thomas Heller wrote: Python 2.6 contains the json module, which I thought was the renamed (and improved?) simplejson module that also works on older Python

Re: Representing a Tree in Python

2009-05-13 Thread CTO
On May 13, 8:19 am, bearophileh...@lycos.com wrote: godshorse, you may use the shortestPaths method of this graph class of mine:http://sourceforge.net/projects/pynetwork/ (It uses the same Dijkstra code by Eppstein). (Once you have all distances from a node to the other ones, it's not too

Re: How to build Python 2.6.2 on HP-UX Itanium with thread support?

2009-05-13 Thread ajaksu
henning.vonbar wrote: Traceback (most recent call last):   File stdin, line 1, in module   File /usr/local/lib/python2.6/threading.py, line 952, in _test     t.start()   File /usr/local/lib/python2.6/threading.py, line 471, in start     _start_new_thread(self.__bootstrap, ()) thread.error:

x.abc vs x['abc']

2009-05-13 Thread Gunter Henriksen
Presuming it is very common to have objects created on the fly using some sort of external data definitions, is there an obvious common standard way to take a dict object and create an object whose attribute names are the keys from the dict? I realize I can do something like: d = {hello: world}

Re: x.abc vs x['abc']

2009-05-13 Thread Christian Heimes
Gunter Henriksen wrote: but that seems like an arcane way to do something which would ideally be transparent... if there is a function in the standard library, that would be good, even if I have to import it. I guess there is collections.namedtuple... that would not look much prettier...

Re: x.abc vs x['abc']

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 1:00 PM, Christian Heimes li...@cheimes.de wrote: Gunter Henriksen wrote: but that seems like an arcane way to do something which would ideally be transparent... if there is a function in the standard library, that would be good, even if I have to import it.  I guess

Re: about Python doc reader

2009-05-13 Thread norseman
Kushal Kumaran wrote: On Wed, May 13, 2009 at 4:28 PM, Shailja Gulati shailja.gul...@tcs.com wrote: Hi , I am currently working on Information retrieval from semi structured Documents in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word

Re: New to python, can i ask for a little help?

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 12:22 PM, warhammer1...@gmail.com warhammer1...@gmail.com wrote: On May 12, 9:27 pm, Chris Rebert c...@rebertia.com wrote: On Tue, May 12, 2009 at 9:18 PM, warhammer1...@gmail.com warhammer1...@gmail.com wrote: I loaded python 3.1 I can use the gui and i see the

Re: about Python doc reader

2009-05-13 Thread norseman
not partial when it comes to automating. Today is: 20090513 Steve -- http://mail.python.org/mailman/listinfo/python-list

Odd list behavior

2009-05-13 Thread Evan Kroske
I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0] Error! However, I can slice the list like normal, but that gives me a one-element-long list:

How to get all named args in a dict?

2009-05-13 Thread kj
Suppose I have the following: def foo(x=None, y=None, z=None): d = {x: x, y: y, z: z} return bar(d) I.e. foo takes a whole bunch of named arguments and ends up calling a function bar that takes a single dictionary as argument, and this dictionary has the same keys as in foo's

Re: How to get all named args in a dict?

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 2:50 PM, kj so...@987jk.com.invalid wrote: Suppose I have the following: def foo(x=None, y=None, z=None):    d = {x: x, y: y, z: z}    return bar(d) I.e. foo takes a whole bunch of named arguments and ends up calling a function bar that takes a single dictionary

Re: about Python doc reader

2009-05-13 Thread norseman
, whatever - I'm not partial when it comes to automating. Today is: 20090513 Steve Interesting: I did try these. Doc at once: outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A' x'0D' x'0A' to end of file even though source file itself has no EOL

Re: Odd list behavior

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 2:51 PM, Evan Kroske e.kro...@gmail.com wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0] Error! However, I can

Re: Odd list behavior

2009-05-13 Thread norseman
Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0] Error! However, I can slice the list like normal, but that gives me a

Re: n00b question: Possible to pass lists to a Template class?

2009-05-13 Thread Rhodri James
On Wed, 13 May 2009 17:22:32 +0100, Wells we...@submute.net wrote: On May 13, 11:14 am, Wells we...@submute.net wrote: Is it possible to pass a list to the Template.substitute method and use that in the template, like so.. g = string.Template(gametemplate) print g.substitute(recap = none,

Re: Odd list behavior

2009-05-13 Thread Rhodri James
On Wed, 13 May 2009 23:08:26 +0100, norseman norse...@hughes.net wrote: Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0]

Re: Odd list behavior

2009-05-13 Thread Emile van Sebille
On 5/13/2009 2:51 PM Evan Kroske said... I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, What value of string gives these results? Emile I get an error: key = string.split()[0]

Re: Odd list behavior

2009-05-13 Thread Peter Otten
Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm splitting from a string, I get an error: key = string.split()[0] Error! When string contains only whitespace string.split() returns an empty

When *don't* I use 'self' in classes?

2009-05-13 Thread Adam Gaskins
I am a bit confused as too when, if ever, it is not appropriate to prepend 'self' to objects in a class. All of the examples of how to use 'self' that I find seem to be short and very simple (as examples tent to be). I appologize if I am asking an ignorant question here, but I want to get off

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread Mark Hammond
On 13/05/2009 2:18 PM, David Lyon wrote: On Wed, 13 May 2009 05:32:16 +0200, Martin v. Löwismar...@v.loewis.de wrote: I think this was a case of obscure misconfiguration of the system. It is always possible to configure a system in such a way that even the most resilient installation procedure

Re: How to get all named args in a dict?

2009-05-13 Thread Terry Reedy
kj wrote: Suppose I have the following: def foo(x=None, y=None, z=None): d = {x: x, y: y, z: z} return bar(d) I.e. foo takes a whole bunch of named arguments and ends up calling a function bar that takes a single dictionary as argument, and this dictionary has the same keys as in

Re: sqlite single transaction without foreign key or triggers

2009-05-13 Thread Rob Williscroft
John Machin wrote in news:b722bd36-c8f1-4cdf-8625-2550cee21511 @i28g2000prd.googlegroups.com in comp.lang.python: On May 13, 11:46 am, a...@pythoncraft.com (Aahz) wrote: In article xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft  r...@freenet.co.uk wrote: Aahz wrote

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread Rhodri James
On Wed, 13 May 2009 23:36:07 +0100, Adam Gaskins agaskins...@kelleramerica.com wrote: I am a bit confused as too when, if ever, it is not appropriate to prepend 'self' to objects in a class. All of the examples of how to use 'self' that I find seem to be short and very simple (as examples

Re: n00b question: Possible to pass lists to a Template class?

2009-05-13 Thread MRAB
Rhodri James wrote: On Wed, 13 May 2009 17:22:32 +0100, Wells we...@submute.net wrote: On May 13, 11:14 am, Wells we...@submute.net wrote: Is it possible to pass a list to the Template.substitute method and use that in the template, like so.. g = string.Template(gametemplate) print

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread MRAB
Adam Gaskins wrote: I am a bit confused as too when, if ever, it is not appropriate to prepend 'self' to objects in a class. All of the examples of how to use 'self' that I find seem to be short and very simple (as examples tent to be). I appologize if I am asking an ignorant question here,

Re: How to see the code definiton in the shell ?

2009-05-13 Thread CTO
On May 13, 1:26 pm, J. Cliff Dyer j...@sdf.lonestar.org wrote: On Wed, 2009-05-13 at 09:40 -0700, Mohan Parthasarathy wrote: Hi, I am new to Python. I tried searching this but could not find an answer. In the interactive shell, I write a new function and I want to be able to see all the

Re: Can't run PyQt apps with MacPython

2009-05-13 Thread David Boddie
On Wednesday 13 May 2009 17:53, Morad wrote: I recently got a new MacBook Pro with Leopard, and would like to develop using Python and PyQt. I installed the latest Qt SDK, updated MacPython to V 2.5.4 and then proceeded to install SIP and PyQt as described in Mark Summerfield's book on PyQt

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread Tim Chase
Adam Gaskins wrote: I am a bit confused as too when, if ever, it is not appropriate to prepend 'self' to objects in a class. All of the examples of how to use 'self' that I find seem to be short and very simple (as examples tent to be). I appologize if I am asking an ignorant question here,

Re: sqlite single transaction without foreign key or triggers

2009-05-13 Thread John Machin
On 14/05/2009 8:21 AM, Rob Williscroft wrote in private e-mail (presumably by mistake): On 13 May 2009, you wrote in comp.lang.python: On May 13, 11:46燼m, a...@pythoncraft.com (Aahz) wrote: In article xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk

Re: What's the use of the else in try/except/else?

2009-05-13 Thread Steven D'Aprano
On Wed, 13 May 2009 20:44:27 +1200, Lawrence D'Oliveiro wrote: In message pan.2009.05.12.09.35...@remove.this.cybersource.com.au, Steven D'Aprano wrote: On Tue, 12 May 2009 09:20:36 +, Steven D'Aprano wrote: It seems pretty straightforward to me. Except of course such a pattern

Re: mod_python and xml.dom.minidom

2009-05-13 Thread Graham Dumpleton
On May 12, 1:59 am, dpapathanasiou denis.papathanas...@gmail.com wrote: For the record, and in case anyone else runs into this particular problem, here's how resolved it. My original xml_utils.py was written this way: from xml.dom import minidom def parse_item_attribute (item,

Extract EPS info?

2009-05-13 Thread jyoung79
Just curious if Python has a built-in module for pulling data out of an EPS file? For example, I'd like to pull the text out of an EPS as well as the font names of the characters of the text. I believe I can pull all the font names from the header area, but was hoping Python might have

Proposal to Add New Method to List Object: Mutable Sequence Types

2009-05-13 Thread VenkataRamaKrishna Boddu
Hi All, This is my first mail to python-list. I just want to propose the idea of introducing a new method for the List Object in similar lines of Dictionary Object has_key method. See my below code, It always produces the ValueError, if I want to check whether an item is present or not, then

Re: Proposal to Add New Method to List Object: Mutable Sequence Types

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 1:55 AM, VenkataRamaKrishna Boddu bvrkchowd...@yahoo.co.in wrote: Hi All, This is my first mail to python-list. I just want to propose the idea of introducing a new method for the List Object in similar lines of Dictionary Object has_key method. has_key has been

please help with python program

2009-05-13 Thread chedderslam
I am trying to use Album Cover Art Downloader, software someone recommended to me. It works fine on my work computer, but not at home. When I try to save the cover art, I get this error: Traceback (most recent call last): File lib/albumart\albumart_dialog.py, line 623, in setCoverForItems

Re: please help with python program

2009-05-13 Thread Steven D'Aprano
On Wed, 13 May 2009 20:39:04 -0700, chedderslam wrote: IOError: [Errno 13] Permission denied: u'D:/My Music/Ani DiFranco/ Canon/Disc 1\\folder.jpg' I have removed the read-only attribute on the folder, and added Everyone with full control for security. Not sure what else to do. I would

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread CM
On May 13, 6:36 pm, Adam Gaskins agaskins...@kelleramerica.com wrote: I am a bit confused as too when, if ever, it is not appropriate to prepend 'self' to objects in a class. All of the examples of how to use 'self' that I find seem to be short and very simple (as examples tent to be). I

Distributed locking

2009-05-13 Thread James
Hey all, I'm looking for suggestions on how to tackle distributed locking across several Python programs on several different machines. - the objects to be locked are uniquely identified by an integer - I need one at a time semantics for the lock: zero or one read- writer at any point - the

Assigning multiple variables to a list a la php's list()

2009-05-13 Thread Wells
Can you take a list and have it exploded into variables w/ one command? Something like.. list = ['foo', 'bar'] [a, b] = list Then 'a' would be foo and 'b' 'bar'. Like list($a,$b) = $list in PHP. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning multiple variables to a list a la php's list()

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 9:17 PM, Wells we...@submute.net wrote: Can you take a list and have it exploded into variables w/ one command? Something like.. list = ['foo', 'bar'] [a, b] = list Then 'a' would be foo and 'b' 'bar'. Did you think to try it at the interpreter? That exact syntax

Re: What's the use of the else in try/except/else?

2009-05-13 Thread ma
A really great use for try/except/else would be if an object is implementing its own __getitem__ method, so you would have something like this: class SomeObj(object): def __getitem__(self, key): try: #sometype of assertion here based on key type

Re: What's the use of the else in try/except/else?

2009-05-13 Thread Steven D'Aprano
On Thu, 14 May 2009 00:39:35 -0400, ma wrote: A really great use for try/except/else would be if an object is implementing its own __getitem__ method, so you would have something like this: class SomeObj(object): def __getitem__(self, key): try:

Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread David Lyon
On Thu, 14 May 2009 08:33:12 +1000, Mark Hammond skippy.hamm...@gmail.com wrote: But if PYTHONPATH was set incorrectly it really doesn't matter how Python was installed, it would still fail. The installer didn't set PYTHONPATH, a human did. Hi Mark, Well I am just trying to write a

Re: What's the use of the else in try/except/else?

2009-05-13 Thread ma
That's great to know! Thanks for that explanation, I am refactoring something and I was going to make ample use of assertion as I thought it was the same as C's assertion without the NDEBUG flag. On Thu, May 14, 2009 at 1:03 AM, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On

[issue4660] multiprocessing.JoinableQueue task_done() issue

2009-05-13 Thread Alvaro
Changes by Alvaro al...@ifca.unican.es: -- nosy: +aloga ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4660 ___ ___ Python-bugs-list mailing list

[issue2813] No float formatting in PyString_FromFormat

2009-05-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I also think it would be good to use PyOS_double_to_string here. That does make it impossible to format long doubles, though, except by doing a possibly lossy conversion to double first. As far as I can see, Python doesn't use long double

  1   2   >