Re: using timers to force an execution time

2009-07-16 Thread Nick Craig-Wood
(): for repeat in range(10): print time.time() time.sleep(0.66) if __name__ == __main__: try: time_out(3, test) except TimeOut: print timed out -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python

Re: This is a mess...

2009-07-16 Thread Nick Craig-Wood
[2] print e.dot(f) Which prints [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 2 330.0 -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching control-C

2009-07-08 Thread Nick Craig-Wood
cleanup() raise except Exception: continue That is the backwards compatible way -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Code that ought to run fast, but can't due to Python limitations.

2009-07-05 Thread Nick Craig-Wood
is not an acceptable answer.) You could compile it with Cython though. lxml took this route... -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: how to spawn a process under different user

2009-07-03 Thread Nick Craig-Wood
, pass ['su', '-', 'username', '-c', 'mycommand my_arg1 my_arg2'] There is some opportunity for quoting problems there, but it is easy! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: A superclass using a child classes' methods

2009-06-25 Thread Nick Craig-Wood
error messages when tracking down problems. A lot of people (like me) will enjoy the puzzle of looking through your code and finding out where it went wrong. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to enumerate classes in a module

2009-06-25 Thread Nick Craig-Wood
to use dir() for that purpose. It's not likely to change. Good advice... And as a double check import sys set(sys.__dict__.keys()) == set(dir(sys)) True import os set(os.__dict__.keys()) == set(dir(os)) True -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http

Re: C-extension 2 times slower than exe

2009-06-25 Thread Nick Craig-Wood
what it means I don't know! 2) time ff time used = 2.19 real0m3.170s user0m2.088s sys 0m0.168s -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-06-24 Thread Craig McQueen
Craig McQueen ces-...@mcqueen.id.au added the comment: @gregory.p.smith: This change is not suitable for back porting as it arguably adds a new feature. Speaking as a Mercurial user who can't use Mercurial at work through a proxy firewall... I beg you to consider that fixing

Re: ctypes list library

2009-06-22 Thread Nick Craig-Wood
works on Windows too IIRC. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert hash to struct

2009-06-22 Thread Nick Craig-Wood
idea after all. Indeed! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: UDP queue size

2009-06-18 Thread Nick Craig-Wood
/ routers can bear if you send lots of small messages. Switches / routers will start dumping packets if you do that since. Some switches just crash in my experience too ;-) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Nick Craig-Wood
f.bar Which prints sizeof(foo) = 6 0 123456789012345 -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: UDP queue size

2009-06-17 Thread Nick Craig-Wood
whether the above works on windows! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: waling a directory with very many files

2009-06-16 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 15 Jun 2009 09:29:33 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Hrvoje Niksic hnik...@xemacs.org wrote: Nick Craig-Wood n...@craig-wood.com writes: Here is a ctypes

Re: waling a directory with very many files

2009-06-15 Thread Nick Craig-Wood
if name not in (., ..): yield name closedir(dir_p) if __name__ == __main__: for name in listdir(.): print name -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: waling a directory with very many files

2009-06-15 Thread Nick Craig-Wood
Hrvoje Niksic hnik...@xemacs.org wrote: Nick Craig-Wood n...@craig-wood.com writes: Here is a ctypes generator listdir for unix-like OSes. ctypes code scares me with its duplication of the contents of system headers. I understand its use as a proof of concept, or for hacks one needs

Re: waling a directory with very many files

2009-06-15 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 15 Jun 2009 09:29:33 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Hrvoje Niksic hnik...@xemacs.org wrote: Nick Craig-Wood n...@craig-wood.com writes: Here is a ctypes generator listdir for unix-like OSes. ctypes code

Re: Lexical scope: converting Perl to Python

2009-06-13 Thread Nick Craig-Wood
examples. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's @foo[3,7,1,-1] ?

2009-06-13 Thread Nick Craig-Wood
having individual purposes are usually a sign that you should be using a different data structure. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: unladen swallow: python and llvm

