On Sun, Nov 15, 2009 at 4:00 AM, Terry Reedy wrote:
> Yoav Goldberg wrote:
>
>
>> On Sun, Nov 15, 2009 at 12:10 AM, Terry Reedy > tjre...@udel.edu>> wrote:
>>
>>Paul Rubin wrote:
>>
>>Mark Chu-Carroll has a new post about Go:
&
On Sun, Nov 15, 2009 at 12:10 AM, Terry Reedy wrote:
> Paul Rubin wrote:
>
> Mark Chu-Carroll has a new post about Go:
>>
>>
>> http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php
>>
>
> In a couple of minutes, I wrote his toy prime filter example in Python,
> mostly from
a syntax for this -- the
first method I proposed is a neat hack, and the second is a workaround, but
I wouldn't want the first method to be the official way of doing things, and
I suspect there are some use cases that can not be implemented as nicely
with the second method.
Yoav
--
h
I use the idiom "for line in file('filename'): do_something(line)" quite a
lot.
Does it close the opened file at the end of the loop, or do I have to
explicitly save the file object and close it afterward?
Yoav
--
http://mail.python.org/mailman/listinfo/python-list
#x27;import sys; sys.append('..');' on the top of each script is
a bit awkward.
Is there a neat clean way of achieving the code organization?
How do you organize your code in such settings?
Thanks,
Yoav
--
http://mail.python.org/mailman/listinfo/python-list
rks great, but now I can not pickle it.
I could ofcourse used a real function and not a lambda, but this would make
things (a) somewhat slower and (b) a bit ugly.
Is there another way of achieving the same behaviour, that allow for
pickling?
Thanks,
Yoav
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Yoav wrote:
>
>> I run a Java command line program. The point is, that it's not the
>> program that output this error message for sure. And I don't expect
>> popen3() to catch and report errors. I just want to keep my screen
>> ou
lip to the screen, after all as I understood it is supposed to
capture STDERR and STDOUT, but maybe I didn' t understand it right (it's
quite probable). Anyway anyway I can do such a thing?
Thanks.
Peter Hansen wrote:
> Yoav wrote:
>
>> I use the following code to the console o
I use the following code to the console output:
def get_console(cmd):
try:
p_in, p_out, p_err = os.popen3(cmd)
except:
pass
out_str = ''
for obj in p_out:
out_str = out_str + obj
for obj in p_err:
Thank you all guys. It seems like the simpler the solution, the more I
am happy about it. Sorry, for the simple question, I am quite new to
this lang.
Cheers.
Robert Kern wrote:
> Yoav wrote:
>
>>Don't think it will do much good. I need to get them from a file and
>>
Don't think it will do much good. I need to get them from a file and
extract the last folder in the path. For example:
if I get "c:\dos\util"
I want to extract the string "\util"
Fredrik Lundh wrote:
> "Yoav" wrote:
>
>>I am trying the foll
Thanks guys. Issue solved.
I am also going to give Microsoft a call about it. Any other issues you
want me to raise while I am talking to them?
Cheers.
Robert Kern wrote:
> Yoav wrote:
>
>>I am trying the following:
>>
>>re.search(r'\\[^"\\]+(?=("?$))
Ok , I tried:
try:
os.popen3(...)
except:
as someone suggested here. And on FreeBSD I don't get the error message,
and it works great. However, on Win32 I do get the annoying message. Any
idea why? And How I can make it go away?
thanks.
Yoav wrote:
> I am using os.popen3 t
I am trying the following:
re.search(r'\\[^"\\]+(?=("?$))', "c:\ret_files")
and I get a return of NoneType, and I have no idea why. I know that I
missing something here, but I really can't figure out why (I bet it's
something obvious). I also tried this RE on KODOS and it works fine
there, so
I am using os.popen3 to call a console process and get its output and
stderr. However on Win32 (and not OS X) I also get the Errno message.
It's printed to the screen, which I wish to keep clean. How can disable
this notification?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Such a sweet and simple way.
Thanks.
tooper wrote:
> Use os.sep to get / or \ or whatever character used to build pathes on
> the os you're working on
>
--
http://mail.python.org/mailman/listinfo/python-list
Anyway to set variables in REs. Meaning:
I have the RE re.compile(r'/[^/]*') for example and I want to use it on
both Win32 machines and Unix machnes. Meaning tha tI need to be able to
control the '/' before compiling. I want to create and if and decide
what the system is and then put the right
I would love a script to upload images to Imageshack.us. Any chance you
can post the latest version or email it to me?
Thanks.
Ricardo Sanchez wrote:
> I forgot to add that I'm behind a proxy, but I think that is
> irrelevant.
>
> If you are not behind a proxy replace this line:
>
> print post
I need to run multiple console apps in the background and to watch their
output. I have no idea if this is possible, and I don't even know where
to start looking. The processes are watchers, meaning that they watch
folders and mail boxes and do operations on items in them . Essentially
these ar
What is the difference between the two? Which on is better to use and why?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
What is the difference between the RE module and the SRE one?
Original Message
From: Jorge Godoy <[EMAIL PROTECTED]>
To:
Subject: Re:RE Question
Date: 18/8/2005 17:44
> Yoav wrote:
>
>
>>I don't understand why the two REs produce a different result.
Thanks, it seems like the first answer covers the second as well.
Thank you.
Jorge Godoy wrote:
> Yoav wrote:
>
>
>>I don't understand why the two REs produce a different result. I read
>>the RE guide but still I can't seem to figure it out.
>>
>>
I don't understand why the two REs produce a different result. I read
the RE guide but still I can't seem to figure it out.
>>> t
'echo user=name password=pass path="/ret files"\r\n'
>>> re.findall(r'(?<=\s)[^=]+=((?:".*")|(?:\S*))(?=\s)', t)
['name', 'pass', '"/ret files"']
>>> re.findall(r'(
23 matches
Mail list logo