Re: ISBN Barecode reader in Python?

2008-05-04 Thread Nick Craig-Wood
? As it is a hobby project, I don't like to spend money on the SDK. Pick yourself up a cue-cat barcode reader, eg from here or ebay http://www.librarything.com/cuecat These appear as a keyboard and type the barcode in to your program. Cheap and effective. -- Nick Craig-Wood [EMAIL PROTECTED

Re: portable fork+exec/spawn

2008-05-03 Thread Nick Craig-Wood
on this eventually http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IReactorProcess.html Looks interesting - I'll have to try it next time I'm reaching for pexpect Thanks Nick -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org

Re: Help with pyserial and sending binary data?

2008-05-03 Thread Nick Craig-Wood
. After that it is usually plain sailing! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question - probably FAQ (but not exactly answered by regular FAQ)

2008-05-03 Thread Nick Craig-Wood
python 2.2 so you would be limited to 2.2 features in that case. No big deal in my opinion. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-03 Thread Nick Craig-Wood
, but Python is a high-level language anyway ...)? sum() gets used for any numerical types not just floats... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: portable fork+exec/spawn

2008-05-02 Thread Nick Craig-Wood
type jobs. For jobs which require interactivity ie send input, receive output, send input, receive output, ... it doesn't work well. There isn't a good cross platform solution for this yet. pyexpect works well under unix and is hopefully being ported to windows soon. -- Nick Craig-Wood [EMAIL

Need help: Compiling Python-Code In-Reply-To=

2008-05-02 Thread CRAIG DALTON
)) shutil.copyfileobj(g,f) g.close() f.close() Any help would be great. Thanks, Craig Dalton Business Applications Systems Analyst Sentara Healthcare Systems Information Technology [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to store config or preferences in a multi-platform way.

2008-05-01 Thread Nick Craig-Wood
): os.makedirs(self.config_dir, mode=0700) self.config_file = os.path.join(self.config_dir, config) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Question regarding Queue object

2008-04-29 Thread Nick Craig-Wood
Terry [EMAIL PROTECTED] wrote: On Apr 28, 5:30 pm, Nick Craig-Wood [EMAIL PROTECTED] wrote: David [EMAIL PROTECTED] wrote: Another idea would be to have multiple queues, one per thread or per message type group. The producer thread pushes into the appropriate queues (through

Re: Receive data from socket stream

2008-04-29 Thread Nick Craig-Wood
+= rx return message Sorry I mis-understood your original post! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Receive data from socket stream

2008-04-29 Thread Nick Craig-Wood
Hrvoje Niksic [EMAIL PROTECTED] wrote: Nick Craig-Wood [EMAIL PROTECTED] writes: Note that appending to a string is almost never a good idea, since it can result in quadratic allocation. My aim was clear exposition rather than the ultimate performance! That would normally be fine

Re: Question regarding Queue object

2008-04-28 Thread Nick Craig-Wood
to do is Queue.get() and be sure they've got a message they can deal with. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Receive data from socket stream

2008-04-28 Thread Nick Craig-Wood
These calls return the number of bytes received, or -1 if an error occurred. The return value will be 0 when the peer has performed an orderly shutdown. In the -1 case python will raise a socket.error. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick

Re: Receive data from socket stream

2008-04-28 Thread Nick Craig-Wood
it would get much use! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression - Matching Multiples of 3 Characters exactly.

2008-04-28 Thread Nick Craig-Wood
a quick idea of what the answers might be. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Receive data from socket stream

2008-04-28 Thread Nick Craig-Wood
Hrvoje Niksic [EMAIL PROTECTED] wrote: Nick Craig-Wood [EMAIL PROTECTED] writes: What you are missing is that if the recv ever returns no bytes at all then the other end has closed the connection. So something like this is the correct thing to write :- data = while True

Re: function that accepts any amount of arguments?

2008-04-25 Thread Nick Craig-Wood
wrote untested. I clearly wasn't pair programming when I wrote this post ;-) Posting to comp.lang.python is pair programming with the entire internet ;-) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Little novice program written in Python

2008-04-25 Thread Nick Craig-Wood
you are up to speed in python I suggest you check out gmpy for number theory algorithms. Eg :- import gmpy p = 2 while 1: print p p = gmpy.next_prime(p) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: subprocess module is sorely deficient?

2008-04-23 Thread Nick Craig-Wood
sorts of other systems. We recently received funding from Microsoft to do a native port of Sage (and all of its components to Windows. Part of this will most likely be a port of pexpect to Windows. Hooray! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: [Python 2.4/2.5] subprocess module is sorely deficient?

2008-04-22 Thread Nick Craig-Wood
OSError: return -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python 2.4/2.5] subprocess module is sorely deficient?

2008-04-22 Thread Nick Craig-Wood
Mark Wooding [EMAIL PROTECTED] wrote: Nick Craig-Wood [EMAIL PROTECTED] wrote: Harishankar [EMAIL PROTECTED] wrote: 1. Create non-blocking pipes which can be read in a separate thread [...] You are correct on both of those points. I must be missing something. What's wrong

Re: I just killed GIL!!!

2008-04-18 Thread Nick Craig-Wood
objects that provide an explicit API for use between threads are also shareable. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: is file open in system ? - other than lsof

2008-04-17 Thread Nick Craig-Wood
[link]))) You might want to consider http://pyinotify.sourceforge.net/ depending on exactly what you are doing... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python

