Re: how can I avoid abusing lists?

2006-07-07 Thread Rob Cowie
No, your question was clear. With hindsght and a more thorough read of your post I see my error ;^) -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython: how does EVT_IDLE work?

2006-07-10 Thread Rob Williscroft
event.RequestMore(True) > self.count += 1 > if self.count >= 50: > self.count = 0 Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: django's view.py as class not just methods

2006-08-25 Thread Rob Wolfe
request to detail", 25) print download("request to download", "abc", 99) print print "\n".join(view_obj.visited) index, detail and download functions can be mapped in urls.py now. -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: time.clock() going backwards??

2006-08-28 Thread Rob Williscroft
, only that the counters are several million cycles apart, IOW running at the same speed but with different initial values, or more likely starting at different times. For processors that run at (say) 2GHz, several million (say 10 million) represents a difference of 10e6/2e9 = 0.005 se

Re: NEED HELP

2006-08-29 Thread Rob Wolfe
None): > print "hello" > > w.bind("", do_popup) > > b = Button(root, text="Quit", command=root.destroy) > b.pack() > > mainloop() Here's a great tutorial: http://www.effbot.org/tkinterbook/tkinter-hello-again.htm HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: wxNotebook color change

2006-08-31 Thread Rob Wolfe
rm1") form2 = wx.Panel(nb, -1) form2.SetBackgroundColour(wx.RED) nb.AddPage(form2, "Form2") nb.SetSelection(1) frame.Refresh() frame.Show(True) app.MainLoop() HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: wxNotebook color change

2006-08-31 Thread Rob Wolfe
> not red, but grey as labels. > > I want to color this space RED!!! Oh, I see now. I don't know if that is possible on windows. SetBackgroundColour works differently on windows than on unix, so probably native windows widget doesn't support this feature. (but I can be wrong of course.) Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclassing Tkinter Buttons

2006-09-01 Thread Rob Wolfe
ton options for example: {"text": "Hello", "padx": 2} 4. change value of element "padx" or add this element to dictionary kw 5. call parent __init__ method to create button HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: threading support in python

2006-09-04 Thread Rob Williscroft
ast 2 python implementations, so why worry about another one. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Javadoc style python manual?

2006-09-08 Thread Rob Wolfe
methods etc in html docs. It's very easy for me to > understand the Java language. > But in python, i find it kind of inconvient. > > Any advice? With AcitvePython is distributed the htmlhelp version of python reference (ActivePython24.chm). It's really convinient to use. HT

Re: convert loop to list comprehension

2006-09-08 Thread Rob Williscroft
for x in [a] * seq[a]: tmp.append( x ) >>> tmp [0, 0, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3] >>> IOW a comprehension appends rather than extends. Other than that you move the value you're appending from the inside of the loop('s) to the begining of the comprehension then remove newlines and colon's [inside some brakets ofcourse]. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL cannot open TIFF image in Windows

2006-09-09 Thread Rob Williscroft
wouldn't load some of the images too (I didn't test all), it had problems with 64 bit floating point images and images with RBGA data in them. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

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