2009-06-11 Thread Nick Craig-Wood
Stefan Behnel stefan...@behnel.de wrote: Nick Craig-Wood wrote: Luis M González wrote: I am very excited by this project (as well as by pypy) and I read all their plan, which looks quite practical and impressive. But I must confess that I can't understand why LLVM is so great

Re: setting program name, like $0= in perl?

2009-06-10 Thread Nick Craig-Wood
1000 5551 3420 0.1 sausage -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: unladen swallow: python and llvm

2009-06-07 Thread Nick Craig-Wood
to do with the v8 strategy, because unladen swallow will be a virtual machine, while v8 compiles everything to machine code on the first run. But I still wonder what this mean and how this is different. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http

Re: Error in linalg.inv ??

2009-06-06 Thread Nick Craig-Wood
numpy doesn't notice. Double checking like this a,b,c,d,e,f,g,h,i=range(1,10) a*e*i - a*f*h - b*d*i + b*f*g + c*d*h - c*e*g 0 So I guess it is a bug that numpy didn't throw numpy.linalg.linalg.LinAlgError(Singular matrix) Like it does normally -- Nick Craig-Wood n...@craig-wood.com -- http

Re: openhook

2009-06-06 Thread Nick Craig-Wood
Gaudha sanal.vik...@gmail.com wrote: Can anybody tell me what is meant by 'openhook' ? http://docs.python.org/library/fileinput.html?highlight=openhook Maybe ;-) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: can it be shorter?

2009-06-06 Thread Nick Craig-Wood
understand what it does, unlike the regexp solution which requires a little bit of thought. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-06-05 Thread Nick Craig-Wood
Ben Finney ben+pyt...@benfinney.id.au wrote: Emile van Sebille em...@fenx.com writes: On 6/4/2009 3:19 PM Lawrence D'Oliveiro said... In message slrnh2g9ei.2ea.n...@irishsea.home.craig-wood.com, Nick Craig- Wood wrote: You quit emacs with Ctrl-X Ctrl-C. That's save-buffers

Re: unladen swallow: python and llvm

2009-06-05 Thread Nick Craig-Wood
concerned is that it is more of a port of CPython to a new architecture than a complete re-invention of python (like PyPy / IronPython / jython) so stands a chance of being merged back into CPython. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Nick Craig-Wood
: pygame.draw.circle(screen, foreground_colour, dot, radius, 1) dots = [ (dot[0]+randrange(-1,2), dot[1]+randrange(-1,2)) for dot in dots ] pygame.display.flip() if __name__ == __main__: main() -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http

Re: Get the hard disk hardware serial number

2009-06-04 Thread Nick Craig-Wood
According to the man page smartctl also runs under windows/mac/solaris etc -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-06-04 Thread Nick Craig-Wood
messed up, clicking on the error will put the cursor in the right place in the code). -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-02 Thread Nick Craig-Wood
into the territory you describe. That said I've used C++ with ctypes loads of times, but I always wrap the exported stuff in extern C { } blocks. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Ah, ctypes

2009-06-01 Thread Nick Craig-Wood
that function types don't have enough references to them when passed in as arguments to C functions? It might slow it down microscopically but it would fix this problem. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Ah, ctypes

2009-06-01 Thread Nick Craig-Wood
David Bolen db3l@gmail.com wrote: Nick Craig-Wood n...@craig-wood.com writes: ctypes could potentially note that function types don't have enough references to them when passed in as arguments to C functions? It might slow it down microscopically but it would fix this problem

Re: python question

2009-05-22 Thread Craig
I use python 2.6.2 and i useing ubuntu 9.04 not windows. --- On Thu, 5/21/09, Dave Angel da...@ieee.org wrote: From: Dave Angel da...@ieee.org Subject: Re: python question To: Craig fasteliteprogram...@yahoo.com Cc: python-list@python.org Date: Thursday, May 21, 2009, 2:22 PM Craig wrote

python question

