Hi,
My idea is to create a system working as follows: each module knows
path to plugin directory, and that directory contains modules which
may add hooks to some points in the code.
Inspired by http://www.python.org/pycon/2005/papers/7/pyconHooking.html
I would create a class like this:
class
- 2/3 actually. So, doubling the size
of chunks is used, and the technique is quite common.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
You shouldn't verb verbs.
--
http://mail.python.org/mailman/listinfo/python-list
-compliant DOM parser could be good for learning things,
though. As I said, depends a lot.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2
2.2, no
datetime module was implemented.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n
.
Hint... see what var ta1 is. With python2.3 you'll get overflow error, becuase
mktime argument is out of range.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join
strings show examples how to use it. For serious HTML building stuff
it needs fiddling with, but should be handy for tiny projects.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20
character. Moreover, I wans't the one asking for information, I have
privilidge to use real operating systems as a programming platform. Thanks for
enthsiasm, though :)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
You shouldn't verb verbs
what you think it means.
Inconceivable!
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
Debugging is twice as hard as writing the code in the firstplace. Therefore,
if you write the code as cleverly as possible, you are, by definition
Thorsten Kampe [EMAIL PROTECTED] writes:
sys.path.append('c:\\xxx\\yyy') or sys.path.append('c:/xxx/yyy')
Well, of course. As I said, it was untested :) I just copied the path string,
and didn't remember Windows uses path names which need special
treatment. One more reason to avoid inferior
more convenient.
Footnotes:
[1] Well, not exactly equal to -M in Perl, but close enough for timing stuff
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
You shouldn't verb verbs.
--
http://mail.python.org/mailman/listinfo/python-list
Suppose one wants to fetch the following data from given network interface,
say, eth0:
Ethinf('eth0').addr()
'192.168.1.42/24'
Ethinf('eth0').route('default')
'192.168.1.1'
Ethinf('eth0').duplex()
'full'
Ethinf('eth0').speed()
100
Some statistics:
Ethstat('eth0').rx_bytes()
14325235341223
(pair programming) only
few times, and even then it wasn't XP-style in any other way. It is too often
considered waste of labour, I guess.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
Debugging is twice as hard as writing the code
at the moment: I should clean up a 120+ -line
if-elif-elif-elif... else -block which tests a single variable and calls
different methods with variable number of parameters depending on the value of
the variable - guess I should apply command pattern or similar...)
--
# Edvard Majakari
the
fun for reinventing the wheel, doesn't it. :)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n
() instead.
sys.stderr.write('warning: method
some_method_which_is_badly_named_or_just_plain_wrong is now deprecated')
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
You shouldn't verb verbs.
--
http://mail.python.org/mailman/listinfo
read the doc because I didn't need to). Neat,
thanks.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es
. Regular expressions are
nice too, but it is easy to make a mistake with those, and for non-trivial
stuff they tend to become write-only.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria
Dan Sommers [EMAIL PROTECTED] writes:
There's some sort of irony or something in there about not writing the
best genetic algorithm, but I can't quite put my finger on it.
+1 QOTW :)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria
Dave Cook [EMAIL PROTECTED] writes:
PyDev - Python IDE (Python Development Enviroment for Eclipse) version
0.9.5 has just been released.
Does it work with the newly released Eclipse 3.1?
Seems to work for me (but I've only coded one smallish Python program with it)
--
# Edvard Majakari
to commercial Python IDEs and could mature to the Other Way(TM)
for developing Python programs (the other is, of course, vi(m)/(X)Emacs)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20
, though. For some, 'more verbose' is 'more easy to understand'.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt
, and default slot values can be defined by the
user.
Edvard Majakari [EMAIL PROTECTED]
class RRArrayError(Exception): pass
class RRArray:
Simple round-robin class for arbitrary items
def __init__(self, slots, default=None):
Instantiate RRArray object
@param default: value
as well).
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n;
--
http://mail.python.org/mailman
.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
Debugging is twice as hard as writing the code in the firstplace. Therefore,
if you write the code as cleverly as possible, you are, by definition,
not smart enough to debug it. -- Brian W
Fredrik Lundh [EMAIL PROTECTED] writes:
does that apply to sturgeon's law itself?
(fwiw, this is of course why google displays 10 results on the
first page. according to the law, one of them is always exactly
what you want).
+ 1 QOTW :-)
--
# Edvard Majakari Software
) elapsed after 01.01.1970
1115881981.3717401
time.ctime() # current time in string format
'Thu May 12 10:13:20 2005'
time.localtime() # current time as a tuple
(2005, 5, 12, 10, 13, 30, 3, 132, 1)
For details, see 'pydoc time'
--
# Edvard Majakari Software Engineer
# PGP PUBLIC
[EMAIL PROTECTED] (Aahz) writes:
[x for x in data if data.count(x) == 1]
suffice? it is also stable preserving order of items. Lemme demo:
Only for small datasets -- this is an O(N^2) algorithm.
I realized that, but maybe I should've pointed it out too. For the OP if
he/she is unaware -
with smaller exponent was good, too.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n;
--
http
there was such a nice method list.count().
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
One day, when he was naughty, Mr Bunnsy looked over the hedge into Farmer
Fred's field and it was full of fresh green lettuces. Mr Bunnsy, however
IOTW (idiom of the week).
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n;
--
http
a module skeleton
out of py.test suite, though it is not very mature yet. You can grab it from
http://majakari.net/dl/pytestgen/ if you wish to try it.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
One day, when he was naughty, Mr Bunnsy looked
modules - I'm already seduced by the no-API py.test library...)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt
.
But thanks for the tip, I could see what IBM has done and then forget about
doing it automatically :)
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex
before the code, but many people wouldn't regard
it as TDD then.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449
mentioned.
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria!
$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),\n;
--
http://mail.python.org/mailman
integer when only positive
# inputs make sense etc.
Just like you said, they tell a bit different story each, so it probably
makes sense to separate those.
John Roth
Edvard Majakari [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I just found py.test[1] and converted
disappears if you start with writing your tests
first: with TDD, you don't have untested methods, because you start by
writing the tests first, and end up with a module that passes the tests
--
# Edvard Majakari Software Engineer
# PGP PUBLIC KEY available Soli Deo Gloria
(' ')
+dest.write(self.visited_pfx)
else:
-dest.write('! ')
+dest.write(self.unvisited_pfx)
dest.write(line)
source.close()
dest.close()
--
# Edvard Majakari Software
38 matches
Mail list logo