Re: mmap caching

2007-01-22 Thread Nick Craig-Wood
bit of memory and it is failing so it throws a MemoryError. Could memory allocation under windows be affected by a large chunk of mmap()ed file which is physically swapped in at the time of the allocation? -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: mmap caching

2007-01-22 Thread Nick Craig-Wood
that we don't know about or there is a bug somewhere, either in the OS or in python. Can you make a short program to replicate the problem? That will help narrow down the problem. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: mmap caching

2007-01-21 Thread Nick Craig-Wood
hold of pages as long as possible just in case you need them again. The pages dropped should be the least recently used pages. I wouldn't have expected a MemoryError though... Did you do mmap.flush() after writing? -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: Non-blocking pipes during subprocess handling

2007-01-09 Thread Nick Craig-Wood
this modification to subprocess which does non-blocking pipes. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 I personally think something like that should be built into subprocess -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman

Re: code optimization (calc PI) / New Algorithme for PI

2007-01-05 Thread Nick Craig-Wood
) + arctan(_1/7)) def pi_gauss(): return 4*(12*arctan(_1/18) + 8*arctan(_1/57) - 5*arctan(_1/239)) def pi_euler(): return 4*(5*arctan(_1/7) + 2*arctan(_3/79)) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: code optimization (calc PI)

2007-01-04 Thread Nick Craig-Wood
. Standalone Program to calculate PI using python only Nick Craig-Wood [EMAIL PROTECTED] import sys from time import time class FixedPoint(object): A minimal immutable fixed point number class __slots__ = ['value

Re: Convert Perl to Python

2006-12-29 Thread Nick Craig-Wood
editor with macros will let you fly through the job. I used emacs. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I beat perl at grep-like processing speed?

2006-12-29 Thread Nick Craig-Wood
user0m0.120s sys 0m0.012s vs $ time ./z.pl pl.out.orig real0m0.223s user0m0.208s sys 0m0.016s Which gives the same output modulo a few \r -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating all permutations from a regexp

2006-12-22 Thread Nick Craig-Wood
a look at sre*.py in the python library and you might be able to work out what to do! I had a brief look myself, and it looked... complicated! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating all permutations from a regexp

2006-12-22 Thread Nick Craig-Wood
Fredrik Lundh [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: A regular expression matcher uses a state machine to match strings. unless it's the kind of regular expression matcher that doesn't use a state machine, like the one in Python. Ah! Well that is outside of my experience

Re: Core dump revisited

2006-12-19 Thread Nick Craig-Wood
help also. Good luck! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Core dump revisited

2006-12-19 Thread Nick Craig-Wood
); if (item) Py_DECREF(item); return rc; -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace a comma

2006-12-18 Thread Nick Craig-Wood
' This shows a fundamental difference between the two methods t = , re.sub(r,(?!\s), , , t) ', , , , , ' re.sub(r,([^\s]), r, \1, t) ', ,, ,,' -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Core dump revisited

2006-12-18 Thread Nick Craig-Wood
. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Serial port failure

2006-12-17 Thread Nick Craig-Wood
Rob [EMAIL PROTECTED] wrote: Craig, In the embedded firmware, the each box re-transmits after it finishes reading the packet. This is a very rudimentary system, and uses no flow control. The topology is that each embedded box has a master and a slave port. The master is used

Re: Serial port failure

2006-12-15 Thread Nick Craig-Wood
with that program ;-) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: shell command needs whitespace characters escaped

2006-12-08 Thread Nick Craig-Wood
(or better, subprocess.call). A good idea! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of factory pattern in Python?

2006-12-07 Thread Nick Craig-Wood
) to make the registry :- registry = {} for obj in sys.modules[__name__].__dict__.values(): try: if issubclass(obj, Base): registry[kind] = obj except TypeError: pass There might be a neater way of writing the above! -- Nick Craig-Wood [EMAIL PROTECTED] -- http

Re: how to invoke the shell command and then get the result in python

2006-12-06 Thread Nick Craig-Wood
of the above can cause problems. Just say no to passing user input (from anywhere at all) via the shell! That (along with SQL injection attacks which are very similar in concept) is one of the most common security attacks for scripting languages like Python when used in a web environment. -- Nick Craig

Mirror imaging binary numbers

2006-12-06 Thread Craig
Hi there, I'm trying to switch binary numbers around so that the MSB becomes the LSB etc. Is there an easy way of doing this as I can't seem to find anything. If you could help that would be great. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Mirror imaging binary numbers

