On Fri, 19 Jun 2009 17:53:40 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message 20090618081423.2e035...@coercion, Mike Kazantsev wrote:
On Thu, 18 Jun 2009 10:33:49 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message
:
http://code.google.com/p/procpy/
--
Mike Kazantsev // fraggod.net
--
http://mail.python.org/mailman/listinfo/python-list
.
If it gets the right stuff, try the same with os.environ (prehaps vlc
keeps socket location there, just like ssh/gpg-agents?).
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
blocking.
Try this recipe:
http://code.activestate.com/recipes/576759/
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
(query)
result = db.store_result()
data = result.fetch_row(maxrows=0, how=1)
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
myself, why how is 1 and wtf is this how, anyway!? ;)
I can't seem to find any mention of such methods in documentation and
even python source, guess they are implemented directly in underlying
C lib.
Hope I learned to abstract from such syntax since then, I sure do...
--
Mike Kazantsev // fraggod.net
the
second results, from py itself. My suggestion was just to compare them
- pop the py shell, eval the outputs into two sets, do the diff and
you'll see it at once.
If there's an empty set then I guess it's pretty safe to assume that
python creates subprocess in the same way the shell does.
--
Mike
On Fri, 19 Jun 2009 22:00:28 +0600
Mike Kazantsev mk.frag...@gmail.com wrote:
On Fri, 19 Jun 2009 08:28:17 -0700
Tyler Laing trinio...@gmail.com wrote:
Thanks mike, the idea that maybe some of the info isn't being passed is
certainly interesting.
Here's the output of os.environ
max_tries).
Also, you can get rid of code duplication by catching some basic
urllib2 exception, then checking if it's urllib2.HTTPError and it's code
is 404, retrying (continue for the loop case) otherwise.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http
is that a problem?
So you can os.listdir them?
Don't ask me what for, however, since that's the original question.
Also not every fs still in use handles this situation effectively, see
my original post.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http
On Wed, 17 Jun 2009 23:04:37 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message 20090617142431.2b25f...@malediction, Mike Kazantsev wrote:
On Wed, 17 Jun 2009 17:53:33 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
Why not use hex
On Thu, 18 Jun 2009 10:33:49 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message 20090617214535.10866...@coercion, Mike Kazantsev wrote:
On Wed, 17 Jun 2009 23:04:37 +1200
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote:
In message
.
I've read this thread from the beginning, being tempted to insert
remarks about shelve module or ORMs like SQLAlchemy, but that'd be
meaningless without the problem description, which I haven't seen
anywhere. Is it some trick idea like let's walk on our heads?
--
Mike Kazantsev // fraggod.net
a nail with sledgehammer - just _read_
or _write_ to pipes asynchronously.
--
Mike Kazantsev // fraggod.net
--
http://mail.python.org/mailman/listinfo/python-list
or reiserfs by a small
margin.
Sadly, that's not the case with filesystems like FreeBSD ufs2 (at least
in sixth branch), so it's better to play safe and create subdirs if the
app might be run on different machines than keeping everything in one
path.
--
Mike Kazantsev // fraggod.net
the prefix at the beginning of every line?
I'd log exception name and timestamp (or id) only, pushing the full
message with the same id to another log or facility (like mail it to
some dedicated bug-report box).
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http
On Wed, 17 Jun 2009 03:42:02 GMT
Lie Ryan lie.1...@gmail.com wrote:
Mike Kazantsev wrote:
In fact, on modern filesystems it doesn't matter whether you
accessing /path/f9e95ea4926a4 with million files in /path
or /path/f/9/e/95ea with only hundred of them in each path. Former
case (all
On Mon, 15 Jun 2009 05:37:14 -0700 (PDT)
OdarR olivier.da...@gmail.com wrote:
On 13 juin, 07:25, Mike Kazantsev mk.frag...@gmail.com wrote:
There was quite interesting explaination of what happens when you send
^C with threads, posted on concurrency-sig list recently:
http://blip.tv
On Sun, 14 Jun 2009 22:45:38 -0700 (PDT)
deostroll deostr...@gmail.com wrote:
I need to be able to parse a json data object using the simplejson
package. First of all I need to know all the task needed for this job.
Note that py2.6 has a bundled json module.
--
Mike Kazantsev // fraggod.net
with map, filter, and range, but I made no effort and hence cannot
complain.
Why? We have itertools.imap, itertools.ifilter and xrange already.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
()
data.see_also.new_item['z'] = 3
print data.see_also.new_item.z
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
contextmanager decorator:
from contextlib import contextmanager
@contextmanager
def get_cursor():
try:
cursor = conn.cursor()
yield cursor
except Exception as ex: raise ex
finally: cursor.close()
with get_cursor() as cursor:
# whatever ;)
--
Mike Kazantsev
On Sun, 14 Jun 2009 00:46:16 -0700 (PDT)
Mr . Waqar Akbar wqr.ak...@gmail.com wrote:
...
Judging by the typo in the last subject, someone indeed types all this
crap in manually! Oh my god...
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org
dict() to declare a dict, not some mix of letters and
incomprehensible symbols, thank you.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
so much sugar to add before it'll transform into salt and
you'll start seeing lines like these:
s**'@z!~;()=~$x;%xl;$(,x'*e;y*%z),$;@=x!;h(l~;*punch jokers;halt;*;print;
I'm happy to use python because it discourages such syntax, among other things.
/flame_war_alert
--
Mike Kazantsev
for py implementation of this call, which I
haven't stumbled upon, but, admittely, never looked for.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
links?
Thanks for sharing this link, although I prefer such information in
written form - it's easier/faster to work with and much more accessible.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
explaination of what happens when you send
^C with threads, posted on concurrency-sig list recently:
http://blip.tv/file/2232410
http://www.dabeaz.com/python/GIL.pdf
Can be quite shocking, but my experience w/ threads only confirms that.
--
Mike Kazantsev // fraggod.net
signature.asc
the private values, so I'd suggest getting
some fresh air when you start to feel like doing that.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
'].timetuple(
Here time is inversed, yielding reverse sort order by that column.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
])
for word in words[1:]:
if count_span_max:
count_span_max -= 1
line += span_min + ' '
else: line += span_min
line += word
print '%d chars: %r'%(len(line), line)
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org
( (lines.next(), dict(it.imap(str.split, lines))) for sep,lines
in
it.groupby(it.ifilter(bool, it.imap(lambda x: x.strip(spaces), src)),
key=lambda x: x == 'end') if not sep )
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org
) # !!! as in init
def _change(self, text):
return text + 'any change'
---
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
be amazed how much insight man python and python -h can
yield ;)
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 24 May 2009 19:03:26 +0600
Mike Kazantsev mk.frag...@gmail.com wrote:
On Sun, 24 May 2009 05:06:13 -0700 (PDT)
Kless jonas@googlemail.com wrote:
Is there any way to simplify the next code? Because I'm setting a
variable by default of the same way than it's set in the setter
sense
to me than an explicit conversion.
There's also op.itruediv for number /= float(total) * 100 case.
http://docs.python.org/dev/library/operator.html
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
- it should make CLI more consistent and save some typing by
omitting otherwise always-required option argument (--part).
--
Mike Kazantsev // fraggod.net
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
Jim Qiu wrote:
Hi everyone,
Following is the code i am reading, i don't see anywhere the declaration of
Message.root object,
Where is it from?
...
Prehaps it gets assigned by the parent itself?
Like this:
def spawn_child(self):
child = Message()
child.root = self
--
Mike
.
text = 'some text to correct (anything, really)'
result = buffer('')
word, c = buffer(''), ''
for c in text:
if c.isalpha(): word += c
else:
if word:
result += correct(word)
word = buffer('')
result += c
--
Mike Kazantsev // fraggod.net
?
Looks like a solid way to construct relative imports to me.
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
)
smtp = smtplib.SMTP(relay)
smtp.sendmail(from, to, msg.as_string() )
smtp.close()
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
as it
ftuple = tuple(it.imap( float, line.split('; ') ))
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
the cache, or just get on with that iterable until it depletes.
What real-world scenario am I missing here?
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
managed to avoid such re-iteration scenarios, but
of course, it could be just my luck ;)
--
Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
45 matches
Mail list logo