2009-05-21 Thread Craig
How do i install this.i never seen a python write in c before. -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2009-05-21 Thread Craig
http://downloads.emperorlinux.com/contrib/pyiw http://downloads.emperorlinux.com/contrib/pywpa Sorry fro the 2 post.How do i install a python moudles write en in C? -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-21 Thread Nick Craig-Wood
! $ jython2.5rc2/jython pmap.py map 6.242000103 pmap 5.8881144 -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Spawn a process with P_NOWAIT and pass it some data ?

2009-05-21 Thread Nick Craig-Wood
assume = is the process handle integer ?) Errr, not as far as I know. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Need advice on distributing small module

2009-05-16 Thread Nick Craig-Wood
Is more pythonic... You aren't relying on what came with particular python versions which may not be true in jython/ironpython/etc. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Options for creating a statistics screen on a Mac with Python?

2009-05-16 Thread Nick Craig-Wood
work, but you'll get something really cool at the end of it! here is how to use matplotlib on a pygame surface http://www.pygame.org/wiki/MatplotlibPygame -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools question

2009-05-14 Thread Nick Craig-Wood
yield out g = Grouper(5, xrange(20)) print list(g) g = Grouper(4, xrange(19)) print list(g) Which produces [(0, 1, 2, 3, 4), (5, 6, 7, 8, 9), (10, 11, 12, 13, 14), (15, 16, 17, 18, 19)] [(0, 1, 2, 3), (4, 5, 6, 7), (8, 9, 10, 11), (12, 13, 14, 15), (16, 17, 18)] -- Nick Craig-Wood n

Re: issue with twisted and reactor. Can't stop reactor

2009-05-12 Thread Nick Craig-Wood
something immediately after it is started, use reactor.callLater() before calling reactor.run(). You can't mix and match programming styles with twisted - it is all asynchronous callbacks or nothing in my experience! That takes a bit of getting your head round at first. -- Nick Craig-Wood n...@craig

Re: Learning C++ for Python Development

2009-05-11 Thread Nick Craig-Wood
++ implements the shims for the callbacks from python - C++ (which are exported by ctypes). P.S. I want to develop on Linux not Windows. Should be just the same on both. Once you've made your setup.py (for extending python) the build process will work on all supported architectures. -- Nick Craig-Wood n

Re: Q's on my first python script

2009-05-11 Thread Nick Craig-Wood
sys.exit(1) sys.stdout.write(%s%s % (args[0], weekday)) if not options.nonl: print if __name__ == __main__: Main() -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: how GNU stow is complementary rather than alternative to distutils

2009-05-11 Thread Nick Craig-Wood
got that well formed directory structure it is very easy to make it into a package (eg deb or rpm) so that idea is useful in general for package managers, not just stow. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping comments

2009-05-11 Thread Nick Craig-Wood
of the RETURN key. Emacs is my editor of choice, and I've never once come across anything like this. You probably haven't used MAC OS X then! I vnc to a mac and use emacs and I just can't type a #. Ctrl-Q 43 Return is my best effort! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig

Re: OOP Abstract Classes

2009-05-11 Thread Nick Craig-Wood
= RealDevice(/dev/ttyS1) real RealDevice('/dev/ttyS1') real.getMeasurement() 0 real.setPressure(14) real.getMeasurement() 14 -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with datetime.datetime.strptime

2009-05-10 Thread Nick Craig-Wood
. If I couldn't fix it then I'd report it as a bug. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode bit me

2009-05-10 Thread Nick Craig-Wood
no attribute '__unicode__' unicode(str(L),utf-8) u'[\xa9au]' -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python process utility (psutil) 0.1.2 released

2009-05-09 Thread Nick Craig-Wood
useful also! You could do this by replacing your current __init__.py (which just contains from _psutil import *) with _psutil.py -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How should I use grep from python?

