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 wrote: > On Thu, 14 May 2009 00:39:35 -0400, ma wro

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 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 package manager for python b

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: 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: 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 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 works, thou

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

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 oper

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

2009-05-13 Thread CM
On May 13, 6:36 pm, "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

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

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: 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 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 removed in Python 3.0;

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 t

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 something

Re: mod_python and xml.dom.minidom

2009-05-13 Thread Graham Dumpleton
On May 12, 1:59 am, dpapathanasiou 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, attribute_name): >     item_doc =

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 , > 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. Gosh, wi

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 , Rob Williscroft wrote: Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.py

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

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 PyQ

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

2009-05-13 Thread CTO
On May 13, 1:26 pm, "J. Cliff Dyer" 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 code that

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

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 wrote: On May 13, 11:14 am, Wells 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["

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

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 , >> Rob Williscroft   wrote: >> >> >> >> >Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.python: >

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: 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öwis" 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. Te

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 o

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

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

Re: Odd list behavior

2009-05-13 Thread Rhodri James
On Wed, 13 May 2009 23:08:26 +0100, norseman 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] Error! However, I can

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 wrote: On May 13, 11:14 am, Wells 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 = gam

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

Re: Odd list behavior

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 2:51 PM, 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 lis

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

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 sign

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

Re: about Python doc reader

2009-05-13 Thread norseman
t chance I get. Word, swriter, 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'

Re: about Python doc reader

2009-05-13 Thread norseman
ord, swriter, whatever - I'm not partial when it comes to automating. Today is: 20090513 Steve -- http://mail.python.org/mailman/listinfo/python-list

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 wrote: > On May 12, 9:27 pm, Chris Rebert wrote: >> On Tue, May 12, 2009 at 9:18 PM, 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

Re: about Python doc reader

2009-05-13 Thread norseman
Kushal Kumaran wrote: On Wed, May 13, 2009 at 4:28 PM, 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're us

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

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 1:00 PM, Christian Heimes 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 there is

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.

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": "w

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 "", line 1, in >   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:

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 >

Re: json vs. simplejson

2009-05-13 Thread Thomas Heller
Ned Deily schrieb: > In article <76vs9tf1f6c5...@mid.individual.net>, > Thomas Heller 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 ve

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: Representing a Tree in Python

2009-05-13 Thread Piet van Oostrum
> godshorse (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 best way t

Re: json vs. simplejson

2009-05-13 Thread Ned Deily
In article <76vs9tf1f6c5...@mid.individual.net>, Thomas Heller 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. > >> > >> However,

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

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 n

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 How

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 How do I see the actual code ? thanks mo

Re: DOM implementation

2009-05-13 Thread Paul Boddie
On 13 Mai, 18:08, "Emanuele D'Arrigo" 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 can get to

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 th

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

2009-05-13 Thread Wells
On May 13, 11:14 am, Wells 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... > >

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... winner.team Where winner.team would be the value o

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 applicatio

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

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 sc

Re: Call Web Service using proxy and http authentication

2009-05-13 Thread Steve Howell
On May 12, 12:51 pm, wdveloper wrote: > On May 12, 8:38 pm, Steve Howell wrote: > > > > > On May 12, 8:59 am, wdveloper wrote: > > > > Hi everyone, > > > > I am trying to call a webservice which requires an http > > > authentication. > > > To reach the ws, I must pass from a proxy http. So in th

spam

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

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

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" wrote in message n

Re: Convert UNIX formated text files to DOS formated?

2009-05-13 Thread walterbyrd
On May 13, 3:21 am, David Robinow 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: 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>, 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 4.2.3] on hp-ux11 >Type

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 this

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 anot

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 > > 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 ? Regards David --

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") li

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: http:/

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

Re: about Python doc reader

2009-05-13 Thread Kushal Kumaran
On Wed, May 13, 2009 at 4:28 PM, 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're using Windows,

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 P

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 se

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 drama

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

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

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 t

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

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 wrote: > Hi all, > > could any one tell how to run a python script as a scheduled service(say > every one minute).

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

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 wrote: > On May 12, 6:15 pm, norseman 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 about what I can put on my X

Re: Representing a Tree in Python

2009-05-13 Thread godshorse
On May 13, 3:19 pm, Jaime Fernandez del Rio 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 limitation of the al

Re: Nimrod programming language

2009-05-13 Thread Martin Vilcans
On Tue, May 12, 2009 at 3:10 PM, 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 bytes.

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

2009-05-13 Thread Lawrence D'Oliveiro
In message , 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. -- http://mail.python.org/mailman/listinfo/python-list

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 usi

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 hav

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

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 "v:\Component\DS\scripts\messagebuilder\IL_Messagebuilder\test\test_IL_setg

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