Re: bsddb3 thread problem

2008-04-02 Thread Nick Craig-Wood
probably make bsddb work with threads, but I wasted too much time trying without success! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: bsddb3 thread problem

2008-04-01 Thread Nick Craig-Wood
to get it to behave when threading. I gave up in the end and changed to sqlite :-( At least if you make a mistake with sqlite and use the wrong handle in the wrong place when threading it gives you a very clear error. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: Homework help

2008-04-01 Thread Nick Craig-Wood
an item and a lst of items and returns the number of times item occurs in lst. For example, howMany(3,[1,2,3,2,3]) should return 2. Read section 4.1, 4.2 and 4.6 from here http://docs.python.org/tut/node6.html -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: Need help calling a proprietary C DLL from Python

2008-03-26 Thread Craig
On Mar 26, 12:24 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Tue, 25 Mar 2008 08:24:13 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: 41 0 0 0 7 0 0 0 Which makes sense for two reasons: 1. It would only return the non-space-filled part

Re: Need help calling a proprietary C DLL from Python

2008-03-25 Thread Craig
On Mar 25, 2:02 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Mon, 24 Mar 2008 15:21:11 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: And this is what I got: VmxGet test - looking for valid record... Before -PriKey = 0x0044F56C,SecKey

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 23, 7:59 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: This dll was designed to be used from either C or Visual Basic 6. I have the declare statements for VB6

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 24, 12:27 pm, Craig [EMAIL PROTECTED] wrote: On Mar 23, 7:59 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: This dll was designed to be used from either C or Visual

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 24, 3:45 pm, Craig [EMAIL PROTECTED] wrote: On Mar 24, 12:27 pm, Craig [EMAIL PROTECTED] wrote: On Mar 23, 7:59 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python

Re: Need help calling a proprietary C DLL from Python

2008-03-23 Thread Craig
On Mar 23, 4:48 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sat, 22 Mar 2008 19:05:31 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: I got back exactly what I expected for TypeDef, but SecKey and PriKey were what I initialized them to , not what

Re: Need help calling a proprietary C DLL from Python

2008-03-22 Thread Craig
On Mar 21, 4:04 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 20 Mar 2008 16:50:18 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: I received a direct email from someone, and I came up with the following after implementing his advice

Re: Need help calling a proprietary C DLL from Python

2008-03-22 Thread Craig
On Mar 22, 3:13 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Fri, 21 Mar 2008 23:21:48 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: Sorry, I wasn't trying to exclude any credit from Dennis, I just wasn't sure if he wanted to be listed

Re: Need help calling a proprietary C DLL from Python

2008-03-22 Thread Craig
On Mar 22, 9:40 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sat, 22 Mar 2008 15:12:47 -0700 (PDT), Craig [EMAIL PROTECTED] declaimed the following in comp.lang.python: Anyway, I have the following for types: LPBSTR = POINTER(c_void_p) HANDLE = POINTER(POINTER(c_long)) LPHANDLE

Re: Anomaly in time.clock()

2008-03-22 Thread Craig
On Mar 22, 10:03 pm, Tim Roberts [EMAIL PROTECTED] wrote: Godzilla [EMAIL PROTECTED] wrote: Just found out that win32api.GetTickCount() returns a tick count in milli-second since XP started. Not sure whether that is reliable. Anyone uses that for calculating elapsed time? What do you mean

Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
I use a proprietary dll from Software Source (vbis5032.dll). I have successfully used it from Visual Basic 6, Fujitsu Cobol and from Perl. I would now like to use it from Python. The following is the C++ prototype for one of the functions: short FAR PASCAL VmxOpen(BSTR*Filespec,

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 2:29 pm, sturlamolden [EMAIL PROTECTED] wrote: On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote: The culprit i here: Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0 This binds these names to Python ints, but byref expects C types. Also observe that CacheSize

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 2:38 pm, Craig [EMAIL PROTECTED] wrote: On Mar 20, 2:29 pm, sturlamolden [EMAIL PROTECTED] wrote: On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote: The culprit i here: Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0 This binds these names to Python ints, but byref

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 4:55 pm, Chris Mellon [EMAIL PROTECTED] wrote: On Thu, Mar 20, 2008 at 3:42 PM, Craig [EMAIL PROTECTED] wrote: On Mar 20, 2:38 pm, Craig [EMAIL PROTECTED] wrote: On Mar 20, 2:29 pm, sturlamolden [EMAIL PROTECTED] wrote: On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 6:26 pm, sturlamolden [EMAIL PROTECTED] wrote: On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote: The following is the C++ prototype for one of the functions: short FAR PASCAL VmxOpen(BSTR*Filespec, LPSHORT lpLocatorSize

Re: Writing Memory to File

2008-03-10 Thread Nick Craig-Wood
things will require the relevant rights and neither is quite as easy as you might hope for! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Strangle 0.3.0 DNS parsing library based on BIND9

2008-02-25 Thread Nick Craig-Wood
couldn't see one? Having a simple nameserver written in python would be very useful indeed... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding Priority Scheduling feature to the subprocess

2008-02-25 Thread Nick Craig-Wood
TimeHorse [EMAIL PROTECTED] wrote: On Feb 22, 4:30 am, Nick Craig-Wood [EMAIL PROTECTED] wrote: Interestingly enough this was changed in recent linux kernels. Process levels in linus kernels are logarithmic now, whereas before they weren't (but I wouldn't like to say exactly what

Re: Adding Priority Scheduling feature to the subprocess

2008-02-22 Thread Nick Craig-Wood
it across OSes unfortunately :-( -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Garbage collection

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

Re: ways to declare empty set variable

2008-02-13 Thread Nick Craig-Wood
though... eg { (1,2,3) : 'a', (4,5,6) : 'b' } vs dict([ ((1,2,3), 'a'), ((4,5,6), 'b') ]) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: best(fastest) way to send and get lists from files

2008-02-05 Thread Nick Craig-Wood
for list size 10 Read back 10 items in 0.0175776958466 s Written 505 bytes for list size 100 Read back 100 items in 0.175704598427 s -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Does anyone else use this little idiom?

2008-02-05 Thread Nick Craig-Wood
is fairly common in python too wanted, _, _, _, also_wanted = a_list which looks quite neat to my eyes. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: piping into a python script

2008-01-25 Thread Nick Craig-Wood
file name is also allowed. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: A GUI framework for running simulations

2008-01-24 Thread Nick Craig-Wood
you can plot the result of your simulation. You can draw a few buttons (like play and stop) and detect clicks in them very easily. If you want loads of parameters then you'll either need to reach for a GUI toolkit or roll your own menuing system for pygame (which isn't that hard). -- Nick Craig

Re: where do my python files go in linux?

2008-01-14 Thread Nick Craig-Wood
it installes to ensure ovewrites can't happen etc... /usr/local/bin is for stuff installed from source, not using the package manager. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Threaded server

2008-01-14 Thread Nick Craig-Wood
understand correctly). I expect if you put a self.join() at the end of the stop() method the problem will go away. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: where do my python files go in linux?

2008-01-14 Thread Nick Craig-Wood
these create particularly policy compliant .debs but they are good enough for local usage. Meanwhile, even stdeb [1] doesn't appear to completely automate the production of Debian packages using distutils. Looks interesting though! [1] http://stdeb.python-hosting.com/ -- Nick Craig-Wood

Re: urllib2 rate limiting

2008-01-11 Thread Nick Craig-Wood
16.090267.1 kBytes/s Sleep for 0.499293088913 1432 kb of 10118 kb downloaded 16.089760.1 kBytes/s Sleep for 0.499292135239 1440 kb of 10118 kb downloaded 16.089254.1 kBytes/s Sleep for 0.499267101288 ... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org

Re: python recursive function

2008-01-11 Thread Nick Craig-Wood
90 maximum recursion depth exceeded 91 False 92 False 93 93 maximum recursion depth exceeded 94 False 95 False 96 96 maximum recursion depth exceeded 97 False 98 False 99 99 maximum recursion depth exceeded -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

newbie question regarding int(input(:))

2008-01-11 Thread Craig Ward
Hi experts! I am trying to write a menu script that will execute bash scripts. Everything is fine until the script executes and I want to see if there are any more options to run before quitting. Example: def menu(opt1 = something, opt2 = something else): -- Computers are like air

Fwd: newbie question regarding int(input(:)) - sorry for the spam

2008-01-11 Thread Craig Ward
my choice variable is not defined. can someone please enlighten me? :-) -- Forwarded message -- From: Craig Ward [EMAIL PROTECTED] Date: Jan 11, 2008 11:21 AM Subject: newbie question regarding int(input(:)) To: python-list@python.org Hi experts! I am trying to write a menu

Re: Canonical way of deleting elements from lists

2008-01-09 Thread Nick Craig-Wood
or may not be what you want! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Canonical way of deleting elements from lists

2008-01-09 Thread Nick Craig-Wood
Fredrik Lundh [EMAIL PROTECTED] wrote: Nick Craig-Wood wrote: Using keywords[:] stops the creation of another temporary list. in CPython, list[:] = iter actually creates a temporary list object on the inside, in case iter isn't already a list or a tuple. (see the implementation

Re: Why python says unexpected parameter 'mini.py' for my code?

2008-01-04 Thread Nick Craig-Wood
. Can somebody give me a hint to let it work well? Thanks I tried it but it doesn't work at all on linux. I suggest you use wxPython and stop re-inventing the wheel! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: int vs long

2007-12-20 Thread Nick Craig-Wood
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Nick Craig-Wood nic...od.com wrote: So you might see longs returned when you expected ints if the result was = 0x800. did you mean 0x8000 ? ;-) Yes - well spotted! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com