2009-05-07 Thread Nick Craig-Wood
181 2007-10-18 14:01 - drwxr-xr-x 2 ncw ncw 4096 2007-08-29 22:56 10_files -rw-r--r-- 1 ncw ncw 124713 2007-08-29 22:56 10.html [snip] p.wait() # returns the error code 0 There was talk of removing the other methods from public use for 3.x. Not sure of the conclusion. -- Nick Craig

Re: object query assigned variable name?

2009-05-01 Thread Nick Craig-Wood
the locals in those stack frames. That will give some kind of answer. I have no idea whether this will work - the keyboard of my phone is too small to produce a proof ;-) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: bug with os.rename in 2.4.1?

2009-04-30 Thread Nick Craig-Wood
Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 28 Apr 2009 14:30:02 -0500, Nick Craig-Wood wrote: t123 tom.lu...@gmail.com wrote: It's running on solaris 9. Here is some of the code. It's actually at the beginning of the job. The files are ftp'd over

Re: wxPython menu creation refactoring

2009-04-30 Thread Nick Craig-Wood
it anyway! You create the submenu as a seperate menu then attach it to the menuBar with the label. Note there is a wxpython list also which you may get more help in! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: bug with os.rename in 2.4.1?

2009-04-28 Thread Nick Craig-Wood
thorough import errno try: os.rename(paths.xferin_dir+'/COMM.DAT',paths.xferin_dir+'/COMM.DAT'+'.0') except OSError, e: if e.errno != errno.ENOENT: raise The traceback should show the exact problem though. -- Nick Craig-Wood n...@craig-wood.com -- http

Re: pyflakes, pylint, pychecker - and other tools

2009-04-23 Thread Nick Craig-Wood
to the correct line of code. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Large data arrays?

2009-04-23 Thread Nick Craig-Wood
time either. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory footpring of python objects

2009-04-23 Thread Nick Craig-Wood
(several hundred thousand instances!). When doing these optimisations I ran a repeatable script and measured the total memory usage using the OS tools (top in my case). -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Large data arrays?

2009-04-23 Thread Nick Craig-Wood
Ole Streicher ole-usenet-s...@gmx.net wrote: Hi Nick, Nick Craig-Wood n...@craig-wood.com writes: mmaps come out of your applications memory space, so out of that 3 GB limit. You don't need that much RAM of course but it does use up address space. Hmm. So I have no chance to use

Re: A Special Thanks

2009-04-21 Thread Nick Craig-Wood
) the code you can be 100% sure that you didn't break anything which is a wonderful feeling. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a virtual serial port?

2009-04-19 Thread Nick Craig-Wood
Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Generation

2009-04-16 Thread Nick Craig-Wood
://packages.debian.org/sid/python-htmlgen But I think its original website is gone. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to extract from regex in if statement

2009-04-16 Thread Nick Craig-Wood
): Return all the matched () items. return self.value.groups() -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: interacting with an updatedb generated data file within python

2009-04-16 Thread Nick Craig-Wood
seconds on my laptop, using about 19 MB total memory You could easily enough put that into an sqlite table instead of a set(). -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: What IDE support python 3.0.1 ?

2009-04-16 Thread Craig
Well i use netbean is alot better i think and it work with 2.6 and 3.0 --- On Thu, 4/16/09, mousemeat mousem...@gmail.com wrote: From: mousemeat mousem...@gmail.com Subject: Re: What IDE support python 3.0.1 ? To: python-list@python.org Date: Thursday, April 16, 2009, 4:41 AM Use eclipse with

python docs redirect on python.org is old

2009-04-04 Thread Brandon Craig Rhodes
When I visit ... http://www.python.org/doc/lib/lib.html ... I get redirected to ... http://www.python.org/doc/2.5.2/lib/lib.html ... which seems a bit old. -- Brandon Craig Rhodes bran...@rhodesmill.org http://rhodesmill.org/brandon -- http://mail.python.org/mailman/listinfo

Re: Sending SMS using python script

