Re: Is there a limit to os.popen()?
Hello,
I'm not 100% sure on this but to me it looks like there is a problem in
your make file. I would look in there first, see where 'cat' is
executed, I bet your problem will be around there.
Hope this helps,
Colin
Carl J. Van Arsdall wrote:
> I'm not sure the proper way to phrase the question, but let me try.
>
> Basically, I'm working with a script where someone wrote:
>
> kr = string.strip(os.popen('make kernelrelease').read())
>
>
> And then searches kr to match a regular expression.
>
> This seems to have been working, however lately when this line executes
> I get a number of messages to stderr after several minutes of execution:
>
> cat: write error: Broken pipe
> cat: write error: Broken pipe
> cat: write error: Broken pipe
>
>
> I know the output from this make has been growing (make applies some
> patches and the patch list is growing). Does os.popen() have some kind
> of read buffer limit that i'm hitting which is causing things to break?
>
>
>
>
> --
>
> Carl J. Van Arsdall
> [EMAIL PROTECTED]
> Build and Release
> MontaVista Software
--
http://mail.python.org/mailman/listinfo/python-list
Re: Regular Expression problem
Hey, I'm new with regex's as well but here is my idea. Since you don't know which attribute will come first why don't structure your regex like this (first off, I'll assume that \s == ' ', actually now that I think of it, isn't \s any whitespace character? anyways \s == ' ' for now) '' I think that should just about do it. Hope this helped, Colin John Blogger wrote: > (I don't know if it is the right place. So if I am wrong, please point > me the right direction. > If this post is read by you masters, I'm honoured. If I am getting a > mere response, I'm blessed!) > > Hi, > > I'm a newbie regular expression user. I use regex in my Python > programs. I have a strange > > (sometimes not strange, but please bear in mind; I'm a newbie ;) > problem using regex. That I want > > a particular tag value of one of my HTML files. > > ie: I want only the value after 'href=' in the tag >> > > '' > > here it would be 'mystylesheet.css'. I used the following regex to get > this value(I dont know if it > > is good). > > _""_ > I thought I was doing fine until I got stuck by this tag >> > > : same > tag but with 'href=' part > > at a different place. I think you got the point! > > So What should I do to get the exact value(here the value after > 'href=') in any case even if the > > tags are like these? >> > > > -OR- > > -OR- > -- http://mail.python.org/mailman/listinfo/python-list
Simple file writing techiques ...
Hello,
I've often found that I am writing little scripts at the interpretor to
read a text file, perform some conversion, and then write the converted
data back out to a file. I normally accomplish the above task by
reading the lines of the entire file into a list, preforming some
function to that list and then writing the list back out. I want to
write a generic function/module that will free me from repeatedly
typing the same thing, perhaps convertFile(filename, covertFunc) and I
was wondering what would be a more optimal solution for writing the
data,
fout = open('somefile','w')
for line in convertedData:
fout.write("%s\n" % line)
fout.close()
-- or --
fout = open('somefile','w')
fout.write("%s" % '\n'.join(convertedData))
fout.close()
... or maybe some hybrid of the two which writes chunks of the
convertedData list out in one shot ...
An issue that I'm probably most concerned with is scalabitiy, what if
the file was huge, like some sort of log file. As well, I know from
'import this' that there should only be one obvious way to do something
... however to me it's not so obvious :(
Any suggestions,
Colin
--
http://mail.python.org/mailman/listinfo/python-list
Oracle DBI Module? Recommendations
Hello, I'm planning on starting some database work on an Oracle 9i database, any suggestions on which module I should use. >From the python.org website I see that the options are: - DCOracle2 - cx_Oracle - mxODBC Any help would be appreciated but please, support your answers somehow. Thanks for the help, -Colin -- http://mail.python.org/mailman/listinfo/python-list