2006-09-11 Thread Rob Wolfe
a python solution would be > better (although this will run on unix anyway, but it'd be nice if it > ran on windows too). IMHO this is pretty portable: >>> def is_on_path(fname): ... for p in os.environ['PATH'].split(os.pathsep): ... if os.path.isfile(os

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

2006-09-11 Thread Rob Wolfe
Steve Holden <[EMAIL PROTECTED]> writes: > Rob Wolfe wrote: >> Hari Sekhon wrote: >> >>>I am writing a wrapper to a binary command to run it and then do >>>something with the xml output from it. >>> >>>What is the best way of making sure th

Re: error

2006-09-12 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi, [...] > Step 3: Wrote the given script of multipication in a file named as > multiply (using vi editor) The name of module should be multiply.py HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: error

2006-09-12 Thread Rob Wolfe
John Machin wrote: > Rob Wolfe wrote: > > [EMAIL PROTECTED] wrote: > > > Hi, > > [...] > > > Step 3: Wrote the given script of multipication in a file named as > > > multiply (using vi editor) > > > > The name of module should be multiply.p

Re: How to compare to directories?

2006-09-13 Thread Rob Wolfe
; So, how can I do it in python? Here is a nice example: http://docs.python.org/lib/os-file-dir.html Look for description of function walk. HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: xinclude and pathnames

2006-09-14 Thread Rob Williscroft
t; part of the system since I've basically programmed myself into a >> corner. >> According to the docs: http://effbot.org/zone/element-xinclude.htm The default handler just sees the href value as a filename, so you should be able to use a relative path if you os.chdir() to th

Re: Cross-process dictionary/hashtable

2006-09-18 Thread Rob Wolfe
"Sandra-24" <[EMAIL PROTECTED]> writes: > A dictionary that can be shared across processes without being > marshaled? > > Is there such a thing already for python? Check this out: http://poshmodule.sourceforge.net/ -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: jpype package, could be path problem

2006-09-20 Thread Rob Wolfe
bjvm.so','-ea') # that's better import jpype jpype.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea') # for long names of modules import jpype as jp jp.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea') And see this: http://docs.python.org/tut/node8.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: jpype package, could be path problem

2006-09-20 Thread Rob Wolfe
. "from jpype import" This enters the name of the function startJVM in the currrent symbol table, so you can access the function just like that: startJVM() And have you read this: http://docs.python.org/tut/node8.html ? HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Working with email and mailbox module

2006-09-21 Thread Rob Williscroft
): print msg.__class__ for i in msg.keys(): # gets header names print i break fmbx.close() http://docs.python.org/lib/module-email.Message.html Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils on Windows with VC++ 8

2006-09-22 Thread Rob Williscroft
kit; Microsoft took it off the net, > but Google may still be able to help I think the VS 2003 toolkit is a framework for extending Visual Studio 2003, IOW a bunch of .NET dlls, some examples and a helpfile (no compiler). Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils on Windows with VC++ 8

2006-09-22 Thread Rob Williscroft
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= wrote in news:4514479B.5070808 @v.loewis.de in comp.lang.python: > Rob Williscroft schrieb: >> Download the 1.1 SDK: >> >> http://www.microsoft.com/downloads/details.aspx?familyid=9B3A2CA6- >> 3647-4070-9F41-A333C6B9181D&am

Re: distutils on Windows with VC++ 8

2006-09-23 Thread Rob Williscroft
Rob Williscroft wrote in news:Xns9846DDC7A18E0rtwfreenetREMOVEcouk@ 216.196.109.145 in comp.lang.python: >> That's yet another option. Somebody reported that the compiler in the >> .NET SDK won't support generating optimized code, though. That's a >> problem fo

ANN: PyDSTool v0.83.3 released

2006-09-23 Thread Rob Clewley
ound enforcement on state variables and parameters. There are several bug fixes and general improvements to the API in this release too. Please see http://pydstool.sourceforge.net for details and documentation. Regards, Rob, Drew, and Erik. Center for Applied Mathematics, Cor

python-list@python.org

2006-09-24 Thread Rob Williscroft
nd' ] = HelloMolly Where HelloMolly is an already defined python callable, for example: def HelloMolly(): self.tts.Speak ('hello molly') The above defenition of HelloMolly requires that somtime before it is called, self.tts is created: self.tts = pyTTS.Create() HTH.

Re: Printing a percent sign

2006-09-25 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Hi all. How do I escape the "%" sign in a print statement so that it > prints? Thanks. > print "%%" Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a percent sign

2006-09-25 Thread Rob Williscroft
Rob Williscroft wrote in news:Xns9849DC7DB4102rtwfreenetREMOVEcouk@ 216.196.109.145 in comp.lang.python: > wrote in news:[EMAIL PROTECTED] in > comp.lang.python: > >> Hi all. How do I escape the "%" sign in a print statement so that it >> prints? Thanks. >>

Re: iterator question