Re: int vs long

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

Re: Equivalent of perl's Pod::Usage?

2007-12-10 Thread Nick Craig-Wood
sys.exit(1) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Thought you would enjoy some funny math cartoons!!!

2007-12-06 Thread craig . snodgrass
. Thanks, Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: spawning a process with subprocess

2007-11-27 Thread Nick Craig-Wood
... waiting on child... waiting on child... waiting on child... returncode = 42 Received 11 lines of 488895 bytes total -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble selling twisted

2007-11-27 Thread Nick Craig-Wood
it uses. is there an exaample of going thru a passworded proxy using twisted client classes? i have trouble understanding how to adapt the proxy example on page 58 in the twisted book to my needs. I advise looking at the twisted source code! -- Nick Craig-Wood [EMAIL PROTECTED] -- http

Re: import pysqlite2 or import sqlite3?

2007-11-25 Thread Nick Craig-Wood
import sqlite3 set(dir(sqlite3)) ^ set(dir(dbapi2)) set(['__path__', 'dbapi2']) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Subprocess and 16-bit FORTRAN

2007-11-25 Thread Nick Craig-Wood
blocking subprocess modification here http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 You could also try wx.Process and wx.Execute from wxPython. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Which uses less memory?

2007-11-17 Thread Nick Craig-Wood
attribute is minimal (4 bytes per instance I think). No idea about Hessian or Stomp (never heard of them!) but classes with __slot__s are normal classes which would pickle or unpickle. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo

Re: Creating Installer or Executable in Python

2007-11-15 Thread Nick Craig-Wood
app into a single exe which you can just run which may be good enough (no need for an installer). -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-04 Thread Nick Craig-Wood
not really sure what the differences are between those two. The latter seems to be a little more active. Pygame is the way I've always done SDL stuff in python - never even heard of PySDL! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman

Re: Iteration for Factorials

2007-10-30 Thread Nick Craig-Wood
) if number == myNumer: count+=1 return int(I*1.0/count+.5) ;-) Note you can write your middle loop as for i in range(I): number = myNumer[:] random.shuffle(number) if number == myNumer: count+=1 -- Nick Craig-Wood [EMAIL

Re: cron, python and samba restart

2007-10-29 Thread Nick Craig-Wood
who must run the cron job) should eliminate the error. Note that you will also need to disable authentication either via the NOPASSWD tag or the authenticate Defaults option. Check the PATH in cron also -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: bug: subprocess.Popen() hangs

2007-10-26 Thread Nick Craig-Wood
the problem? You are best off reporting bugs here - then they won't get lost! http://bugs.python.org/ -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration for Factorials

2007-10-24 Thread Nick Craig-Wood
**(n-0.5))*math.sqrt(2*math.pi)*(1. + 1./12/n + 1./288/n**2 - 139./51840/n**3) Works for non integer factorials also... See here for background http://mathworld.wolfram.com/StirlingsSeries.html -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org