2009-04-03 Thread Craig
There's a Python wrapper to the Skype API here: http://sourceforge.net/projects/skype4py/ On Linux I've used the PyGTK GUI that uses this. It's called SkySentials here: http://www.kolmann.at/philipp/linux/skysentials/ Craig On Apr 3, 6:50 am, ISF (Computer Scientists without Frontiers, Italy

Re: A design problem I met again and again.

2009-04-01 Thread Nick Craig-Wood
of abstraction in your program will rise. I've noticed some programmers think in big classes and some think in small classes. Train yourself to do the other thing and your programming will improve greatly! -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http

Re: double/float precision question

2009-04-01 Thread Nick Craig-Wood
/#why-are-floating-point-calculations-so-inaccurate If you want more precision use the built in decimal module or the third party gmpy module. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Beazley on Generators

2009-04-01 Thread Craig Allen
this is great, thanks... we have used generators to create something akin to a cooperative tasking environment... not to implement multitasking, but to be able to control low level data processing scripts. These scripts, written as generators, yield control to a control loop which then can pause,

[issue5131] pprint doesn't know how to print a set or a defaultdict

2009-03-31 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: Oops, my bad, I assumed the patch would by for py3k! I applied it to trunk and tested it. It works very well - thank you for fixing that :-) -- ___ Python tracker rep...@bugs.python.org http

Re: Ordered Sets

2009-03-30 Thread Nick Craig-Wood
class actually takes less memory 38 Mbytes vs 53 Mbytes for the list. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

[issue5131] pprint doesn't know how to print a set or a defaultdict

2009-03-30 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: I couldn't actually get this patch to apply to the py3k branch :-( $ patch -p0 --dry-run issue_5131.patch patching file Misc/NEWS Hunk #1 FAILED at 2598. 1 out of 1 hunk FAILED -- saving rejects to file Misc/NEWS.rej patching file Misc

Re: Programming Python 4th Edition?

2009-03-29 Thread Nick Craig-Wood
doesn't change very quickly and emphasises backwards compatibility, even for the jump to 3.x. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Code anntotations (copyright, autor, etc) in your code

2009-03-28 Thread Nick Craig-Wood
by anything, but I'd be interested to be proved wrong! I tend to use __author__ = Nick Craig-Wood n...@craig-wood.com __version__ = $Revision: 5034 $ __date__ = $Date: 2009-02-03 16:50:01 + (Tue, 03 Feb 2009) $ __copyright__ = Copyright (c) 2008 Nick Craig-Wood With __version__ and __date__ being

Re: C extension using GSL

2009-03-28 Thread Nick Craig-Wood
rc(x) 3 py x = () py rc(x) 954 # the empty tuple is shared That reminds me, you can use the gc module to show all your objects that are in use, which can help with memory leaks. eg something like http://code.activestate.com/recipes/457665/ -- Nick Craig-Wood n...@craig-wood.com

Re: How to port Python to an ARM running NucleusPlus OS

2009-03-28 Thread Nick Craig-Wood
in the cross compiling environment and see what happens! However if you are running Nucleus with Linux and want to run python in the Linux bit of it then I'd suggest to use the packages available for the Linux side of it. (Eg if it is running debian then apt-get install python). -- Nick Craig

Re: Interfacing python and C

2009-03-28 Thread Nick Craig-Wood
, then write it in cython instead! Should you be putting a function body in a header file? No -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python Runtime / Unladen Swallow

2009-03-28 Thread Nick Craig-Wood
. They plan to fold their work back into CPython when done too. Sounds like a project to keep an eye on! Now the question is will this make Vista run faster? Nothing could do that ;-) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: C extension using GSL

2009-03-27 Thread Nick Craig-Wood
works suprisingly often. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Nick Craig-Wood
learning new things from c.l.py As a long time usenet user I find it easy to ignore the occasional flame wars. Posters with the wrong sort of attitude are brought gently into line by the majority. If usenet groups had ratings I'd give c.l.py 5 stars. -- Nick Craig-Wood n...@craig-wood.com

Re: udp package header