2006-09-26 Thread Rob Williscroft
(seq[::2], seq[1::2] + [None]) [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9), (10, None)] >>> seq = range(10) >>> zip(seq[::2], seq[1::2] + [None]) [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)] Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread Rob Williscroft
Rob Williscroft wrote in news:Xns984ACDA635C9rtwfreenetREMOVEcouk@ 216.196.109.145 in comp.lang.python: >>>> seq = range(11) >>>> zip(seq[::2], seq[1::2] + [None]) > [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9), (10, None)] > >>>> seq = range(10) >>&g

Re: How to change menu text with Tkinter?

2006-09-27 Thread Rob Wolfe
them usiing different > labels. This seems very clunky though, and there must be a better way. > Can anyone offer any pointers or a short example for how to do this? Try this: menu.entryconfig(index, label="new_name") HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: generator with subfunction calling yield

2006-09-27 Thread Rob Williscroft
nn() re-writen to return what you may have originaly expected: def nn(): def _nn(): print 'inside' yield 1 print 'before' for i in _nn(): yield i print 'after' So to forward another generator you need to iterate over it an

Re: Difference between two dates in seconds

2006-09-27 Thread Rob Williscroft
o see one of those > reasons. What you wrote, where ? > > Arguably a better solution would be to do this: > > seconds = td.days * 24*60*60 + td.seconds > > Still not ideal though, although that depends on just how often you > need to convert days to or from seconds. > > Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: PATCH: Speed up direct string concatenation by 20+%!

2006-09-29 Thread Rob Williscroft
ring all at once. On the python 3k list there is a thread about stings becoming "views", I think this is similar to what you are doing here. http://search.gmane.org/? query=string+view&author=&group=gmane.comp.python.python- 3000.devel&sort=relevance&DEFAULTOP=and&xP=

Re: Raw strings and escaping

2006-10-03 Thread Rob Williscroft
ifically, a raw string cannot end in a single backslash (since the backslash would escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the string, not as a line continuation. Rob. -- http://mail.pytho

Re: Instantiating an object when the type is only known at runtime

2006-10-03 Thread Rob Williscroft
eval(type) > return obj(row[table.c.name], row[table.c.handle]) > >>> m = __import__( "StringIO" ) >>> x = getattr( m, "StringIO" )() >>> x >>> Rob. -- http://mail.python.org/mailman/listinfo/python-list

Re: combining the path and fileinput modules

2006-11-23 Thread Rob Wolfe
if fileinput.isfirstline(): > if not re.search('^From ',line): > print line.rstrip('\n') > # just print all other lines > if not fileinput.isfirstline(): > print line.rstrip('\n') > fileinput.close() > # end of program -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Restart a thread

2006-11-25 Thread Rob Williscroft
un() method to be invoked in a separate thread of control. Note the 2nd line: This must be called at most once per thread object. so you simply can't restart a Thread object. [1] http://docs.python.org/lib/thread-objects.html Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: case insensitive dictionary

2006-11-25 Thread Rob Williscroft
other ): return self.lower() == other.lower() def __hash__( self ): return self.lower().__hash__() def __setitem__( self, k, v ): dict.__setitem__( self, idict.__istr( k ), v ) d = idict( a = 1, b = 2 ) d['A'] = 3 print d Rob. -- http://www.victim-prime.dsl.pip

Re: About alternatives to Matlab

2006-11-27 Thread Rob Purser
t it. We do add support for new hardware all the time, so I'd be interested in hearing about your application. All the best, -Rob -- Rob Purser Senior Team Lead, Connectivity Products The MathWorks [EMAIL PROTECTED] "sturlamolden" <[EMAIL PROTECTED]> wrote in message n

Re: super() and type()

2006-11-27 Thread Rob Williscroft
ope, the type argument to super tells it where you are in the type hierarchy, type(self) is always the top of the hierarchy. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing file metadata on windows XP