Re: Cross-platform GUI development

2007-10-12 Thread Nick Craig-Wood
becase 1) native look and feel on all platforms 2) doesn't require expensive licensing for non-commercial apps (QT) 3) Isn't a pain to install on windows (GTK) That said, times change and 1-3 may have changed since I last looked at it! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig

Re: changes on disk not visible to script ?

2007-10-08 Thread Nick Craig-Wood
vague. The above code has a syntax error in it so obviously isn't from working code. PS I really doubt the problem is windows not seeing the created file... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Adding extra modules to a Pyinstaller build

2007-10-08 Thread Craig
to the project? Regards, Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: changes on disk not visible to script ?

2007-10-08 Thread Nick Craig-Wood
the () in f.close() ! thanks for pointing that out. VB programmer!? Thats really harsh.. I used to make that mistake a lot as an ex-perl programmer. I think ruby is the same. pychecker will warn about it though. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http

Re: How to create a file on users XP desktop

2007-10-07 Thread Craig Howard
On Oct 6, 2007, at 11:31 PM, goldtech wrote: Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm looking for is an

Re: Cross platform way of finding number of processors on a machine?

2007-10-06 Thread Nick Craig-Wood
if num = 1: return num else: raise NotImplementedError There is a bug in that code... NotImplementedError will never be raised because num won't have been set. It will raise UnboundLocalError: local variable 'num' referenced before assignment instead -- Nick Craig

Re: unit testing