2006-12-06 Thread Craig
Matimus wrote: Craig wrote: I'm trying to switch binary numbers around so that the MSB becomes the LSB etc. What do you mean 'binary numbers'? They are all binary. If you mean the int type, they are 32 bits long and there are 16 bits between the MSB and LSB (Most/Least Significant

Re: Mirror imaging binary numbers

2006-12-06 Thread Craig
Terry Reedy wrote: Craig [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks so much for the response. I have an array of individual bytes which will eventually make up a binary bitmap image that is loaded onto an LCD screen (1 = black dot, 0 = white dot). At the moment

Re: how to invoke the shell command and then get the result in python

2006-12-05 Thread Nick Craig-Wood
defensively! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Opening colour BMPs with PIL

2006-12-05 Thread Craig
Fredrik Lundh wrote: Craig wrote: I'm trying to open colour BMPs using PIL and I'm getting the following errors. what program did you use to produce those BMP files? can you prepare reasonably small samples using the same program and post them somewhere? /F Thanks for the reply. I'm

X11 bitmap image conversion problem

2006-12-05 Thread Craig
1000(0xBC). Is there an easy way to flip the bits after the im.tobitmap() conversion has been done or do I have to find another way? If you could help that would be greatly appreciated. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Subprocess with a Python Session?

2006-12-05 Thread Nick Craig-Wood
p.sendline(print 10\n) 10 p.readline() ' print 10\r\n' p.readline() '10\r\n' Note that running python under pexpect puts it into interactive mode. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: os.mkdir and mode

2006-12-04 Thread Nick Craig-Wood
of that approach? If you use use os.umask(0) then the os.mkdir(dir, perms) will create the directory with exactly those permissions, no chmod needed. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: os.mkdir and mode

2006-12-04 Thread Nick Craig-Wood
Martin v. Löwis [EMAIL PROTECTED] wrote: Nick Craig-Wood schrieb: So it looks like python mkdir() is applying the umask where as /bin/mkdir doesn't. From man 2 mkdir Actually, mkdir(1) has no chance to not apply the umask: it also has to use mkdir(2), which is implemented in the OS

Re: Ensure a variable is divisible by 4

2006-12-04 Thread Nick Craig-Wood
0,4,4,4,4,8,8,8,8,12... You could also consider the funky x22 -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Convert PNG files to BMP files using PIL

2006-12-04 Thread Craig
know that would be great. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Opening colour BMPs with PIL

2006-12-04 Thread Craig
XP with Python 2.5. I can open monochrome BMPs fine but I don't want that. If you could help that would be greatly appreciated. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: os.mkdir and mode

2006-12-02 Thread Nick Craig-Wood
-file-dir.html: Where it is used, the current umask value is first masked out. Use os.chmod() after os.mkdir() to get the desired permissions. I think you meant use os.umask(0) before the os.mkdir() ? -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: os.mkdir and mode

2006-12-02 Thread Nick Craig-Wood
: 2453906 Links: 2 Access: (0770/drwxrwx---) Uid: ( 518/ ncw) Gid: ( 518/ ncw) Access: 2006-12-02 09:48:04.0 + Modify: 2006-12-02 09:48:04.0 + Change: 2006-12-02 09:48:04.0 + $ -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick

Open 16-bit/24-bit windows bitmap using PIL

2006-11-30 Thread Craig
fine using PIL but the colour options are more desirable. I am using Windows 2000 if that is any help and I am saving the different BMP's using Microsoft Paint. If you could help that would be great. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Really closing stdout (was: fork and exit needed?)

2006-11-29 Thread Nick Craig-Wood
Mitja Trampus [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: I'm not sure how you do open stdout to /dev/null in python though! I suspect something like this... import posix posix.close(1) posix.open(/dev/null, posix.O_WRONLY) Yes, you're close enough... The explanations

Re: Wrapping A Shell

2006-11-29 Thread Nick Craig-Wood
return output p.stdin.write(ls\n) print read_output(p) p.stdin.write(uname -a\n) print read_output(p) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: fork and exit needed?

2006-11-28 Thread Nick Craig-Wood
posix posix.close(1) posix.open(/dev/null, posix.O_WRONLY) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: fork and exit needed?

2006-11-28 Thread Nick Craig-Wood
Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Tue, 28 Nov 2006 04:30:09 -0600, Nick Craig-Wood [EMAIL PROTECTED] declaimed the following in comp.lang.python: If you run this import os,sys,time print os.getpid() sys.stdout = open(os.devnull, 'w') time.sleep(60

ElementTree xmlns:xsi question

2006-11-28 Thread Craig
and the output being 100% correct as well. Any help would be greatly appreciated. Craig -- http://mail.python.org/mailman/listinfo/python-list

Generating header information using ElementTree

2006-11-26 Thread Craig
BobActivityLog SYSTEM test.dtd How do you add this header information to the tree as I can't find any documentation or examples on how you can do this. Any help would be appreciated. Thank you and good luck. Craig Williamson -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
Fredrik Lundh wrote: Craig wrote: I'm only new to Python so please bear with me. I using ElementTree to generate an XML file that will reference a DTD and an XSL file. The header information I want at the start of the file is as follows: ?xml version=1.0? ?xml-stylesheet type=text

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
Diez B. Roggisch wrote: Craig schrieb: Fredrik Lundh wrote: Craig wrote: I'm only new to Python so please bear with me. I using ElementTree to generate an XML file that will reference a DTD and an XSL file. The header information I want at the start of the file is as follows

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
John Machin wrote: Craig wrote: Great. Got that sorted. The problem I have now is that some of the XML data is not copied across to the file when I have the text information included. The number of characters that is lost is equal to the number of characters that is in the block

Re: pyserial port connection problem

2006-11-17 Thread Nick Craig-Wood
admin rights to open a serial port under windows (I'm not sure). -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Using signal.alarm to terminate a thread

2006-11-15 Thread Nick Craig-Wood
between the pexpect versions. You could try the pexpect from debian/testing easily enough I expect. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-2.5.exe?

2006-11-15 Thread Nick Craig-Wood
%;%DEMOHOME%\Demo\Python set PYTHON=%PYTHONHOME%\python.exe set PYTHONW=%PYTHONHOME%\pythonw.exe set PATH=%PYTHONHOME%;%PATH% start Demo %PYTHONW% demo.pyw -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Nick Craig-Wood
, and dedicate one thread (preferably the initial thread) to wait synchronously for signals, using sigwait(), and send messages to the other threads accordingly. Note also that the signal can be delivered to any thread which complicates things. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Nick Craig-Wood
Fredrik Lundh [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: The only sensible things you can do from a signal handler is set a global flag, or call sem_post on a semaphore, to record the delivery of the signal. The remainder of the program can then either poll the global flag

Re: Using signal.alarm to terminate a thread

2006-11-13 Thread Nick Craig-Wood
(): print Running yes command... pexpect.run('yes', timeout=5) t = threading.Thread(target=runyes) t.start() t.join() -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Nick Craig-Wood
debian ii gtk2-engines-gtk-qt 0.7-1 theme engine using Qt for GTK+ 2.x You get a control panel for GTK apps in the KDE control center also. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Nick Craig-Wood
the additional expense of renewing it. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorted list - how to change it

2006-11-09 Thread Nick Craig-Wood
... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Nick Craig-Wood
Christophe [EMAIL PROTECTED] wrote: Nick Craig-Wood a écrit : There is also PyQT which we wrote off as we wanted to write commercial applications too. As it happens we have a commercial QT licence, but we decided we didn't want to have to incurr the additional expense of renewing

Re: assigning values in __init__

2006-11-07 Thread Nick Craig-Wood
are easy to manage, and you never get confused by their position. Also pychecker understands named parameters where as if you use a scheme like the above you'll cause pychecker problems! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman

Re: Sorted and reversed on huge dict ?

2006-11-04 Thread Nick Craig-Wood
) portable way of doing this I'd be interested! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: __div__ not recognized automatically

2006-11-02 Thread Nick Craig-Wood
a+b print (a+b)/2 This prints NumX(4) NumX(2) NumX(6) NumX(3) -- Nick Craig-Wood [EMAIL PROTECTED] -- http

Re: IDE that uses an external editor?

2006-10-16 Thread Nick Craig-Wood
navigation, and bycycle repair man for refactoring support. You can run stuff at the interactive python prompt from within emacs. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: wx.grid question (trying to use code from Grid_Example.py)

2006-10-16 Thread Nick Craig-Wood
://www.wxpython.org/maillist.php -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Ok. This IS homework ...

2006-10-16 Thread Nick Craig-Wood
language territory. I was born and bred on flow charts and I admit they were useful back in the days when I wrote 1000s of lines of assembler code a week. Now-a-days a much better map for the the territory is pseudo-code. Python is pretty much executable pseudo-code anway! -- Nick Craig-Wood [EMAIL

Re: Thread termination

2006-10-14 Thread Nick Craig-Wood
for... ctypes.pythonapi.PyThreadState_SetAsyncExc -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending binary pickled data through TCP

2006-10-13 Thread Nick Craig-Wood
the optimisation mill which is why they may not look immediately like how you might first think of writing them!) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: building extensions for Windows Python

2006-10-13 Thread Nick Craig-Wood
will run under windows. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: building extensions for Windows Python

2006-10-13 Thread Nick Craig-Wood
are true. It is fairly easy to build python extensions using mingw hosted on linux which work with the standard python.org install - see my other post in this thread. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Nick Craig-Wood
://svn.mythtv.org/trac/ A nice extra is that it is written in python. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: What value should be passed to make a function use the default argument value?

2006-10-04 Thread Nick Craig-Wood
): template = None return mainFunction(var, template) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: What value should be passed to make a function use the default argument value?

2006-10-04 Thread Nick Craig-Wood
like this is a good idea. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin regular expressions?

2006-10-02 Thread Nick Craig-Wood
from perl to python some time ago now, I find myself using many fewer regexps due to the much better built in string methods of python. This is a good thing, because regexps should be used sparingly and they do degenerate into line noise quite quickly... -- Nick Craig-Wood [EMAIL PROTECTED

Re: DAT file compilation

2006-10-02 Thread Nick Craig-Wood
it. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: ruby %w equivalent

2006-09-27 Thread Nick Craig-Wood
. And the python way is why I am now a python programmer not a perl programmer! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: ruby %w equivalent

2006-09-27 Thread Nick Craig-Wood
Duncan Booth [EMAIL PROTECTED] wrote: Nick Craig-Wood [EMAIL PROTECTED] wrote: In python when making __slots__ or module.__all__ you end up typing lists of objects or methods and they turn out like this which is quite a lot of extra typing __slots__ = [method1, method2, method3

Re: R.S.I. solutions?

2006-09-26 Thread Nick Craig-Wood
- there are lots of different forms of it all caused by different things. You'll need some professional advice to sort it out. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
Tim Golden [EMAIL PROTECTED] wrote: if os.path.isfile (filepath): print filepath You might get a more accurate result using os.access(filepath, os.X_OK) instead of os.path.isfile(filepath) Which checks the file is executable -- Nick Craig-Wood [EMAIL PROTECTED

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
Tim Golden [EMAIL PROTECTED] wrote: [Nick Craig-Wood] | Tim Golden [EMAIL PROTECTED] wrote: | if os.path.isfile (filepath): | print filepath | | You might get a more accurate result using | | os.access(filepath, os.X_OK) | | instead

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
, but is it worth it? Wouldn't returning X_OK as true if the file exists be more sensible? Ie the file might be executable, you'll have to try it, rather than, no this file is definitely not executable... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
in the past anyway! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

A cross platform systray icon

2006-09-11 Thread Nick Craig-Wood
that PyQT, tkinter or PyGTK does it all for me, but from my searching on the subject I doubt it is going to be that easy! Thanks -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: A cross platform systray icon

2006-09-11 Thread Nick Craig-Wood
TheSeeker [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: Does anyone have some hints / tips / experience with making a cross platform systray icon? It should work on Windows, Gnome and KDE at minimum. You might do a search for TaskBarIcon in the wxPython toolkit. Yes thank you

Re: A cross platform systray icon

2006-09-11 Thread Nick Craig-Wood
Thanks anyway -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: xmingw and f2py

2006-09-08 Thread Nick Craig-Wood
--def python24.def --output-lib libpython2.4.a # Move the files into the correct place mv -i python24.dll python24.def libpython2.4.a /usr/i586-mingw32msvc/lib/ After that lot you can build python extensions with mingw under linux, using -lpython2.4 -- Nick Craig-Wood [EMAIL PROTECTED] -- http

Re: xmingw and f2py

2006-09-08 Thread Nick Craig-Wood
suggestions? That looks like a distutils error. We don't use distutils to build our stuff and I haven't really used it before so I can't help you there. You want to tell distutils that the compiler is just gcc somehow and takes the same options. Not sure how you do that. -- Nick Craig-Wood [EMAIL

Re: IronPython on Mono howto

2006-09-07 Thread Nick Craig-Wood
0m0.036s $ time python2.4 -c pass real0m0.015s user0m0.008s sys 0m0.007s Over all I'm very impressed - it is great to have a new implemention of Python. I'm not sure mono is showing it off to its full extent though! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig

Re: Best Practices for Python Script Development?

2006-08-25 Thread Nick Craig-Wood
on programming with TK is very good too - I keep coming back to that section. ... I'd recommend the first and the last from your list to start with, Dive into Python and Programming Python. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: Can Python do Perl's print EOF; notation? - popen, subprocess works?

2006-08-24 Thread Nick Craig-Wood
) one two three four As does this using stdin cmds=read A ... read B ... read C ... echo $C $B $A out = Popen(cmds, shell=True, stdin=PIPE) out.communicate(one ... two ... three) three two one (None, None) -- Nick Craig

Re: Py_BuildValue(I, ...) does not work

2006-08-21 Thread Nick Craig-Wood
-4)] on linux2 Type help, copyright, credits or license for more information. import mini mini.foo() 3735928495L -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Subprocess confusion: how file-like must stdin be?

2006-08-18 Thread Nick Craig-Wood
, line 534, in __init__ (p2cread, p2cwrite, File /usr/lib/python2.4/subprocess.py, line 830, in _get_handles p2cread = stdin.fileno() AttributeError: StringIO instance has no attribute 'fileno' -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: How to force a thread to stop

2006-07-27 Thread Nick Craig-Wood
.kill() thread2.join() print Done -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads vs Processes

2006-07-27 Thread Nick Craig-Wood
__main__ import fork_test, fork_test()]) print Threading timeit.main([-s, from __main__ import thread_test, thread_test()]) if __name__ == __main__: main() -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess module

2006-07-27 Thread Nick Craig-Wood
for trouble with argument quoting. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: PySNMP Thread unsafe?

2006-07-27 Thread Nick Craig-Wood
for twisted not threads? You'd be able to poll all 250 devices at once with twisted... This might be helpful (haven't tried it myself though) http://twistedsnmp.sourceforge.net/ -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python

Re: Tkinter and exceptions

2006-07-26 Thread Nick Craig-Wood
Peter Otten [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: How do you catch general exceptions in a Tkinter program. Overriding report_callback_exception() seems to work: Thank you. That is exactly what I needed to know! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com

Tkinter and exceptions

2006-07-25 Thread Nick Craig-Wood
): raise ValueError(Exception) def make_callback_exception(self): self.bang = 1 if __name__ == __main__: AppDemo().mainloop() -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: range() is not the best way to check range?

2006-07-18 Thread Nick Craig-Wood
): if 0 = i 1: a += 1 dt = time.time() - start print comparison) That took %.3f seconds: result %s % (dt, a) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: time.clock()