2006-11-28 Thread Rob Williscroft
lcc/platform/shell/reference/objects/shellfolderitem/shellfolderit em.asp> Thats: MSDN Home > MSDN Library > Win32 and COM Development > User Interface > Windows Shell > Windows Shell > Shell Objects for Scripting and Microsoft Visual Basic > ShellFolderItem > Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about import and sys.path

2006-11-28 Thread Rob Wolfe
dule(impname, [company]) m = imp.load_module(impname, fp, pathname, description) return getattr(m, classname) obj = get_class("SomeClass", "prog1", "company1")() print obj.test() -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about import and sys.path

2006-11-29 Thread Rob Wolfe
as previously try...finally. I've tried it in 2.5 and it works perfectly. You have to use `from __future__ import with_statement`, though. This statement will be always enabled in Python 2.6. -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting recursion loops

2006-11-29 Thread Rob Wolfe
and stop it by > user-Exception (after N passes or some complex criteria) without passing a > recursion counter parameter through all the funcs? What about `sys.setrecursionlimit`? http://docs.python.org/lib/module-sys.html -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: get script path

2006-12-04 Thread Rob Wolfe
t("/home/hg/test/test.py") >>> dname '/home/hg/test' -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread Rob Thorpe
Mathias Panzenboeck wrote: > Mark Tarver wrote: > > How do you compare Python to Lisp? What specific advantages do you > > think that one has over the other? > > > > Note I'm not a Python person and I have no axes to grind here. This is > > just a question for my general education. > > > > Mark >

Re: merits of Lisp vs Python

2006-12-08 Thread Rob Thorpe
Alex Mizrahi wrote: > (message (Hello 'Kay) > (you :wrote :on '(8 Dec 2006 08:03:18 -0800)) > ( > > KS> http://www.sbcl.org/manual/Handling-of-Types.html#Handling-of-Types > > KS> If you'd read the docs of the tools you admire you might find the > KS> answers yourself. > > SBCL is a COMPILER th

Re: merits of Lisp vs Python

2006-12-08 Thread Rob Warnock
CLisp really blows its doors off. +--- On my various machines, CMUCL startup is *slightly* faster than CLISP, but both are under 20 ms... I use Common Lisp for scripting a *lot*! -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue htt

Re: merits of Lisp vs Python

2006-12-08 Thread Rob Warnock
Weird. This is exactly why I use *Lisp* -- because it stays completely readable even if you don't use it on a daily basis!!! [That's also why I *don't* use Perl, except when forced to...] -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue

Re: merits of Lisp vs Python

2006-12-09 Thread Rob Warnock
lly-specified, bug-ridden, slow implementation of half of Common Lisp." -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-09 Thread Rob Warnock
quot;good enough" for my purposes [given #2]. That's pretty much all you need to code in Lisp. It's what *I* use. So "I loathe Emacs" is *NOT* a believable excuse for avoiding Lisp... -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-09 Thread Rob Warnock
vert)? That's in ANSI. -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread Rob Thorpe
Juan R. wrote: > Ken Tilton ha escrito: > > You missed it? Google fight: > > > >http://www.googlefight.com/index.php?lang=en_GB&word1=Python&word2=Ruby > > > > Python wins, 74 to 69.3. And there is no Monty Ruby to help. > > > > ken > > Nice animation! > > http://www.googlefight.com/index.php?l

Re: merits of Lisp vs Python

2006-12-12 Thread Rob Thorpe
Paul Rubin wrote: > Pascal Costanza <[EMAIL PROTECTED]> writes: > Yes; I'd rather go by what the standard says than rely on > implementation-dependent hacks. But in that case what do you call Python? The whole language has no standard - is it an "implementation dependent hack"? Standards are us

Re: Problem understanding how closures work

2006-12-12 Thread Rob Williscroft
t; r = [] >>> for i in range(10): def f( i = i ): print i r.append( f ) >>> for i in r: i() In this example the value of "i" is bound to the default argument for the function "f" every time the def f() statments are executed. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
pies) everything through the matching paren into the anonymous buffer; "d%" deletes likewise [and saves in the anonymous buffer]; "p" (or "P") pastes after (or before) the current location. All can be prefixed with a buffer ("Q-register") name for more flexib

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
loadable tarball of the whole thing, there's a link near the bottom of this page: http://www.lispworks.com/documentation/HyperSpec/index.html -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
f course, that doesn't include the number of DEFUNs & DEFMACROs which are defined *by* macros, or the total of 2809 DEFINE-VOPs in the various flavors of the compiler...] -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Thorpe
Robert Uhl wrote: > Christophe <[EMAIL PROTECTED]> writes: > > Robert Uhl a écrit : > > > >> The argument from popularity is invalid. French units have overtaken > >> standard units, > > > > Never heard of that French unit thing. Unless you talk about that > > archaic unit system that was in use b