2007-10-05 Thread Craig Howard
. Unit testing was the only way to ensure it worked without disrupting the plant operation. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform way of finding number of processors on a machine?

2007-10-05 Thread Nick Craig-Wood
import os os.sysconf('SC_NPROCESSORS_ONLN') 2 (From my Core 2 Duo laptop running linux) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Using fractions instead of floats

2007-10-01 Thread Nick Craig-Wood
(1,3)*mpq(6,10)*mpq(4,10)+mpq(7,8) mpq(191,200) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-26 Thread Nick Craig-Wood
connection - it is just accessed from a different process. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-24 Thread Nick Craig-Wood
! A python module to do it would be great! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Finding prime numbers

2007-09-20 Thread Nick Craig-Wood
Cheating perhaps! Note is_prime will be a probabalistic test for large numbers... -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: compile for ARM

2007-09-20 Thread Nick Craig-Wood
build our app which has python embedded for ARM using a cross compiler running under debian. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest tutorial

2007-09-20 Thread Nick Craig-Wood
Gigs_ [EMAIL PROTECTED] wrote: does anyone know some good tutorial for unittest? (with examples how unit work)? There is one in Dive into Python http://www.diveintopython.org/unit_testing/index.html Buy the book is my advice! -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig

Re: tempfile.mkstemp and os.fdopen

2007-08-29 Thread Nick Craig-Wood
: os.readlink(/proc/%d/fd/%d % (os.getpid(), fileno)) A good idea! You can write this slightly more succinctly as os.readlink(/proc/self/fd/%d % fileno) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Haskell like (c:cs) syntax

2007-08-29 Thread Nick Craig-Wood
Erik Jones [EMAIL PROTECTED] wrote: front, last = l[:len(l) - 1], l[len(l) - 1] Normally written as front, last = l[:-1], l[-1] -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to read large files from zip

2007-08-29 Thread Nick Craig-Wood
the patch to the python bug tracker and you'll get that nice glow from helping others! Remember python is open source and is made by *us* for *us* :-) If you need help fixing zipfile.py then you'd probably be better off asking on python-dev. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig

Re: Python's Suitability?

2007-08-28 Thread Nick Craig-Wood
I'm only looking for some initial guidance from the Python users. TIA Go for it! Python is such an easy language to write stuff in (escpecially compared to C++) that you'll have the prototype done very quickly and you can evaluate the rest of your concerns with working code! -- Nick Craig

Re: tempfile.mkstemp and os.fdopen

2007-08-28 Thread Nick Craig-Wood
at least (dunno about windows) unless your dir is on NFS. If you want more security then make sure dir isn't publically writeable. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: File Read Cache - How to purge?

2007-08-22 Thread Nick Craig-Wood
Hrvoje Niksic [EMAIL PROTECTED] wrote: Nick Craig-Wood [EMAIL PROTECTED] writes: If you are running linux 2.6.18 then you can use /proc/sys/vm/drop_caches for exactly that purpose. http://www.linuxinsight.com/proc_sys_vm_drop_caches.html That URL claims that you need to run sync

Re: Error with long running web spider

2007-08-22 Thread Nick Craig-Wood
strace the process to see what it is doing. There are windwows strace programs (which I've never tried) too! You'll probably find it is wedged in TCP socket code. -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: File Read Cache - How to purge?

2007-08-21 Thread Nick Craig-Wood
91284 # echo 3 /proc/sys/vm/drop_caches # free total used free sharedbuffers cached Mem: 1036396 588228 448168 0692 91808 -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org

Re: File Read Cache - How to purge?

2007-08-21 Thread Nick Craig-Wood
...) -- Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent of Perl's $/

2007-08-20 Thread Nick Craig-Wood
boundary. Combined with Perl's 'while ()' construct this seems a great way to process the files I am interested in. Without wishing to start a flame war, is there a way to do this in Python? for para in re.split(r\.\n, input_data): print para = %r % para -- Nick Craig-Wood [EMAIL PROTECTED

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