Re: find integers in f.readline()

2010-04-29 Thread Alf P. Steinbach
On 30.04.2010 04:22, * elsa: Hi people, I'm having a problem getting the info I need out of a file. I've opened the file with f=open('myFile','r'). Next, I take out the first line with line=f.readline() line looks like this: '83927 300023_25_5_09_FL 9086 9134 F3LQ2BE01AQLXF 1 49 + 80 ZA8Z89H

Re: Ignoring XML Namespaces with cElementTree

2010-04-29 Thread dmtr
I'm referring to xmlns/URI prefixes. Here's a code example: from xml.etree.cElementTree import iterparse from cStringIO import StringIO xml = """http://www.very_long_url.com";>""" for event, elem in iterparse(StringIO(xml)): print event, elem The output is: end http://www.very_long_url.com}ch

Re: Komodo Edit: Editor settings?

2010-04-29 Thread alex23
On Apr 30, 8:43 am, John Doe wrote: > I would very much like to stop code from expanding automatically. > Like when several consecutive lines of code have a plus sigh in the > left margin, meaning they are collapsed, when I go to copy or cut one > of those collapsed lines, the collapsed lines that

Re: dll errors in compiled python program

2010-04-29 Thread alex23
Alex Hall wrote: > I am stumped. The compiled version of my project works on my pc, but > when I put it on a thumb drive and try it on a laptop without python > installed I get this: > ImportError: DLL load failed: The specified procedure could not be found. Are you using py2exe? If so, are you i

Re: assigning multi-line strings to variables

2010-04-29 Thread Steven D'Aprano
On Fri, 30 Apr 2010 05:41:26 +1000, Lie Ryan wrote: > On 04/29/10 20:40, Gregory Ewing wrote: >> Lie Ryan wrote: >>> No, the implicit concatenation is there because Python didn't always >>> have triple quoted string. Nowadays it's an artifact and triple quoted >>> string is much preferred. >> >>

Re: Default if none

2010-04-29 Thread Steven D'Aprano
On Thu, 29 Apr 2010 04:12:29 -0700, Astley Le Jasper wrote: > ... oh ... that simple. Now I feel dumb. It's really difficult to tell what you're talking about, but I assume that you're talking about Chris' solution: x or y or z Be careful, as Chris' solution is rather risky (read his disclaime

Re: How to pretty-print cyclic dictionaries?

2010-04-29 Thread Dietrich Bollmann
Hi Chris and Garrick :) On Thu, 2010-04-29 at 18:09 +, Garrick P wrote: > Chris Rebert rebertia.com> writes: > > ... > > > If you want a prettier print, you could try serializing it to YAML and > > printing the result out; YAML has syntax for "tags". > > > > Cheers, > > Chris > > -- > > ht

RESOLVED Re: dll errors in compiled python program

2010-04-29 Thread Alex Hall
Thanks for the suggestion. It turns out that the problem was a copy of fowprof.dll, or something like that, which win7 included in my compiled program's dir. I was testing the program on xp, which has its own version of this dll, so deleting the dll from the dir solved it. On 4/29/10, alex23 wrot

Re: find integers in f.readline()

2010-04-29 Thread Tommy Grav
On Apr 29, 2010, at 10:22 PM, elsa wrote: > Hi people, > > I'm having a problem getting the info I need out of a file. > > I've opened the file with f=open('myFile','r'). > > Next, I take out the first line with line=f.readline() > > line looks like this: > > '83927 300023_25_5_09_FL 9086 91

Re: How to pretty-print cyclic dictionaries?

2010-04-29 Thread Dietrich Bollmann
Hi Robert, On Thu, 2010-04-29 at 11:56 -0500, Robert Kern wrote: > On 4/29/10 11:23 AM, Dietrich Bollmann wrote: > > Hi, > > > > I would like to represent graphs as cyclic dictionaries in Python. > > > > The python code for the graphs is generated by some other program > > (written in lisp) and I

Re: Ignoring XML Namespaces with cElementTree

2010-04-29 Thread Stefan Behnel
dmtr, 30.04.2010 04:57: I'm referring to xmlns/URI prefixes. Here's a code example: from xml.etree.cElementTree import iterparse from cStringIO import StringIO xml = """http://www.very_long_url.com";>""" for event, elem in iterparse(StringIO(xml)): print event, elem The output is: endh

Re: replacing words in HTML file

2010-04-29 Thread Stefan Behnel
Cameron Simpson, 30.04.2010 00:47: Here's a function from a script I wrote to bulk edit a web site. I was replacing OBJECT and EMBED nodes with modern versions: def recurse(node): global didmod [...] didmod=True continue recurse(O) > The calling end

Re: replacing words in HTML file

2010-04-29 Thread Cameron Simpson
On 30Apr2010 07:15, Stefan Behnel wrote: | Cameron Simpson, 30.04.2010 00:47: | >Here's a function from a script I wrote to bulk edit a web site. I was | >replacing OBJECT and EMBED nodes with modern versions: | > | > def recurse(node): | > global didmod | > [...] | > didmod=Tr

Re: [melbourne-pug] array matching

2010-04-29 Thread Terry Reedy
Anyone responding to this thread, please delete python-dev and gmane.comp.python.dev from the followup list of where your response is sent. It should never have been part of this overly cross-posted thread. -- http://mail.python.org/mailman/listinfo/python-list

Use Regular Expressions to extract URL's

2010-04-29 Thread Jimbo
Hello I am using regular expressions to grab URL's from a string(of HTML code). I am getting on very well & I seem to be grabbing the full URL [b]but[/b] I also get a '"' character at the end of it. Do you know how I can get rid of the '"' char at the end of my URL [b]Example of problem:[/b] [quo

<    1   2