Re: Windows SetLocalTime

2006-12-13 Thread Rob Williscroft
mp;hl=en&q=setlocaltime+msdn&btnG=Google+Search> Adding site:msdn.microsoft.com is even better (but alas more typing): http://www.google.com/search?hl=en&lr=&client=firefox- a&rls=org.mozilla%3Aen-US%3Aofficial_s&q=setlocaltime+site% 3Amsdn.microsoft.com&btnG=Sea

Re: Windows SetLocalTime

2006-12-13 Thread Rob Williscroft
Podi wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> >> Google will usually find the documentation of anything in the >> Windows API however sometimes it also helps to add "msdn" to >> your search as in: > Yes, thank you

Re: merits of Lisp vs Python

2006-12-14 Thread Rob Thorpe
Bruno Desthuilliers wrote: > Mathias Panzenboeck a écrit : > > Rob Thorpe wrote: > > > >>Mathias Panzenboeck wrote: > >> > >>>Mark Tarver wrote: > >>> > >>>>How do you compare Python to Lisp? What specific advantages do

Re: Property error

2006-12-15 Thread Rob Williscroft
ef __init__(self): self._voltage = 10 @property def voltage(self): """Get the current voltage.""" return self._voltage Note the use of "read-only" in the above description and that the decorated function (voltage) *is* the

Re: first and last index as in matlab

2006-12-17 Thread Rob Williscroft
1]] or if you need something that can be generalised: [ind[i] for i in [0, -1]] so if you have: indexes_of_ind = [0, 2, -1, -2] you can write: [ind[i] for i in indexes_of_ind] Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-18 Thread Rob Warnock
eclare (optimize (speed 3) (debug 0) (safety 0))) (loop for i fixnum from 0 by 4 and v of-type (unsigned-byte 32) in values do (setf (system:sap-ref-32 (system:int-sap addr) i) v)) (values)) Most other Common Lisp implementations surely have something similar. -Rob

Re: merits of Lisp vs Python

2006-12-20 Thread Rob Thorpe
Anders J. Munch wrote: > jayessay wrote: > > Please note: GC is not part of CL's definition. It is likely not part > > of any Lisp's definition (for reasons that should be obvious), and for > > the same reasons likely not part of any language's definition. > > Really? So how do you write a port

Re: merits of Lisp vs Python