2009-03-24 Thread Nick Craig-Wood
and address is the address of the socket sending the data. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Bash-like brace expansion

2009-03-24 Thread Nick Craig-Wood
the corner cases (unmatched brackets, empty brackets, etc) and be sure it works exactly as specified. doctest is cool for this kind of stuff. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Sun, 22 Mar 2009 12:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: I wrote a serial port to TCP proxy (with logging) with twisted. The problem I had was that twisted serial ports didn't seem to have any back pressure. By that I

Re: Async serial communication/threads sharing data

2009-03-23 Thread Nick Craig-Wood
Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] In the case of a TCP to serial forwarder, you don't actually have to implement either a producer

Re: Using python 3 for scripting?

2009-03-23 Thread Nick Craig-Wood
it is more awkward for writing code close to Python 3 syntax. I tend to target whatever is in Debian stable, which starting from this month is 2.5 (recently upgraded from 2.4). 2.6 or 3.x is nowhere to be seen in Debian stable, testing or unstable :-( -- Nick Craig-Wood n...@craig-wood.com

Re: script files with python (instead of tcsh/bash)?

2009-03-22 Thread Nick Craig-Wood
() print done if __name__ == __main__: main() -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.0 - bsddb removed

2009-03-22 Thread Nick Craig-Wood
. You would need to make a dictionary interface to sqlite, eg http://code.activestate.com/recipes/576638/ Or do something a bit simpler yourself. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: script files with python (instead of tcsh/bash)?

2009-03-22 Thread Nick Craig-Wood
in functions is much quicker than fork()-ing an external command too. So much to learn, so little time (but so much fun!) ;-) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Async serial communication/threads sharing data

2009-03-22 Thread Nick Craig-Wood
buffer was full and to only take the data at 9600 baud. I never did solve that problem :-( -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: cross compile Python to Linux-ARM

2009-03-19 Thread Nick Craig-Wood
the standard Python library, or is that yet another adventure ? If you use the debian compiled version then you get the lot. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: packaging

2009-03-18 Thread Craig Allen
andrew thanks andrew, good advice, I should probably use that throughout our code. btw, hope the world is treating you well, long time no see... -craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to Perl transalators

2009-03-18 Thread Nick Craig-Wood
/pleac_python/index.html Which is a sort of Rosetta stone for perl and python ;-) (The perl cookbook translated into python.) -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

packaging

2009-03-17 Thread Craig Allen
the developer's)... so any comment are appreciated. I've been using python for a few years now but this is the first time we are forming it in the shape of a proper package. cheers and thanks. -craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Special keyword argument lambda syntax

2009-03-14 Thread Nick Craig-Wood
obvious. It gives you the opportunity for a docstring also. Yes it is a bit more typing, but who wants to play code golf all day? -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw String Question

2009-03-12 Thread Nick Craig-Wood
\\ 'a\\' Which isn't terribly elegant, but it doesn't happen very often. -- Nick Craig-Wood n...@craig-wood.com -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Ban Xah Lee

2009-03-11 Thread Craig Allen
There you go: a 30-second psychological diagnosis by an electrical engineer based entirely on Usenet postings.  It doesn't get much more worthless than that... -- Grant rolf but interesting post nonetheless. I have been really somewhat fascinated by AS since I heard of it about a decade

Re: Why is lambda allowed as a key in a dict?

2009-03-11 Thread Craig Allen
On Mar 10, 1:39 pm, Paul Rubin http://phr...@nospam.invalid wrote: Craig Allen callen...@gmail.com writes: it raises an interesting question about why doesn't it.  I can think of practical answers to that, obviously, but in principle, if a function compiles to exactly the same byte code

Re: Why is lambda allowed as a key in a dict?

2009-03-10 Thread Craig Allen
I think the point is that function objects compare by object identity, so the two lambdas you use above are not equal even though they have the same code. it raises an interesting question about why doesn't it. I can think of practical answers to that, obviously, but in principle, if a

<    1   2   3   4   5   6   7   8   9   10   >