2006-07-17 Thread Nick Craig-Wood
of just that process. I think the precisions are the other way round on windows. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: How to delete a Python package

2006-07-13 Thread Nick Craig-Wood
time so far! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter problem

2006-07-08 Thread Nick Craig-Wood
= /lib/tls/i686/cmov/libdl.so.2 (0xb7aa5000) /lib/ld-linux.so.2 (0x8000) If there are any missing things then you need to re-install those packages. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: defining multi dimensional array

2006-07-05 Thread Nick Craig-Wood
if you are doing heavy numerical work. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Fork You.. Forking and threading..

2006-07-05 Thread Nick Craig-Wood
from your job and it exits from the process group. You could probably close / redirect stdin/out/err too. Search for daemonize.py and you'll find a module which does all this. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: Time out question

2006-07-04 Thread Nick Craig-Wood
Grant Edwards [EMAIL PROTECTED] wrote: On 2006-07-03, Nick Craig-Wood [EMAIL PROTECTED] wrote: Alex Martelli [EMAIL PROTECTED] wrote: DarkBlue [EMAIL PROTECTED] wrote: try for 10 seconds if database.connected : do your remote thing except raise after 10 seconds

Re: Time out question

2006-07-03 Thread Nick Craig-Wood
, False, 7, _test_time_limit, nested #12a,False, 6, _test_time_limit, nested #12b,False, 10, _spin, 5) print All tests OK test() -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org

Re: Problem when import C model

2006-07-03 Thread Nick Craig-Wood
int main(void) { printf(Hello\n); return 0; } #END gcc -c -m32 -o z32.o z.c gcc -c -m64 -o z64.o z.c file z*.o gives z32.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped z64.o: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), not stripped -- Nick Craig

<    3   4   5   6   7   8   9   10   11   >