2006-12-20 Thread Rob Thorpe
Pascal Bourguignon wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > Anders J. Munch wrote: > >> jayessay wrote: > >> > Please note: GC is not part of CL's definition. It is likely not part > >> > of any Lisp's definition (

Re: merits of Lisp vs Python

2006-12-20 Thread Rob Thorpe
Anders J. Munch wrote: > Rob Thorpe wrote: > > Anders J. Munch wrote: > >> Really? So how do you write a portable program in CL, that is to > >> run for unbounded lengths of time? > > > > You can't. > > > > The thing about the spe

Re: merits of Lisp vs Python

2006-12-21 Thread Rob Thorpe
Anders J. Munch wrote: > Rob Thorpe wrote: > > Anders J. Munch wrote: > >> Let u(t) be the actual memory used by the program at time t. > >> Let r(t) be the size of reachable memory at time t. > >> > >> Require that u(t) is a member of O(t -> max{t&#

Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
s__; otherwise, the class attribute would overwrite the descriptor assignment. So its that the __slots__ assignment makes the descriptors and then the subsiquent method defenitions and class attribute bindings remove them. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
John Machin wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> John Machin wrote in news:1167008799.074885.250770@ >> 73g2000cwn.googlegroups.com in comp.lang.python: >> >> > Given a = Adder(), >> > a.tally = 0 >> &g

Re: where to find wx package

2007-01-05 Thread Rob Williscroft
ers in your programme from wxBlah to wx.Blah so: class MyFrame( wxFrame ): pass becomes class MyFrame( wx.Frame ): pass Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: good library for pdf

2006-01-26 Thread Rob Cowie
has a prebuilt action that applies a watermark to pdfs. Transparency, size and placement are all editable. Obviously, no use if you want to do this with Python, but it might suit your needs. Rob C -- http://mail.python.org/mailman/listinfo/python-list

Re: SLUT distibution mangled?

2006-01-29 Thread Rob Wolfe
the little "gotchas" involved in cross platform development. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange behavior of int()

2006-01-29 Thread Rob E
a=b/c if (a >= 0.0): d = int(a+0.5) else: d = int(a-0.5) If you don't do this sort of thing your programs generally are senstivie to the details of foating point rounding -- which is generally dependent on processor, compilier and in pythons case probably the runti

Separating elements from a list according to preceding element

2006-03-05 Thread Rob Cowie
gs to be excluded. My idea was to take an element, examine what element precedes it and accordingly, insert it into the relevant list. However, I have not been successful. Is there a better way that I have not considered? If this method is suitable, how might I implement it? Thanks all, Rob Cowie -- http://mail.python.org/mailman/listinfo/python-list

Re: Separating elements from a list according to preceding element

2006-03-06 Thread Rob Cowie
Thanks everyone. I assumed there was something I had not considered... list slicing is that thing. The pyParsing example looks interesting - but for this case, a little too heavy. It doesn't really warrant including a third party module. Rob C -- http://mail.python.org/mailman/listinfo/p

Help with choice of suitable Architecture

2005-05-28 Thread Rob Cowie
with Python. I'm not asking for a comparison of each architecture per se that seems to be well covered in this group. I would like to know how you all would set about creating this realtively simple application. Cheers, Rob Cowie Coventry University, Britain -- http://mail.python.o

Re: Help with choice of suitable Architecture

2005-05-28 Thread Rob Cowie
I agree with the sentiments that a single XML file is not the way to go for storing data that may be accessed concurrently. However, my hands are tied. It seems that CGI is likely to be the most straightforward option. Is the learning curve likely to be steeper for pure CGI or a web application ar

Re: Help with choice of suitable Architecture

2005-05-29 Thread Rob Cowie
Thanks for the comments. I kind of get the impression that CGI is the way to go for this application, and that I should forget about adding client-side scripting based functionality for the sake of accessibility - which I understand and kind of agree with. I'll look into the problem of concurrent

Re: Newbie Here

2005-05-31 Thread Rob Cowie
As a relalative newbie myself I think I can say Python is used for anything any major programming language is used for. One of its many strengths is scalability - it can be used to great effect as a scripting language AND as an object oriented language for creating large, GUI apps. Yours is not an

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Rob Cowie
Ha, I've just headed over here to ask the same thing! Any good ideas not listed on the wiki? I too am taking a Masters in Computer Science, however my first degree was not purely CS - mostly microbiology, so I'm not yet what one would call an expert Cheers -- http://mail.python.org/mailman/li

Re: Create our own python source repository

2005-06-07 Thread Rob Cowie
I'm not entirely sure what the point of your exercise is - if you have access to the net, ,why do you want to collate code examples? They are frequently updated in the cookbook so an offline repository would quickly become out of date. However you've aroused my interest in something related. W

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
: sleep(100) except KeyboardInterrupt: pass finally: if popen.poll() is None: print "killing process: %d" % popen.pid os.kill(popen.pid, signal.SIGTERM) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
ion childprocesses become zombies and there is no way to avoid that. -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding problem with web application (Paste+Mako)

2007-06-06 Thread Rob Wolfe
t_encoding`` parameters of ``Template``. Mako internally handles everything as Python unicode objects. For example: t = Template(filename="templ.mako", input_encoding="iso-8859-2", output_encoding="iso-8859-2") content = t.render(**context) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess call acts differently than command line call?

2007-06-07 Thread Rob Wolfe
ne terminators $ file acrotex/eqchange.txt acrotex/eqchange.txt: $ file acrotex/exerquiz.dtx acrotex/exerquiz.dtx: ISO-8859 English text, with CRLF line terminators $ file -v file-4.17 magic file from /etc/magic:/usr/share/file/magic $ uname -orvm 2.6.18-4-k7 #1 SMP Wed May 9 23:42:01 UTC 2007 i686 GNU/Linux That's really strange. Have you got only *one* version of ``file`` program on your machine? -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there any python jobs worked at home from the internet?

2007-06-11 Thread Rob Knapp
boyeestudio wrote: > Hi,all buddies. > Are there any python jobs worked at home from the internet? > I want to find a part time job. > Please give a clue to this for me. > Thanks a lot! This is probably going to sound like I'm telling you something you already know, but keep a close eye on the Pyt

Re: SimplePrograms challenge

2007-06-12 Thread Rob Wolfe
) except AttributeError: pass def start_a(self, attrs): href = [v for k, v in attrs if k == "href"] if href: self.urls.extend(href) parser = URLLister() parser.feed(page) parser.close() for url in parser.urls: print url -- Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: SimplePrograms challenge

2007-06-12 Thread Rob Wolfe
l It might be even one-liner: print "\n".join((url.get('href', '') for url in tree.findall(".//a"))) But as far as HTML (not XML) is concerned this is not very realistic solution. > > I know that the wiki page is supposed to be Python 2.4 only, but I'd > rather have no example than an outdated one. This example is by no means "outdated". -- Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
on an XML > parsing example instead? > > Thoughts? I vote for example with ElementTree (without xpath) with a mention of using ElementSoup for invalid HTML. -- Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
terator('tr'): amt, unit, item = ingredient.getchildren() if item.tag == "td" and item.text not in pantry: print "%s: %s %s" % (item.text, amt.text, unit.text) But if that's too complicated I will not insist on this. :) Your example is good enough. -- Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-14 Thread Rob Wolfe
umming there is a slick, pythonic way of doing this, besides > writing out a beast of a looping function. I've looked around on > activestate cookbook, but have come up empty handed. Any suggestions? You didn't try hard enough. :) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the current date, python 2.2

2007-06-15 Thread Rob Williscroft
altime() > > I want just the date, like 2007-06-15. The value will go into a > postgresql Date type column. >>> import datetime >>> d = datetime.date.today() >>> d.isoformat() '2007-06-15' >>> Rob. -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the current date, python 2.2

2007-06-15 Thread Rob Williscroft
a >> > postgresql Date type column. >> >> >>> import datetime >> >>> d = datetime.date.today() >> >>> d.isoformat() >> '2007-06-15' >> >>> >> >>> >> Rob. >> > Thank

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > So, I'm writing this to have your opinion on what tools I should use > to do this and what technique I should use. Take a look at parsing example on this page: http://wiki.python.org/moin/SimplePrograms -- HTH, Rob -- http://mail.python.org/mailman/list

easy_install from svn

2007-06-19 Thread Rob Cowie
of appending a fragment to the url? Would anyone be so kind as to provide a working example? cheers, Rob Cowie -- http://mail.python.org/mailman/listinfo/python-list

Re: easy_install from svn

2007-06-19 Thread Rob Cowie
On Jun 19, 8:13 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Rob Cowie wrote: > > I currently use easy_install to install packages from a custom, > > locally hosted package_index. The index consists of a single html doc > > with a list of package names and urls. Al

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